A robust Express API server built with TypeScript, featuring comprehensive tooling for modern backend development.
- TypeScript
5.8.x- Type-safe JavaScript - Express
4.21.x- Fast, unopinionated web framework - Zod
3.x- TypeScript-first schema validation - PostgreSQL - Advanced open source database
- Code Quality
- JavaScript Style with Standard with TypeScript
- Code formatting with Prettier
- ESLint and TypeScript ESLint integration
- API Documentation with Swagger OpenAPI
3.x - Logging with Pino
- Containerization with Docker
- Node.js >= 20.x
- PostgreSQL
- Docker (optional)
- By default, the
mainbranch uses ES Modules (type: module)
-
Clone the repository
git clone https://github.com/masb0ymas/express-api.git cd express-api -
Set up environment variables
cp .env.example .env
Then configure database settings in the
.envfile.or you can generate .env with command:
yarn secret
-
Install dependencies
yarn install
-
Start development server
yarn dev
With file watching:
yarn dev:watch
yarn release# Build the Docker image
docker build -t yourname/express:v1.0.0 .
# Run the container
docker run -p 7000:8000 -d yourname/express:v1.0.0npm run dev- Start development server with hot reloadingnpm run build- Build for productionnpm run start- Start production servernpm run release- Release a new version