Skip to content

ruusukivi/fullstack-part13-postgresql

Repository files navigation

Full Stack Open 2023 - Deep Dive Into Modern Web Development

Part 13 - Using relational databases

Node.js backend application using Express, Sequelize and PostgreSQL.

Setting up PostgreSQL with Docker

Pull Postgres image from Docker Hub and start a container in port 5432.

docker pull postgres

docker run -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 postgres

Add database url as an environment variable.

DATABASE_URL='postgres://postgres:mysecretpassword@localhost:5432/postgres'

Access database via console

docker exec -it NAME-OF-THE-CONTAINER psql -U postgres postgres

Setting up the application

Install dependences and run the application

npm install 

npm start

Run Jest tests for APIs

npm test

Run commandline version (prints existing blogs from the database)

npm run cli

Exercises

About

FullStack Open 2023 - Part 13 Using relational databases

Topics

Resources

Stars

Watchers

Forks