You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A base project template for Node.js API applications built with TypeScript. Includes configurations for Docker, authentication, logging, and basic CRUD operations. Perfect for rapid scaffolding with the NTW CLI (based on node-ts-starter).
A robust and scalable starter project for Node.js, Express, MongoDB, TypeScript, and more. This project provides a solid foundation for developing modern backend applications with a modular architecture and advanced security features.
π Features
π Authentication & Security
JWT Authentication with refresh tokens
OTP (One-Time Password) system for:
Account verification
Password reset
Secure login
Email update
Phone verification
Protection against common attacks (CSRF, XSS, etc.)
Rate limiting and brute force protection
Secure session management
π§ Email System
HTML and text email templates
Email queue with Bull
Templates for:
Account creation
Account verification
Password reset
OTP login
Password reset confirmation
π Architecture
Modular and scalable architecture
Repository pattern for data access
Centralized error handling
Advanced logging
Flexible configuration
π Technologies
Node.js & Express
TypeScript
MongoDB with Mongoose
Redis for caching and sessions
Bull for queues
JWT for authentication
Nodemailer for emails
Jest for testing
π Installation
Prerequisites
Node.js (v14 or higher)
MongoDB
Redis
Docker (optional)
Local Installation
Clone the repository:
git clone https://github.com/fless-lab/Node-TypeScript-Wizard.git
cd Node-TypeScript-Wizard
Install dependencies:
npm install
Configure environment variables:
cp .env.example .env
# Edit .env with your configurations
Start in development mode:
npm run start
Docker Installation
# Start in development mode
npm run docker:launch
# Start in production mode
npm run docker:launch:prod
π Project Structure
βββ src/
β βββ apps/ # Main applications and modules
β βββ modules/ # Shared modules
β β βββ authz/ # Authentication and authorization
β β βββ features/ # Business features
β β βββ shared/ # Shared utilities
β βββ server.ts # Entry point
βββ templates/ # Email templates
βββ tests/ # Unit and e2e tests
βββ docs/ # Documentation
βββ ...
π§ Configuration
The project uses a flexible configuration system based on environment variables. Main configurations include:
Database configuration
Redis configuration
JWT configuration
Email configuration
Security configuration
Logging configuration
π API Endpoints
Authentication
POST /auth/register - Registration
POST /auth/login - Login
POST /auth/refresh - Refresh token
POST /auth/logout - Logout
POST /auth/forgot-password - Password reset request
POST /auth/reset-password - Password reset
OTP
POST /auth/otp/generate - Generate OTP
POST /auth/otp/validate - Validate OTP
π§ͺ Testing
# Run all tests
npm test# Run tests with coverage
npm run test:coverage
# Run e2e tests
npm run test:e2e
# Run tests in watch mode
npm run test:watch
π§ Email Templates
The project includes email templates for different use cases:
Contributions are welcome! Please check CONTRIBUTING.md for guidelines.
π License
This project is licensed under the ISC License. See the LICENSE file for details.
π₯ Authors
fless-lab
π Acknowledgments
All contributors
The open source community
About
A base project template for Node.js API applications built with TypeScript. Includes configurations for Docker, authentication, logging, and basic CRUD operations. Perfect for rapid scaffolding with the NTW CLI (based on node-ts-starter).