Skip to content

Rowkash/blog-api

Repository files navigation

NestJS PostgreSQL Sequelize Docker

My simple server web API written in NestJS framework. PostgreSQL database is used for data storage. Sequelize is used to interact with the database

NestJS
NestJS
PostgresSQL
PostgresSQL
Sequelize
Sequelize
Docker
Docker

Installation and launch methods

Copy repository

git clone https://github.com/Rowkash/blog-api.git

At the root of the repository, create a ".development.env" and ".production.env" files with the settings for connecting to the database and our JWT secret code. For example:

PORT=5000 # Port of our main app  
POSTGRES_HOST=localhost # (use "postgres" when running a project using Docker)
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=root
POSTGRES_DB=blog
JWT_SECRET=secret
  • For production we use the settings file " .production.env ", for development we use " .development.env "

Without Docker

  • Install PostgreSQL on your computer from the official site
  • Create server instance and database, add user and password as specified in .development.env file
  • Make sure postgreSQL is up and running
  • Open the project in the editor and install the dependencies
# yarn package manager
yarn install
yarn start ## (or "yarn start:dev" for development )

# npm package manager
npm install
npm run start ## (or "npm run start:dev" for development )

# pnpm package manager
pnpm install
pnpm run start ## (or "pnpm run start:dev" for development )

With Docker

  • Install Docker from the official site
  • Run the command:
docker-compose up
# -d - to run in the background
# --build - to rebuild containers

Documentation on using the API is located at the link "http://localhost:5000/api/docs"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published