This is the third module of GoStack(old journey) from RocketSeat. This repository is only the backend of the application, the web and mobile versions are part of the next modules.
GoBarber is an application designed for service management between barbers and customers.
With Gobarber it is possible to register and make an appointment/service with your barber and/or become a provider of these services.
To see the new version of GoBarber,refactored with typescript and new patterns, click here.
Before downloading and running the project, you must have Node.js already installed and then install the following tools:
Unfortunately, sequelize migrations only work until Node version 10.13.0. I recommend using the node version manager nvm to install this version.
Open the terminal and execute the following commands:
# Clone the project
$ git clone https://github.com/marchetti2/gobarber-node.git
# Access the folder
$ cd gobarber-node
# Install the dependencies
$ yarn
Using the docker, start an instance of the databases below.
# PostgreSQL
$ docker run --name postgres -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
# MongoDB
$ docker run --name mongodb -p 27017:27017 -d -t mongo
# Redis
$ docker run --name redis -p 6379:6379 -d -t redis:alpine
To find out if the databases are running, run the following command:
$ docker ps
If not, run:
$ docker start postgres mongodb redis
From the .env.example
file at the root of the project, create another file called .env
using the same structure and completing the missing variables.
First, verify that the databases are running. From the API directory, run the following commands:
# Create tables in PostgreSQL
$ yarn sequelize db:migrate
$ yarn sequelize db:seed:all
# Run the server
$ yarn dev
$ yarn queue
-
To view the tables created in the postgres database, use the PostgreSQL GUI client.
-
To test the routes, you can use Insomnia. The workspace used in this API is available, just click the button below.
This is a RocketSeat GoStack course project(old journey).