Skip to content

ServerCN , the backend component registry for Node.js inspired by shadcn/ui. If shadcn/ui fixed frontend developer experience, ServerCN fixes backend developer experience. (Under Development)

License

Notifications You must be signed in to change notification settings

AkkalDhami/servercn

ServerCN

Backend component registry for Node.js & Typescript

License TypeScript Node.js

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.


ServerCN Components

πŸš€ Key Features

  • ⚑ 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.

πŸ“¦ Components

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)

πŸ› οΈ Usage

1. Initialize a Project

Start a new project with a recommended, production-ready structure.

npx servercn-cli init

2. Add Components

Add 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-winston

Components

  • API Error Handler

npx servercn-cli add error-handler
  • API Response Formatter

npx servercn-cli add response-formatter
  • Async Handler

npx servercn-cli add async-handler
  • File Upload provider

npx servercn-cli add file-upload
  • JWT Utils

npx servercn-cli add jwt-utils
  • Logger

npx servercn-cli add logger
  • Rate Limiter

npx servercn-cli add rate-limiter
  • OAuth Provider

npx servercn-cli add oauth
  • Health Check

npx servercn-cli add health-check

And more

3. CLI Commands

Visit for more

  • 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

Visit for more

πŸ—οΈ Project Structure

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

πŸ’» Tech Stack

  • Runtime: Node.js
  • Language: TypeScript
  • Framework: Express.js
  • Frontend: Next.js

🀝 Contributing

We welcome contributions! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.

Stargazers over time

Stargazers over time


Built with πŸ—‘οΈ by Akkal Dhami and the ServerCN contributors

About

ServerCN , the backend component registry for Node.js inspired by shadcn/ui. If shadcn/ui fixed frontend developer experience, ServerCN fixes backend developer experience. (Under Development)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages