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.

express

API Response Formatter

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

express

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.

express

Auth Verification Middleware

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

express

Background Jobs (Cron)

The Background Jobs component provides a standardized way to schedule recurring tasks and background jobs in ServerCN using node-cron.

express

Email Service

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

express

Env Configuration

A type-safe environment variable configuration using Zod and Dotenv for Express applications.

express

File Upload (Cloudinary)

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

express

File Upload (ImageKit)

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

express

GitHub & Google OAuth

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

express

GitHub OAuth

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

express

Global Error Handler

Centralized error handling for Express applications using TypeScript.

express

Google OAuth

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

express

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).

express

Health Check Endpoint

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

express | nestjs

HTTP Status Codes

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

express

JWT Utilities

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

express

Not Found Handler

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

express

Password Hashing

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

express

Rate Limiter

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

express

Request Validator (Zod)

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

express

Role Based Access Control

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

express

Security Headers

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

express

Structured Logger

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

express

Swagger API Documentation

Automated OpenAPI documentation and interactive UI for Express APIs using Swagger.

express

Token & OTP Utilities

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

express

Validate ObjectId Middleware

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

express

Total components: 27 | Stable components: 27