Backend component registry for Node.js & Typescript
ServerCN is a backend component registry for Node.js & TypeScript. It provides a robust collection of pre-configured components, boilerplates, and utilities for Node.js and TypeScript, enabling developers to scaffold production-ready code in seconds.
- β‘ Instant Scaffolding: Quickly generate backend components like Authentication, Logging, and Database setups.
- π‘οΈ Type-Safety First: Built entirely with TypeScript for robust and reliable code.
- π Secure by Design: Includes best-practice implementations for security (Argon2, JWT, Zod).
- π§© Modular Architecture: Add only what you need to your existing project.
- π Comprehensive Logging: Integrated with Pino and Winston for effective monitoring and debugging.
ServerCN allows you to quickly add the following components to your project:
- Authentication System (JWT, Refresh Tokens, Password Hashing)
- Database Connection (Mongoose/MongoDB)
- Input Validation (Zod)
- Error Handling (Global Error Handler, Async Wrapper)
- Logging (Winston, Pino)
Start a new project with a recommended, production-ready structure.
npx servercn-cli initAdd specific modules to your existing project. This allows for incremental adoption.
npx servercn-cli add [component-name]Examples:
npx servercn-cli add logger-pino
npx servercn-cli add logger-winstonnpx servercn-cli add error-handlernpx servercn-cli add response-formatternpx servercn-cli add async-handlernpx servercn-cli add file-uploadnpx servercn-cli add jwt-utilsnpx servercn-cli add loggernpx servercn-cli add rate-limiternpx servercn-cli add oauthnpx servercn-cli add health-check-
List all available registry item.
npx servercn-cli ls --all
-
List all available registry item in JSON structure.
npx servercn-cli ls --all --json
-
List all available registry commands.
npx servercn-cli list
-
List all available registry commands in JSON structure.
npx servercn-cli ls --json
-
List available components.
npx servercn-cli ls cp
-
List available all foundation.
npx servercn-cli ls fd
-
List available schema.
npx servercn-cli ls sc
-
List available blueprint.
npx servercn-cli ls bp
-
List available tooling.
npx servercn-cli ls tl
The generated code follows a clean, MVC-inspired architecture designed for scalability:
src/
βββ config/ # Environment variables and configuration
βββ controllers/ # Request handlers
βββ middlewares/ # Express middlewares (Auth, Error handling)
βββ models/ # Database models (Mongoose schemas)
βββ routes/ # API routes definitions
βββ services/ # Business logic layer
βββ utils/ # Helper functions and classes
βββ app.ts # App entry point
βββ server.ts # Server entry point- Runtime: Node.js
- Language: TypeScript
- Framework: Express.js
- Frontend: Next.js
We welcome contributions! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Built with π‘οΈ by Akkal Dhami and the ServerCN contributors
