This project is one application created in Bootcamp GoStack,for the purpose of recreating a barber shop application.
This project was developed using:
- NodeJS
- TypeScript
- Express
- Yarn
- Patterns
- Middlewares
- TypeORM
- Eslint
- Prettier
- Docker
- Migrations
# Clone the repository
$ git clone https://github.com/TomasSantosz/gobarber_backend_api.git
# Enter directory
$ cd gobarber_backend_api
# Install dependencies
$ yarn
docker run --name gostack-postgres -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
# Run migrations for your database
yarn typeorm migration:run
# Run server
yarn dev:server
- URL: localhost:3333/users
- Method http: PACTH
- Structured: Multipart Form Name: avatar Value: image
- URL: localhost:3333/users
- Method http: POST
- Text: JSON
- Params JSON: { "name": "tomas", "email" : "email@email.com", "password": "tomas" }
- URL: localhost:3333/sessions
- Method http: POST
- Params JSON: { "email" : "email@email.com", "password": "tomas" }
OBS:. THIS REQUIREMENT REQUIRES TOKEN GENERATED IN LOGIN, USING BEARER TOKEN IN HEADER
- URL: localhost:3333/appointments
- Method http: GET
OBS:. THIS REQUIREMENT REQUIRES TOKEN GENERATED IN LOGIN, USING BEARER TOKEN IN HEADER
- URL: localhost:3333/appointments
- Method http: POST
- Params JSON: { "provider_id": "d169bdc7-7e17-48e5-b9b8-ae1bb2700a2e", "date": "{% now 'iso-8601', '' %}" }
"provider_id" -> GENERATED IN CREATE USER. RETURN "ID".
RF
- The user must be able to recover his password informing his e-mail;
- The user should receive an email with password recovery instructions;
- The user must be able to reset his password;
RNF
- Use Mailtrap to test shipments in a dev environment;
- Use Amazon SES for production shipments;
- E-mails should be sent in the background (background job);
RN
- The link sent by email to reset password, must expire in 2h;
- The user needs to confirm the new password when resetting his password;
RF
- The user must be able to update his name, email and password;
RN
- The user cannot change his email to an email already updated;
- To update your password, the user must inform the old password;
- To update your password, the user needs to confirm the new password;
RF
- The user must be able to view their schedules for a specific day;
- The provider must receive a standard whenever there is a new schedule;
- The provider must be able to view unread notifications;
RNF
- The provider's schedules on the day must be stored in cache;
- The provider's notifications must be stored in MongoDB;
- The provider's notifications must be sent in real time using Socket.io;
RN
- The notification must have a read or unread status so that the provider can control;
RF
- The user must be able to list all registered service providers;
- The user must be able to list the days of a month with at least one available time from a provider;
- The user must be able to list available times on a specific day for a provider;
- The user must be able to make a new appointment with a provider;
RNF
- The list of providers must be cached;
RN
- Each appointment must last exactly 1 hour;
- Appointments must be available between 8 am and 6 pm (First at 8 am, last at 5 pm);
- The user cannot schedule at a busy time;
- The user cannot schedule an appointment that has already passed;
- The user cannot schedule services with himself;