Skip to content

The backend side of WYT.com project | nodeJS | Express | JWT | Docker | Sequelize | Postrgres

Notifications You must be signed in to change notification settings

germanruzca/wyt-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API app of WYT ( What you thinking?).

This repository is part of my WYT.com project, is just an application to give recommendations of movies, books, tv-shows and music.

1: Technologies

  • nodeJS
  • Express
  • Docker
  • Sequelize
  • Postrgres
  • JWT

2: Requirements

You need Docker and Docker Compose on your computer, because there is a docker-compose.yml file that creates a container to the Postgres database.

Also you need nodeJS, this project was made in the 16 version of node.

3: Clone and run the project.

  • Clone the repository
    git clone https://github.com/germanruzca/wyt-backend.git
    
    cd wyt-backend
  • Install dependencies
    npm install
  • Introduce the environment variables

You can create a .env file or in ZSH

  WYT="~/wyt"
  WYT_PSQL_HOST="0.0.0.0"
  WYT_PSQL_CONTAINER_NAME="wyt_postgres"
  WYT_PSQL_LISTEN_PORT="5001"
  WYT_PSQL_VOLUME_PATH="${WYT}/postgres/data"
  WYT_PSQL_DB="wyt_databse"
  WYT_PSQL_USER="wyt_user"
  WYT_PSQL_PASSWORD="passwordDB"
  WYT_ACTION_SECRET="passwordAccess"
  WYT_REFRESH_SECRET="passwordRefresh"
  • Go the docker folder

     cd containers
  • Install docker images and create container.

      docker-compose up
  • Start the project

      npm run start

    There is nodemon package.

    The backend starts in the 3001 port, sync with frontend.

4: Explaning the project.

This is the backend part of an application, the fronted (reactJS) could be find in this link.

There are four web services that provide the full CRUD.

Here the four end-points to each web service:

USERS:

people registered on the application

POSTS:

the post with the recommendations.

TYPES

storage the differents types of recommendations.

AUTH:

to login and sign up.

5: JWT

First, you need create a user, localhost/3001/auth/signup

{
  "firstName": "John",
  "lastName": "Lennon",
  "username": "john123",
  "password": "john123",
}

When you are in, you receive a response with an accesToken to use in others requests. You need to login (localhost/3001/auth/login) every time the token has expired.

(For now, there is no data when the models are created, so you must to know: to create a post is need create at least a type and a user.)

You can see example:

View Api in Postman

About

The backend side of WYT.com project | nodeJS | Express | JWT | Docker | Sequelize | Postrgres

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published