Introduction

ServerCN is a revolutionary approach to backend development. It's not a framework; it's a component-based development system designed to help you build scalable, maintainable, and production-ready Node.js backends with the same modularity you enjoy in modern frontend development.

Instead of installing a monolithic framework that dictates your project structure, ServerCN provides a set of high-quality, decoupled components that you can "add" to your project. These components are then yours to own, modify, and extend.

The Vision

Modern web development has moved towards atomic design and component-driven architectures for the frontend. However, backend development often remains stuck in monolithic or overly-abstracted frameworks.

ServerCN brings the shadcn/ui philosophy to the backend:

  • No Hidden Abstractions: You own the code. It lives in your repository.
  • Architecture Aware: Whether you use MVC, Feature-based, or Clean Architecture, ServerCN adapts to you.
  • Developer First: Built with TypeScript for the best developer experience.

Why ServerCN?

Building a production-ready backend involves reinventing the wheel for common tasks:

  • How do I handle global errors?
  • What's the best way to structure JWT authentication?
  • How should I validate incoming requests?
  • How do I keep my folder structure clean as the project grows?

ServerCN answers these questions by providing battle-tested patterns as copy-pasteable (via CLI) components.

Core Principles

When you add a component using ServerCN, the source code is copied directly into your project. There are no runtime dependencies on a "ServerCN Core" library. This means you can debug, customize, and refactor the code as if you wrote it yourself.

ServerCN encourages building features by composing small, focused tools. Need auth? Add the auth component. Need better error handling? Add the error-handler. They work together seamlessly without being tightly coupled.

ServerCN doesn't care if you're building a simple Express app or a complex microservices architecture. Our CLI is smart enough to detect your project structure and place files where they belong according to YOUR conventions.

Because the code is explicit and follows consistent patterns, it is highly readable for AI coding assistants. This makes it easier to use tools like Copilot or ChatGPT to generate new features that match your existing codebase.

What ServerCN is NOT

To understand ServerCN, it's important to know what it isn't:

  • Not a Framework: It doesn't "run" your app. You still use Express, Fastify, or even Next.js API routes.
  • Not an ORM: It works alongside ORMs like Prisma, Drizzle, or Mongoose rather than replacing them.
  • Not a Black Box: There is no magic happening behind node_modules.

Next Steps

Ready to build better backends? Head over to the Installation guide to get started with your first ServerCN project.