An open API service indexing awesome lists of open source software.

https://github.com/masb0ymas/express-api-sequelize

express-api with Sequelize
https://github.com/masb0ymas/express-api-sequelize

expressjs expresso husky nodejs sequelize-orm sequelize-typescript swc typescript

Last synced: 22 days ago
JSON representation

express-api with Sequelize

Awesome Lists containing this project

README

        

# Express API with Sequelize

[![Documentation](https://img.shields.io/badge/Documentation-yes-brightgreen.svg)](https://github.com/masb0ymas/express-api-sequelize#readme)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/masb0ymas/express-api-sequelize/graphs/commit-activity)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/masb0ymas/express-api-sequelize/blob/master/LICENSE.md)
[![Version](https://img.shields.io/badge/Version-6.0.0-blue.svg?cacheSeconds=2592000)](https://github.com/masb0ymas/express-api-sequelize/releases/tag/v6.0.0)
[![Express](https://img.shields.io/badge/Express-4.21.2-informational?logo=express&color=22272E)](https://expressjs.com/)

![Node](https://badges.aleen42.com/src/node.svg)
![Eslint](https://badges.aleen42.com/src/eslint.svg)
![TypeScript](https://badges.aleen42.com/src/typescript.svg)
![Docker](https://badges.aleen42.com/src/docker.svg)

A robust Express API template with TypeScript, Sequelize ORM, and comprehensive tooling for building production-ready applications.
Base API using [express-api](https://github.com/masb0ymas/express-api)

## Features

- **[TypeScript](https://github.com/microsoft/TypeScript)** `5.8.x` - Type-safe JavaScript
- **[Sequelize](https://github.com/sequelize/sequelize)** `6.x` - Powerful ORM for SQL databases
- **[Express](https://expressjs.com/)** `4.21.x` - Fast, unopinionated web framework
- **[Nodemailer](https://github.com/nodemailer/nodemailer)** `6.x` - Email sending made simple
- **[Zod](https://github.com/colinhacks/zod)** `3.x` - TypeScript-first schema validation
- **[PostgreSQL](https://www.postgresql.org/)** - Advanced open source database
- **Code Quality**
- JavaScript Style with [Standard with TypeScript](https://github.com/standard/eslint-config-standard-with-typescript)
- Code formatting with [Prettier](https://github.com/prettier/prettier)
- [ESLint](https://github.com/prettier/eslint-config-prettier) and [TypeScript ESLint](https://github.com/typescript-eslint/typescript-eslint) integration
- **API Documentation** with [Swagger](https://github.com/swagger-api/swagger-ui) OpenAPI `3.x`
- **Logging** with [Pino](https://github.com/pinojs/pino)
- **Containerization** with [Docker](https://www.docker.com/)

## 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**

```bash
git clone https://github.com/masb0ymas/express-api-sequelize.git
cd express-api-sequelize
```

2. **Set up environment variables**

```bash
cp .env.example .env
```

Then configure database settings in the `.env` file.

or you can generate .env with command:

```bash
yarn secret
```

3. **Install dependencies**

```bash
yarn install
```

4. **Set up database**

```bash
yarn db:create && yarn db:reset
```

Or create your database manually

5. **Start development server**

```bash
yarn dev
```

With file watching:

```bash
yarn dev:watch
```

## Deployment

### Release Process

```bash
yarn release
```

### Docker Deployment

```bash
# 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](https://badges.aleen42.com/src/github.svg)](https://github.com/masb0ymas)
[![Twitter](https://badges.aleen42.com/src/twitter.svg)](https://twitter.com/masb0ymas)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Informational?logo=linkedin&color=0A66C2&logoColor=white)](https://www.linkedin.com/in/masb0ymas)

## Support

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I03MVAI)

[](https://trakteer.id/masb0ymas)

[](https://www.paypal.com/paypalme/masb0ymas)