An updated version of GoBarber with changes ranging from layout to the technologies used. The application continues with the same concept as the previous version, allowing to manage administrator users, clients, schedules, and other features in a barber shop environment.
In this version, architecture standards and good programming practices such as DDD, SOLID, Service Pattern, and Repository Pattern were applied. TDD was used throughout the development with the tool Jest.
- ⚙ Technologies Used
- 🚀 Features
- 💻 Instructions for Back End
- 💻 Instructions for Front End
- 🐞 Running tests
-
Back end
-
Front end
-
Mobile
-
Other technologies
-
Password recovery
-
Functional Requirements
- The user should be able to recover their password by providing their email;
- The user should receive an email with password recovery instructions;
- The user should be able to reset their password
-
Non-Functional Requirements
- Use Ethereal to test sending emails in a development environment;
- Use Amazon SES for sending in production;
- The sending of emails should happen in the background (background job);
-
Business Rules
- The link sent by email to reset the password should expire in 2 hours;
- The user needs to confirm the new password when resetting their password;
-
-
Profile Update
- Functional Requirements
- The user should be able to update their name, email, and password
- Business Rules
- The user cannot change their email to one that is already in use by another user;
- To update their password, the user must enter the old password;
- Functional Requirements
-
Provider Panel
- Functional Requirements
- The user should be able to list their appointments for a specific day;
- The provider should receive a notification whenever there is a new appointment;
- The provider should be able to view unread notifications;
- Non-Functional Requirements
- The provider's appointments for the day should be stored in the cache;
- The provider's notifications should be stored in MongoDB;
- The provider's notifications should be sent in real-time using Socket.io;
- Business Rules
- The notification should have a read or unread status so that the provider can manage it;
- Functional Requirements
-
Service Scheduling
- Functional Requirements
- The user should be able to list all registered service providers;
- The user should be able to list the days, with at least one available time slot, of a provider in a specific month;
- The user should be able to list available time slots on a specific day of a provider;
- The user should be able to make a new appointment with a provider;
- Non-Functional Requirements
- The listing of providers should be stored in the cache;
- Business Rules
- Each appointment must last exactly 1 hour;
- Appointments should be available between 8 am to 6 pm (first at 8 am and last at 5 pm);
- The user cannot schedule at a time slot already occupied;
- The user cannot schedule at a time that has already passed;
- The user cannot schedule services with themselves;
- Functional Requirements
Initially we need to clone the repository to have access to all folders
# Cloning repository
git clone https://github.com/higorhms/GoBarber.git
We will start by creating instances of our databases. For this project, docker was used. Below are the commands to create the containers and start the instances:
docker run --name database -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
docker run --name mongodb -p 27017:27017 -d -t mongo
docker run --name redis -p 6379:6379 -d -t redis:alpine
docker start database mongodb redis
First, you will need to create a file containing the access information to your database. This application was developed using Postgres and MongoDB. Create a file called ormconfig.json in the backend
folder and fill it out according to the model file ormconfig.example.json. Remember, before running migrations, to create the database and report the name of your base in the ormconfig.json file.
cd backend
yarn
yarn typeorm migration:run
yarn dev:server
It will also be necessary to create a .env file, which will contain the environment variables. Use .env.example as a template.
After executing the previous step and ensuring that the backend is running, you can start the front end:
cd frontend
yarn
yarn start
cd backend
yarn test