This server is intended for use by customers, who can make reservations for lunch, dinner or take out at the restaurant, create an account to order online, or modify their profile and view their order statistics for the year or the reservations made.
URL http://localhost:8080/api/
The available endpoints are:
| Function | Request | Route | Params | Body | Response |
|---|---|---|---|---|---|
| Clients | |||||
| getProfile() | GET | /client/profile | { header: Token } | [ User Information + Token ] | |
| updateProfile() | PUT | /client/profile | { Heder: Token } | New User Information | [ User Information + Token ] |
| Categories | |||||
| getCategories() | GET | /categorias | [ Categories ] | ||
| Allergens | |||||
| getAllergens() | GET | /productos/alergenos | [ Allergens ] | ||
| getAllergen() | GET | /productos/alergenos/:id-alergeno | [ Allergen ] | ||
| Productos | |||||
| getProducts() | GET | /productos | [ Products ] | ||
| getFilteredProducts() | GET | /productos/filtro | [ Categories, Order, Range, Pagination ] | [ Products ] | |
| searchProducts() | GET | /productos/search/:producto | [ Products ] | ||
| getProductDetails() | GET | /productos/:slug_producto | [ Producto ] | ||
| Auth | |||||
| register() | POST | /auth/register | { User Information } | [ User Information + Token ] | |
| login() | POST | /auth/login | { User Information } | [ User Information + Token ] | |
| Orders | |||||
| getOrders() | GET | /pedidos | { Header: Token } | [ User Orders ] | |
| addOrder() | POST | /pedidos | { Header: Token } | { Order Information } | [ { msg: "Pedido Creado" } ] |
| Reserves | |||||
| getReserves() | GET | /reservas | { Header: Token } | [ User Reserves ] | |
| createReserve() | POST | /reservas | { Header: Token } | { Reserve Information } | [ { msg: "Reserva Realizada" } ] |
| getReserve() | GET | /reservas/:id_reserva | { Header: Token } | [ Reserve ] | |
| getImage() | GET | /reservas/image | [ Image ] | ||
| getPDFReserve() | GET | /reservas/pdf/_id_reserva | { Header: Token } | [ Reserve ] | |
| getBannedDays() | GET | /getBannedDays | { n_comensales: Number, servicio: String } | [ Banned Days to Reserve ] | |
- JWT Auth
- Guards On Routes
- Server Dockerized
- Working as a submodule of MyFood
This application is created to be used in another project (MyFood) but if you want to launch it you should keep in mind that you have to create an application.properties and within this add the configuration towards the database and a secret for the JWT.
Your application.properties should be like this:
# application.properties
server.servlet.context-path=/api
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://${db_server}:${db_port}/${db}
spring.datasource.username=${db_user}
spring.datasource.password=${db_password}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
springboot_myfood.auth.token.sign-key=${JWT Secret}
springboot_myfood.auth.token.valid-time=3000000To be launched simply run the mvn spring-boot:run in your terminal inside the folder created after cloning the repository.