ServerCN Components

Production-ready ServerCN components for building scalable backends. Here you can find all the components available in the library. We are working on adding more components.

API Error Handler

A lightweight, production-ready error handling utility for Express applications.

View docs

API Response Formatter

A standardized, type-safe API response wrapper for Express applications.

View docs

Async Request Handler

The Async Handler component is a foundational Express utility that ensures all errors thrown inside asynchronous route handlers are reliably captured and forwarded to Express’s global error middleware.

View docs

Auth Verification Middleware

Auth Verification Middleware protects private routes by validating user authentication using JWT access tokens and refresh tokens.

View docs
experimental

Email Service

The Send Email component provides a standardized way to send emails in ServerCN using nodemailer as the email service provider.

View docs

File Upload

The File Upload component provides a standardized way to handle file uploads in ServerCN using Cloudinary as the storage provider.

View docs

Generate OTP/Token Utils

Cryptographically secure utility functions for generating OTPs, random tokens, and unique identifiers for authentication workflows.

View docs
experimental

GitHub OAuth

The GitHub OAuth component provides a standardized way to handle GitHub OAuth authentication in ServerCN.

View docs

Global Error Handler

Centralized error handling for Express applications using TypeScript.

View docs
experimental

Google OAuth

Google OAuth

View docs

Graceful Shutdown Handler

The Graceful Shutdown Handler ensures that your ServerCN application terminates safely and predictably when the process receives shutdown signals (e.g. SIGTERM, SIGINT).

View docs

Health Check

Production-ready health check endpoints for monitoring API status, database connectivity, and system health in Express applications.

View docs

HTTP Status Codes

Centralized, type-safe HTTP status codes for consistent API responses.

View docs

JWT Utils Function

JWT Utils Function for JSON Web Token authentication with access & refresh token support for Express

View docs

Not Found Handler

The Not Found Handler component provides a standardized way to handle not found routes in ServerCN.

View docs

Password Hashing

The Password Hashing component provides a standardized way to hash passwords in ServerCN using bcryptjs, argon2, pbkdf2, scrypt.

View docs

Rate Limiter

The Rate Limiter component provides a standardized way to handle rate limiting in ServerCN.

View docs

Request Validator(Zod)

The Request Validator(Zod) middleware provides a type-safe and declarative way to validate incoming HTTP requests in ServerCN using Zod.

View docs

Role Based Access Control

The Role Based Access Control component provides a standardized way to handle role based access control in ServerCN.

View docs

Security Headers

The Security Headers component provides a standardized way to handle security headers in ServerCN.

View docs
experimental

SMS Service

The SMS Service component provides a standardized way to handle SMS notifications in ServerCN.

View docs

Structured Logger

Structured and configurable logging for Node.js applications using Winston or Pino.

View docs

Validate ObjectId Middleware

The Validate ObjectId Middleware component provides a standardized way to validate MongoDB ObjectIds in ServerCN.

View docs

Version: 1.0.0 | Total components: 23 | Stable components: 19