Awsome Aircuts and Shaves
About the project | Technologies | Getting started | How to contribute | License
This project is a Rest API for a barbershop application. Its function consists of managing users and appointments: creating user and service providers registers; book appointments between them; send an email for password recovering; caching storage for lists existing providers and appointments; store notifications for new user appointments.
And it was created during the GoStack Bootcamp by Rocketseat. That was focused on creating an entire application using React, React Native, NodeJS, and other tools. Aborting the following topics: ensure authentication, application routes, ORM for database persistence, SQL and NoSQL, caching, data validation, SOLID, upload files, establishing default linting code pattern, automatic tests, and rater limit.
Check out the web application: gobarber-web
Check out the mobile application: gobarber-app
Technologies used to develop the API:
- Node.js
- TypeScript
- Express
- Multer
- TypeORM
- JWT-token
- uuid v4
- PostgreSQL
- Date-fns
- Jest
- Eslint
- Prettier
- EditorConfig
Import the Insomnia.json
on Insomnia App or click on Run in Insomnia button
Obs.: I recommend use docker.
Assuming that you have docker installed on your computer, just follow the steps below. Otherwise, you can install docker from here.
1. Clone the project and access the folder
$ git clone https://github.com/sonnymarinho/gobarber-api.git && cd gobarber-api
2. Install the dependencies
$ yarn
3. Create the docker's containers
# Using docker, create the instance of:
# --- PostgreSQL
$ docker run --name gobarber_postgres -e POSTGRES_PASSWORD='mypassword' -p 5432:5432 -d postgres
# --- MongoDB
$ docker run --name gobarber_mongo -p 27017:27017 -d mongo
# --- Redis
$ docker run --name gobarber_redis -p 6379:6379 -d redis:alpine
4. Configure the PostgreSQL
# Make sure that the keys in 'ormconfig.json' are set up correctly
# to connect with your database; that the container is running;
# and that there is a 'gobarber' database created.
# Once the services are running, run the migrations
$ yarn typeorm migration:run
5. Create the .env
file
# For the correct functioning of the server, create the .env file at the root of the project.
# (use the .env.example as a base)
6. Start the server
# To finish, run the api service
$ yarn dev:server
# Well done, project is started!
Make a fork of this repository
# Fork using GitHub official command line
# If you don't have the GitHub CLI, use the web site to do that.
$ gh repo fork sonnymarinho/gobarber-api
Follow the steps below
# Clone your fork
$ git clone https://github.com/sonnymarinho/gobarber-api && cd gobarber-api
# Create a branch with your feature
$ git checkout -b my-feature
# Make the commit with your changes
$ git commit -m 'feat: My new feature'
# Send the code to your remote branch
$ git push origin my-feature
After your pull request is merged, you can delete your branch
This project is licensed under the MIT License - see the LICENSE file for details.
Made with 💜 by Sonny Marinho 👋 See my linkedin