Skip to content

masb0ymas/express-api-sequelize

Repository files navigation

Express API with Sequelize

Documentation Maintenance License: MIT Version Express

Node Eslint TypeScript Docker

A robust Express API template with TypeScript, Sequelize ORM, and comprehensive tooling for building production-ready applications. Base API using express-api

Features

Prerequisites

  • Node.js >= 20.x
  • PostgreSQL
  • Docker (optional)

Module System

  • By default, the main branch uses CommonJs (type: commonjs)
  • For ES Module pending implementation because of Sequelize issue.

Getting Started

  1. Clone the repository

    git clone https://github.com/masb0ymas/express-api-sequelize.git
    cd express-api-sequelize
  2. Set up environment variables

    cp .env.example .env

    Then configure database settings in the .env file.

    or you can generate .env with command:

    yarn secret
  3. Install dependencies

    yarn install
  4. Set up database

    yarn db:create && yarn db:reset

    Or create your database manually

  5. Start development server

    yarn dev

    With file watching:

    yarn dev:watch

Deployment

Release Process

yarn release

Docker Deployment

# 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.0

Scripts

  • npm run dev - Start development server with hot reloading
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run db:create - Create database
  • npm run db:reset - Reset database schema
  • npm run release - Release a new version

Author

Github Twitter LinkedIn

Support

ko-fi