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

Repository files navigation

ServerCN

Backend components CLI 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.

The goal of servercn is similar to shadcn/ui for frontends: instead of hiding logic behind heavy abstractions, it gives you copy‑friendly, understandable, and extensible backend building blocks that you fully own.


ServerCN Components ServerCN Error Response

🚀 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. Installation

You can use the CLI directly via npx or install it globally to use it across multiple projects.

npm install servercn

2. Initialize a Project

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

npx servercn init

3. Add Components

Add specific modules to your existing project. This allows for incremental adoption.

servercn add [component-name]

Examples:

servercn add auth
servercn add logger

4. List Components

View all available components that you can add to your project.

servercn list

🏗️ 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          # Application 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.


Built with 🗡️ by Akkal Dhami

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

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages