A high-performance, scalable RESTful API built with Node.js, Express, TypeScript, and WebSocket support. Features authentication, real-time capabilities, database integration, and comprehensive error handling.
- RESTful API - Clean REST endpoints with Express.js
- WebSocket Server - Real-time bidirectional communication
- Authentication - JWT-based authentication with refresh tokens
- Database - MongoDB with Mongoose ODM
- TypeScript - Full type safety and modern ES features
- Validation - Request validation with Joi/Zod
- Error Handling - Centralized error handling middleware
- Rate Limiting - API rate limiting and throttling
- Logging - Structured logging with Winston
- Testing - Unit and integration tests with Jest
- Docker - Containerized deployment
- Node.js 18+ - Runtime
- Express.js - Web framework
- TypeScript - Language
- MongoDB - Database
- Mongoose - ODM
- Socket.io - WebSocket library
- JWT - Authentication
- Winston - Logging
- Jest - Testing
- ESLint - Linting
npm install# Development
npm run dev
# Production
npm run build
npm start
# With Docker
docker-compose upPOST /api/auth/register - Register user
POST /api/auth/login - Login
POST /api/auth/refresh - Refresh token
GET /api/users - Get users
GET /api/users/:id - Get user
POST /api/users - Create user
PUT /api/users/:id - Update user
DELETE /api/users/:id - Delete user
WebSocket: ws://localhost:3000
nodejs-backend-api/
├── src/
│ ├── controllers/ # Route controllers
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── middleware/ # Custom middleware
│ ├── services/ # Business logic
│ ├── utils/ # Utilities
│ ├── config/ # Configuration
│ ├── websocket/ # WebSocket handlers
│ └── app.ts # Express app
├── tests/ # Test files
└── docker/ # Docker files
MIT