gabrielbarth / backend-goBarber

Backend (node.js) project of barber shop scheduling app :barber:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoBarber

GoBarber (backend)


Backend (node.js) project of barber shop scheduling app πŸ’ˆ, developed during GoStack10 bootcamp.

πŸ’» Web version here
πŸ“± Mobile version here

πŸ”Ž Overview

This application allows:

  • users authentication (barbers on web version and clients on mobile version);
  • create and update users;
  • create, list and removing appointments;
  • notification of new appointments;
  • e-mail notifications about cancelled appointments.

πŸ”§ Some used tools

Insomnia

Allows testing API routes.

GoBarber

Postbird

Cross-platform PostgreSQL GUI client, written in JavaScript.

GoBarber

Sentry

Allows gebugging Node apps and prevent crashes across your entire stack.

GoBarber

Mailtrap

Allows inspect and debug your email samples before delivering them to your customers.

GoBarber

πŸ”— Project dependencies

β˜‘οΈ sentry/node // exception handling in production mode
β˜‘οΈ bcryptjs   // generate hash though user password
β˜‘οΈ date-fns   // node library to handle data
β˜‘οΈ bee-queue   // job/task queue for Node.js, backed by Redis
β˜‘οΈ cors   // node.js package to enable CORS with various option
β˜‘οΈ dotenv   // load environment variables in application paths
β˜‘οΈ express   // basically allows create backend application
β˜‘οΈ mongoose   // elegant mongodb object modeling for node.js
β˜‘οΈ express-async-errors   // allows express capture errors that happens inside async functions
β˜‘οΈ express-handlebars   // allows build semantic templates
β˜‘οΈ jsonwebtoken   // allows generate jwt token for users
β˜‘οΈ multer   // allows file uploads in application
β˜‘οΈ nodemailer   // allow easy email sending
β˜‘οΈ nodemailer-express-handlebars   // allows build semantic templates with nodemailer
β˜‘οΈ path   // provides utilities for working with file and directory paths
β˜‘οΈ pg   // allows use postgrees database
β˜‘οΈ pg-hstore   // allows use postgrees database too
β˜‘οΈ sequelize   // ORM Node.js for SQL databases (postgress in this case)
β˜‘οΈ youch   // pretty error reporting for Node.js
β˜‘οΈ yup   // treat validations

Development libs:

β˜‘οΈ eslint // analyzes your code to quickly find problems
β˜‘οΈ nodemon // allows automatically restarting app
β˜‘οΈ prettier //code formatter, makes code prettier
β˜‘οΈ sequellize-cli // sequelize client - ORM for SQL databases
β˜‘οΈ sucrase // allows ES6 import/export modules

πŸ’» Running on your machine

Consider the steps below to run this API on your machine:

First step: You'll need three docker containers running: redis, mongo and other to postgress.

This commands can create these docker containers:

  • docker run --name redisbarber -p 6379:6379 -d -t redis:alpine;
  • docker run --name mongobarber -p 27017:27017 -d -t mongo;
  • docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres;

Some tips about docker:

  • docker ps - list all docker containers (in execution).
  • docker ps -a - list all docker containers (in execution or not).
  • docker stop <container-name> - stops container execution.
  • docker start <container-name> - starts container execution (required whenever you restart your machine).
  • docker logs <container-name> - shows container log (used in errors case).

Second step: Clone this repository on your machine and do necessary configurations.

  1. Clone this repo using https://github.com/gabrielbarth/backend-goBarber.git.
  2. Move to the appropriate directory: cd backend-goBarber.
  3. Run yarn to install dependencies.
  4. Copy the .env.example file and rename it to just .env.
  5. Add all the values for the environment variables on .env file.
  6. Run yarn start and yarn queue to run the servers at http://localhost:3000.

πŸ’‘ 🀝 Contributing

Please feel free to contributing and submitting pull requests.

πŸ™ Acknowledgments

  • Rocketseat team
  • Rocketseat community

πŸ€” Any question?

Contact me on my social medias:
LinkedIn
Instagram
YouTube
Discord (gabrielbarth1#0492)
Or send me an email πŸ“¨: gabrielbarth.dev@gmail.com.

Made with β™₯ by Gabriel Barth

About

Backend (node.js) project of barber shop scheduling app :barber:


Languages

Language:JavaScript 98.2%Language:HTML 1.8%