โก Zero-config setup | ๐ก๏ธ Security-first | ๐ Fully tested | ๐ฏ Type-safe
| Feature | Description | Status |
|---|---|---|
| ๐ฏ TypeScript 5.9 | Latest TypeScript with strict mode | โ |
| ๐ก๏ธ Security Suite | Helmet, CORS, Rate Limiting | โ |
| ๐ Testing | Vitest + Supertest + Coverage | โ |
| ๐ API Documentation | Swagger/OpenAPI 3.0 | โ |
| ๐จ Code Quality | ESLint + Prettier + Husky | โ |
| ๐ Dev Experience | Hot reload, linting, formatting | โ | | ๐ฆ Production Ready | Build optimization, error handling | โ |
A production-ready Node.js + Express + TypeScript boilerplate, Generated using create-rjx โก
src/
โโโ ๐ app.ts # Express app configuration
โโโ ๐ server.ts # Server entry point
โโโ ๐ config/ # Configuration modules
โ โโโ corsConfig.ts # CORS configuration
โ โโโ env.ts # Environment variables
โ โโโ halmetConfig.ts # Security headers
โ โโโ loggerConfig.ts # Winston logger setup
โ โโโ rateLimitConfig.ts # Rate limiting
โโโ ๐ docs/ # API documentation
โ โโโ swagger.yaml # OpenAPI 3.0 spec
โโโ ๐ middleware/ # Custom middleware
โ โโโ errorHandler.ts # Global error handler
โโโ ๐ tests/ # Test suites
โ โโโ health.test.ts # Health check tests
โโโ ๐ router.ts # Route definitions
| Script | Description | Command |
|---|---|---|
dev |
Start development server | npm run dev |
dev:hot |
Hot reload + linting | npm run dev:hot |
build |
Build for production | npm run build |
start |
Start production server | npm start |
test |
Run tests | npm test |
test:watch |
Watch mode testing | npm run test:watch |
coverage |
Generate coverage report | npm run coverage |
lint |
Lint code | npm run lint |
clean |
Clean build artifacts | npm run clean |
Access interactive API documentation at: http://localhost:3000/docs
GET /healthResponse:
{
"status": "ok",
"uptime": 12.345,
"timestamp": 1690000000000
}- Content Security Policy (CSP)
- X-Frame-Options
- X-Content-Type-Options
- And more security headers
- Configurable CORS policies
- Environment-based settings
- Global rate limiting
- Configurable per environment
- IP-based tracking
- Unit Tests: Vitest for fast execution
- Integration Tests: Supertest for API testing
- Coverage Reports: Built-in coverage analysis
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run coverage.env.dev # Development environment
.env.prod # Production environment
.env.test # Test environment# Server
PORT=3000
NODE_ENV=development
# # Database
# MONGODB_URI=mongodb://localhost:27017/myapp
# # Security
# RATE_LIMIT_WINDOW=15
# RATE_LIMIT_MAX=100- TypeScript-specific rules
- Import sorting
- Unused imports detection
- Prettier integration
- Consistent code formatting
- TypeScript/JavaScript support
- JSON/CSS/Markdown formatting
- Pre-commit linting
- Pre-commit formatting
- Commit message validation
npm run build
npm start- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Raj (Softenrj)
โญ Star this repo if you found it helpful!