Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vmnog/gobarber-backend

Node.js backend for barbershop where the barber can manage his appointment times and the client can make appointments with the barber.
https://github.com/vmnog/gobarber-backend

Last synced: 1 day ago
JSON representation

Node.js backend for barbershop where the barber can manage his appointment times and the client can make appointments with the barber.

Awesome Lists containing this project

README

        

GoBarber Backend

### Environment

- Eslint: linting the code
- Prettier: make the code prettier
- EditorConfig: force standarts vscode for all coders
- Esm: able to use ES5 import/export syntax
- Docker: create containers without having to install database in computer
- Postgres: for realational sql data
- Sequelize: to interact with postgres via MVC
- Bcryptjs: to encrypt data such as user's password
- jsonwebtoken: to create session for a user and login
- MD5 Online: generate sentence hash to security use of jwt (SessionController)
- YUP: to validate inputs on http requests
- Multer: to handle multi part form data (file upload)
- Crypto: to generate handle bytes to storage files with unique names
- path/resolve: to handle with folder location in this project (where the files are going to be storaged)
- date-fns: to handle dates/days/hour in providers appointments
- Nodemailer: to send emails
- handlebarsjs: to set template engines for emails
- Sentry: to see / manage errors more clearly
- Youch: to treat and format errors

## How to run

Clone de project to your local repository

```
$ git clone https://github.com/vmnog/gobarber-backend.git

$ cd gobarber-backend

```

Install all dependencies

```
$ yarn install
```

Start / Create your Docker Postgres Container:

```
$ docker run --name database -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
```

Start / Create your Docker MongoDB Container:

```
$ docker run --name mongobarber -p 27017:27017 -d -t mongo

```

Check if this container is running:

```
$ docker ps
```

To visualize the postgres database we are going to use Postbird

![](assets/postbird_login.png)

Open Postbird and create a new database called `gobarber`

Run all migrations to create all needed tables

```
$ yarn sequelize db:migrate
```

To visualize the email that we are sending to the provider we use Mailtrap.

Using mailtrap substitute the values in src/app/config/mail.js to your smtp values, otherwise the emails feature won't work.

### Continue ...