Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bratelion/koa-sequelize-skeleton
Simple typescript skeleton in KoaJs + Sequelize ORM with Postgres database
https://github.com/bratelion/koa-sequelize-skeleton
Last synced: about 2 months ago
JSON representation
Simple typescript skeleton in KoaJs + Sequelize ORM with Postgres database
- Host: GitHub
- URL: https://github.com/bratelion/koa-sequelize-skeleton
- Owner: Bratelion
- Created: 2022-02-04T16:37:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-09T20:50:57.000Z (over 2 years ago)
- Last Synced: 2023-06-09T23:25:01.100Z (over 1 year ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# koa-sequelize-skeleton
Simple typescript skeleton in KoaJs + Sequelize ORM with Postgres database
## Setup
1. Create the postgres database on Heroku and note the URI in configuration
2. Paste the URI into .env file under DATABASE_URL
3. Run commands:
- `yarn db:migrate` to create tables in the database
- `yarn db:seed` to seed the data into the previously created tables4. To start the server in development mode, run command:
- `yarn start:dev`Warning: In case of deleting the entire database, run command:
- `yarn db:rollback`## Models
Created are 2 models, including relation Many-To-Many between them:
- User (id, name, createdAt)
- City (id, name, createdAt)
- User_To_City (id, userId, cityId, createdAt)
## Seeds
Database is seeded with generic user and city data, as well as relation between them
## Notes
`global-bundle.pem` is used to certificate all traffic to and from database and server
Prettier configuration is in `.prettierrc`
Eslint configuration is in `.eslint.json`