This project provided the backend for two differentes mobile apps. The platform is intended to be used as an online marketplace where constructor professionals can offer their services to final clients. Service providers can register, fill their profiles and get job opportunities, while normal users can browse profiles, contact and hire proffesionals. It features a system where both sides can track their own historial activity inside the platform and rate themselves mutually for each concluded service.
This project was done using Spring Framework (Spring Boot, Spring Data JPA, Spring Security, Thymeleaf) The main Java app was hosted on Heroku, while the MySQL database was hosted in an Amazon RDS instance and photos were uploaded to Amazon S3.
It was done with Thymeleaf and bootstrap. Only users with an admin role have enough permissions.
Admins are able to monitor the activy in the application an also have access to statistics.
This is not a comprehensive list. There are just some remarkable endpoints.
Type: POST
/api/login
Request Body
Required: application/json
{
email *string
password *string
}
{
"email: "jtejada@gmail.com",
"password": "MyPassword01840"
}
Responses:
Code | Description |
---|---|
200 |
Returns application/json |
401 |
Returns application/json |
If login was successful returns success = true along user data (if role is client also returns client only data):
{
successful* boolean
email string
nombre string
clienteId int
distrito string
distritoId int
token string
JWTtoken string
}
{
"JWTtoken": "eyJhbGciOiJIUzUxMiJ9.eyJhdXR9mnJpdGllcyI6IltdIiwic3ViIjoianRlamFkYUBib2xzYWRlaWRlYXMuY29tIn0.BtPAFSLaRtqFlFEZwivJW8rbviK_jZ6hKObqfOqBu3hkWvyyL_7XvbvQsYEnmkhZCoNIYdHyrLfGwsXdmQTj6Q",
"distrito": "Villa el Salvador",
"distritoId": 42,
"clienteId": 3,
"success": true,
"nombre": "Justo",
"email": "jtejada@gmail.com",
"token": "ExponentPushToken[rgFB-WIo5OY372osTohuPe]"
}
If login was unsuccessful returns success = false:
{
success *boolean
}
{
"success": false
}
It updates the push notification token of a logged in user if the token of the device is different from the one stored in the database.
Type: POST
/api/token
Request Body
Required: application/json
Responses:
Code | Description |
---|---|
201 |
Returns true, indicating the token was successfully updated |
It lists all available constructor professionals for a determined service and district, and also sorts them by various criteria.
Type: GET
/api/listar/{servicioId}/{distritoId}
Parameters:
Name | Description |
---|---|
servicioId required path |
Id of the service |
distritoId required path |
Id of the district |
criterio query |
Order criteria, default is reputacion. It can also be numero_trabajos_culminados or fecha_de_registro |
orden required query |
Order of the list. 0 for ASC, and 1 for DESC |
inicio required query |
Select which one would be the first result. Used to limit the number of results |
total required query |
Select the total number of results |
Responses:
Code | Description |
---|---|
200 |
Returns a list a professionals |
It sends push notifications to mobile devices whenever a client or a professional sends a message to each other. It also updates a message in the database.
Type: POST
/api/enviar
Request Body
Required: application/json
Responses:
Code | Description |
---|---|
201 |
Returns true indicating the message was updated |