A Node.js + TypeScript + Express backend service with PostgreSQL, Clerk authentication, and Swagger documentation.
- Node.js (v14 or higher)
- PostgreSQL
- Clerk account for authentication
- Clone the repository
- Install dependencies:
npm install
- Create a
.envfile based on.env.example:cp .env.example .env
- Update the
.envfile with your configuration:- Set up your PostgreSQL database credentials
- Add your Clerk API keys
- Configure other environment variables as needed
Start the development server:
npm run devThe server will start on http://localhost:3000 (or the port specified in your .env file).
Access the Swagger documentation at:
http://localhost:3000/api-docs
Run tests:
npm testRun tests in watch mode:
npm run test:watchGenerate test coverage report:
npm run test:coverageBuild the application:
npm run buildStart the production server:
npm startsrc/
├── config/ # Configuration files
├── controllers/ # Route controllers
├── middlewares/ # Express middlewares
├── models/ # Database models
├── routes/ # API routes
├── services/ # Business logic
├── utils/ # Utility functions
└── test/ # Test files
- TypeScript support
- PostgreSQL with TypeORM
- Clerk authentication
- Swagger API documentation
- Rate limiting
- Error handling
- Security headers (Helmet)
- CORS support
- Request logging (Morgan)
- Jest testing setup