Welcome to the Old Ink's api documentation. This api recreates a fictional database where clients can register, log and create appointments with the different services that the tattoo studio provides.
-
Clone the repository
$ git clone https://github.com/ariusvi/backend_services
-
Install dependencies
$ npm install --y
-
Start Express on the server
$ npm run dev
-
Run migrations
$ npm run run-migrations
-
The HTTP folder includes all routes that can be imported into Thunder Client
The routes worked for the project are:
AUTHENTICATION (AUTH)
- Register a user.
POST /api/auth/register
body:
{
"first_name": "name",
"last_name": "surname",
"email": "[email protected]",
"password": "123456"
}
- Login user:
POST /api/auth/login
body:
{
"email": "[email protected]",
"password": "123456"
}
USERS User routes include:
- Get all system users being Super_admin
Login as superadmin:POST /api/auth/login
body:
{
"email": "[email protected]",
"password": "123456"
}
auth:
token
get all users:
GET /api/users
auth:
token
- View user profile
GET /api/users/profile
auth:
token
- Edit username
PUT /api/users/profile
auth:
token
SERVICES Service routes include:
- See all services
GET /api/services
APPOINTMENTS Appointment routes include:
- Create a new appointment
POST /api/appointments
body:
{
"serviceId": "4",
"dateAppointment": "2024-03-04 13:30:00"
}
auth:
token
- See your appointments
GET /api/appointments
body:
{
"id":"4"
}
auth:
token
- See the appointment by id
GET /api/appointments/:id
body:
{
"id":"12"
}
auth:
token
- Update an appointment
PUT /api/appointments
body:
{
"serviceId": "1",
"userId": "4"
}
auth:
token
- Ana Rius - student FSD
Special thanks to Daniel Tarazona for his incredible work as a teacher and above all for his infinite patience in helping to resolve any doubts and calm the panic.
Thanks to my classmates:
Pedro for his patience and help, especially to confirm that I understand things.
Marina for her moral support, joint laughter and tears, as well as her help.