A robust Express API template with TypeScript, Sequelize ORM, and comprehensive tooling for building production-ready applications. Base API using express-api
- TypeScript
5.8.x- Type-safe JavaScript - Sequelize
6.x- Powerful ORM for SQL databases - Express
4.21.x- Fast, unopinionated web framework - Nodemailer
6.x- Email sending made simple - 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 CommonJs (type: commonjs) - For ES Module pending implementation because of Sequelize issue.
-
Clone the repository
git clone https://github.com/masb0ymas/express-api-sequelize.git cd express-api-sequelize -
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
-
Set up database
yarn db:create && yarn db:resetOr create your database manually
-
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 db:create- Create databasenpm run db:reset- Reset database schemanpm run release- Release a new version