Skip to content

This repository provides a minimal working example of seqeulize-typescript using Docker-Compose, Models, Relations, Migrations and Seeders.

Notifications You must be signed in to change notification settings

TomasKostadinov/sequelize-ts-minimal-working-example

Repository files navigation

Sequelize-Typescript Minimal Example

This repository provides a minimal working example of seqeulize-typescript using

  • Docker-Compose
  • Models
  • Relations
  • Migrations
  • Seeders

How to use

  1. Create a .env file with the following content:
POSTGRES_PASSWORD=postgres
POSTGRES_USER=minimal
POSTGRES_DB=minimal
  1. Execute docker-compose up. The database will be created, all migrations will be run and the data will be seeded with a preset Organization and User.
  2. Open localhost:80/api/v1
  3. You should see the following:
[
  {
    "id": 1,
    "name": "Tomas",
    "org_id": 1,
    "createdAt": "2021-01-12T09:24:14.856Z",
    "updatedAt": "2021-01-12T09:24:14.856Z",
    "organization": {
      "id": 1,
      "name": "Firma",
      "createdAt": "2021-01-12T09:24:14.825Z",
      "updatedAt": "2021-01-12T09:24:14.825Z"
    }
  }
]

About

This repository provides a minimal working example of seqeulize-typescript using Docker-Compose, Models, Relations, Migrations and Seeders.

Topics

Resources

Stars

Watchers

Forks