Get in touch with beauty professionals and schedule services!
REST API to manage the schedule of beauty professionals so customer can schedule appointments with them. This is not a flesh out product to be used in production, it is just a demo application created during Rocketseat's GoStack bootamp.
To get a local copy up and running follow these steps.
- Node js
- yarn
- Postgres database (you can use docker for that)
- Reddis server (you can use docker for that)
- Mongo Database (you can use docker for that)
- Mailing service (for tests check mailtrap.io)
- Sentry credentials. We use sentry to track erros and bugs. But this is not mandatory.
- Clone the repo
git clone git@github.com:Artenes/rocketseat-bootcamp-gobarber-backend.git
- Access the directory
cd rocketseat-bootcamp-gobarber-backend
- Install dependencies
yarn
- Create a copy of the .env.example file
cp .env.example .env
-
Configure the .env file (just follow the comments on it)
-
Run the migrations to create the tables. Make sure the database you set in .env exists
yarn sequelize db:migrate
- Run the queue server, this will handle mails delivery
yarn queue
- Run the server
yarn dev
There are protected and unprotected routes. To access a protected route, you need a JWT
token in the header of the requeast as such:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NSwiaWF0IjoxNTY3OTUwMTM2LCJleHAiOjE1Njg1NTQ5MzZ9.JPHK7jwgSgvdVABon2HxtJT6ddofu6EWW53az6qF-0M
For that you have to create a user in the POST /users
endpoint, then create a session in POST /sessions
endpoint. See endpoints descriptions below for more details.
A user that can schedule for services or provide services.
Creates a new user.
Body
{
"name": "Jhon",
"email": "jhon@doe.com",
"password": "123456"
}
Edits the current logged in user.
Body
{
"name": "New Jhon",
"email": "newjhon@doe.com",
"oldPassword": "123456",
"password": "1234567",
"confirmPassword": "1234567"
}
A session to access protected routes in the API.
Creates a new JWT
token for a user.
Body
{
"email": "jhon@doe.com",
"password": "123456"
}
An image used by another resource. Files must be uploaded separately from the requests that need them.
Uploads a new file.
Body - Multipart Form
file: file/path
A user that provide services.
Lists all providers in the application.
Lists all hours available for a provider in the given date (unix timestamp).
Appointments created by customers.
Gets all appointments of the logged user.
Creates a new appointment.
Body
{
"provider_id": 12,
"date": "2019-10-24T09:00:00-04:00",
}
Manage a provider's notifications list.
Gets all notifications for the logged user.
Mark as notification as read.
Contributions are welcome, even though this was made only for learning purposes.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Artenes Nogueira - artenes.nogueira@gmail.com
My blog: http://artenesbok.com/
My Linkedin: https://www.linkedin.com/in/artenes/
README template from: https://github.com/othneildrew/Best-README-Template