Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- fork or download this repository
- install dependencies with `npm i`
- create fitness_app database (application access `postgresql://localhost:5432/fitness_app`, make sure you use correct port and db name )
- create fitness_app database with `docker compose up -d` or manually (application access `postgresql://postgres:root@localhost:5432/fitness_app`, make sure you use correct port, db name and db credentials )
- create db schema and populate db with `npm run seed`
- run express server with `npm start`

Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: fitness-app

services:
db:
container_name: fitness-app-database
image: postgres:16
environment:
POSTGRES_DB: fitness_app
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data

volumes:
postgres_data:
2 changes: 1 addition & 1 deletion src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Sequelize } from 'sequelize'
import defineExercise from './exercise'
import defineProgram from './program'

const sequelize: Sequelize = new Sequelize('postgresql://localhost:5432/fitness_app', {
const sequelize: Sequelize = new Sequelize('postgresql://postgres:root@localhost:5432/fitness_app', {
logging: false
})

Expand Down