AplicaciĂłn web de compra de productos de ciclismo
Review: Dirando SPA+Tradicional Docker .
La aplicaciĂłn dispondrá de una parte pĂşblica y otra pivada. La pĂşblica estará destinada a los clientes externos, con posibilidad de interactuar con los productos, ver sus descripciones, precios o su disponibilidad. Si el cliente está registrado, las funcionalidades aumentan (p.ej historial de compra). No obstante, si no está registrado, podrá añadir productos a su carro/pedido (aunque para finalizar su compra deba estar registrado). Además, se podrá simular el proceso de pago. Por otro lado, la parte privada de la aplicaciĂłn poseerá el control sobre la lista de productos alojados, sus categorĂas, descripciones y demás. Dichas funcionalidades de gestiĂłn estarán disponibles para el/los administrador/es mediante usuarios especĂficos.
- Producto: Cada producto tendrá un nombre e identificador, además de una fotografĂa, descripciĂłn, precio y demás caracterĂsticas.
- Pedido: El usuario tendrá pedidos acumulados, registrando los productos de dichos pedidos.
- Usuarios: Perfil de cada usuario y funciones diferenciadas entre Usuario no logueado, Usuario logueado y Administrador.
- CategorĂa Productos: Además, se podrán identificar los productos mediante una categorĂa asignada.
- Valoración y comentarios: Pequeña descripción más una valoración del producto.
- Publicidad: Gestión de productos populares o, si estás registrado, productos favoritos para mostrarlos en espacios especificos de publicidad.
-
Ignacio de Lucas Noguero ➡️ i.delucasn@alumnos.urjc.es ➡️ https://github.com/Igna91
-
Roberto Pérez Llanos ➡️ r.perezll@alumnos.urjc.es ➡️ https://github.com/rperezll
-
Alejandro Pinto Fernández ➡️ a.pinto@alumnos.urjc.es ➡️ https://github.com/AlejandroPinto
-
Daniel Jimeno Sáez ➡️ d.jimeno@alumnos.urjc.es ➡️ https://github.com/danijimeno
WebControllers + Services + Repositories [FRONTEND]
Templates + WebControllers [FRONTEND]
WebRestControllers + Services + Repositories [FRONTEND]
AdminRestControllers + Services + Repositories [FRONTEND]
Components & Services
Para ejecutar la aplicaciĂłn, lanzar los tres contenedores docker del perfil de docker hub.
Ejecutar el comando docker-compose up
dentro del directorio que contiene el archivo docker-compose.yml
(dicho archivo se encuentra en la raĂz del repositorio)
Hemos usado una plantilla Bootstrap para la zona de administración. Sin embargo, hemos cambiado los cuerpos de las páginas y modificado el menú. https://startbootstrap.com/template-overviews/sb-admin-2/
Small description of the methods used
- Return the products of a category
- Method: GET
- URL: https://localhost:8443/rest/category
- Result:
{ "id": 1, "nombre": "Specialized Epic XCO 2017", "desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight", "precio": 3500, "valoracion": 0, "theBest": 5, "mustImprove": 3, "image": "img/ejemplo1.jpg", "stock": 30, "comments": [{ "id": 1, "user": "user", "content": "0_1Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit omnis animi et iure laudantium vitae, praesentium optio, sapiente distinctio illo?", "rating": "XX"}], "categoria": "xco", "referencia": 0,"bad": 1}|
- Status code: 200 (OK)
- Check if the user is logged in
- Method: GET
- URL: https://localhost:8443/rest/log
- Result:
User logged in
Logged in!
- Status code: 200 (OK)
User not logged in
Not Logged !
- Status code: 423 Locked (WebDAV)
-
Pay an order
- Method: PUT
- URL: https://localhost:8443/rest/pay
- Result:
Not empty car and logged in
Finished payment
- Status code: 200 (OK)
Not empty car but logged out
Logged required!
- Status code: 401 Not Anauthorized
Empty car
The cart is empty!
- Status code: 206 Parcial Content
-
Return carriage size
- Method: GET
- URL: https://localhost:8443/rest/cartSize
- Result:
1
- Status code: 200 (OK)
-
Return carriage
- Method: GET
- URL: https://localhost:8443/rest/cartSize
- Result:
Not empty car
{"id": 2,"nombre": "Specialized Epic XCO 2017","desProducto": null,"precio": 2000,"valoracion": 0,"theBest": 0, "mustImprove": 0,"image": null,"stock": 0,"comments": null,"categoria": null,"bad": 0,"referencia": 0}
- Status code: 200 (OK)
Empty car
- Status code: 204 No Content
-
Delete cart
- Method: DELETE
- URL: https://localhost:8443/rest/cart
- Result:
The Cart is empty!
- Status code: 200 (OK)
-
Add to cart
- Method: PUT
- URL: https://localhost:8443/rest/cart
- Body:
{"id": 2,"nombre":"Specialized Epic XCO 2017","precio":2000}
- Result:
Product added to cart
- Status code: 200 (OK)
-
Show index
- Method: GET
- URL: https://localhost:8443/rest/indexItems
- Result:
{"content": [{"id": 1,"nombre": "Specialized Epic XCO 2017","desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New metry, crazy low frame weight","precio": 3500,"valoracion": 0,"theBest": 5,"mustImprove": 3,"image": "img/ejemplo1.jpg", "stock": 30, "comments": [ {"id": 1,"user": "user","content": "0_1Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit omnis animi et iure laudantium vitae, praesentium optio, sapiente distinctio illo?","rating": "XX" }]}
- Status code: 200 (OK)
-
Show carrusel
- Method: GET
- URL: https://localhost:8443/rest/carrusel
- Result:
[{"id": 1,"nomPublicidad": "Chania","imagen": "img/carousel1.jpg"},{"id": 2,"nomPublicidad": "Chania","imagen": "img/carousel2.jpg"},{"id": 3,"nomPublicidad": "Flower","imagen": "img/carousel3.jpg"}]
- Status code: 200 (OK)
-
Item by search
- Method: GET
- URL: https://localhost:8443/rest/items/{Id}
- Result:
{"content": [{"id": 2,"nombre": "Specialized XL 2017 2028","desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight","precio": 4600,"valoracion": 0,"theBest": 5, "mustImprove": 3,"image": img/ejemplo2.jpg","stock": 50,"comments": [],"categoria": "xco","bad": 1,"referencia": 0}]}
- Status code: 200 (OK)
-
Show product details
- Method: GET
- URL: https://localhost:8443/rest/productDetail/{Id}
- Result:
{"id": 1,"nombre": "Specialized Epic XCO 2017","desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low rame weight","precio": 3500,"valoracion": 0,"theBest": 5,"mustImprove": 3,"image": "img/ejemplo1.jpg","stock": 30, "comments": [{"id": 1,"user": "user", "content": "0_1Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit omnis animi et iure laudantium vitae, praesentium optio, sapiente distinctio illo?","rating": "XX"}],"categoria": "xco", "bad": 1,"referencia": 0}
- Status code: 200 (OK)
-
Show product rating
- Method: GET
- URL: https://localhost:8443/rest/productRating/{Id}
- Result:
[55.555557,33.333336,11.111112]
- Status code: 200 (OK)
-
Modify account
- Method: PUT
- URL: https://localhost:8443/rest/account
- Body:
{"fullName":"nuevo nombre comleto","email":"nuevo correo","phone":"98789797","password":"1234","address": "Nueva Calle los rosales 10"}
- Result:
|
- Status code: 200 (OK)
-
Show logged in user
- Method: GET
- URL: https://localhost:8443/rest/user
- Result:
{"id": 3,"name": "admin","email": "adminser@dirando.com","password": $2a$10$9pJOe8TTv98WFKwn0Ps4VurM3v20Wz.QN3aAMVKsrFsnmDoqEyz0y","role": ["ROLE_USER","ROLE_ADMIN"],"address": "Thomas Nolan Kaszas II,5322 Otter Lane,Middleberge FL 32068","phone": 695698365,"comments": [],"pedidos": [],"fullName": "Con honor"}
- Status code: 200 (OK)
-
Add new user
- Method: POST
- URL: https://localhost:8443/rest/user
- Body:
{"name": "name","fullName":"NombreCompleto","email":"correo","phone":"98789797","password":"1234","address": "Calle los rosales 10"}
- Result:
|
- Status code: 200 (OK)
-
Return a product
- Method: GET
- URL: https://localhost:8443/rest/admin/products/{id}
- Result:
{ "id": 1, "nombre": "Specialized Epic XCO 2017", "desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight", "precio": 3500, "valoracion": 0, "theBest": 5, "mustImprove": 3, "image": "img/ejemplo1.jpg", "stock": 30, "comments": [{ "id": 1, "user": "user", "content": "0_1Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit omnis animi et iure laudantium vitae, praesentium optio, sapiente distinctio illo?", "rating": "XX"}], "categoria": "xco", "referencia": 0,"bad": 1}
- Status code: 200 (OK)
-
New product
- Method: POST
- URL: https://localhost:8443/rest/admin/products
- Body:
{"nombre": "Nuevo nombre","desProducto": "If you ask us, it had beent","precio": 50,"theBest": 1, "mustImprove": 1, "bad": 1, "image": "img/ejemplo2.jpg","stock": 50,"categoria": "nueva"}
- Result:
{"id": 57,"nombre": "Nuevo nombre","desProducto": "If you ask us, it had beent","precio": 50,"valoracion": 0, "theBest": 1,"mustImprove": 1,"image": "img/ejemplo2.jpg","stock": 50,"comments": null,"categoria": "nueva", "referencia": 0}
- Status code: 201 Created
-
Upgrade a product
- Method: PUT
- URL: https://localhost:8443/rest/admin/products/{id}
- Body:
{"nombre": "Nuevo nombre","desProducto": "If you ask us, it had beent","precio": 50,"theBest": 1, "mustImprove": 1, "bad": 1, "image": "img/ejemplo2.jpg","stock": 50,"categoria": "nueva"}
- Result:
{"id": 2,"nombre": "Nuevo nombre","desProducto": "If you ask us, it had beent","precio": 50,"valoracion": 0,"theBest": 1,"mustImprove": 1,"image": "img/ejemplo2.jpg","stock": 50,"comments": null,"categoria": "nueva","bad": 0, "referencia": 0}
- Status code: 200 (OK)
-
Delete a product
- Method: DELETE
- URL: https://localhost:8443/rest/admin/products/{id}
- Result:
{"id": 2,"nombre": "Nuevo nombre","desProducto": "If you ask us, it had beent","precio": 50,"valoracion": 0,"theBest": 1,"mustImprove": 1,"image": "img/ejemplo2.jpg","stock": 50,"comments": null,"categoria": "nueva","bad": 0, "referencia": 0}
- Status code: 200 (OK)
-
Return all products
- Method: GET
- URL: https://localhost:8443/rest/admin/products
- Result:
{ "id": 1, "nombre": "Specialized Epic XCO 2017", "desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight", "precio": 3500, "valoracion": 0, "theBest": 5, "mustImprove": 3, "image": "img/ejemplo1.jpg", "stock": 30, "comments": [{ "id": 1, "user": "user", "content": "0_1Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit omnis animi et iure laudantium vitae, praesentium optio, sapiente distinctio illo?", "rating": "XX"}], "categoria": "xco", "referencia": 0,"bad": 1}
- Status code: 200 (OK)
-
Returns all products of all categories
- Method: GET
- URL: https://localhost:8443/rest/admin/categories
- Result:
{ "id": 1, "nombre": "Specialized Epic XCO 2017", "desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight", "precio": 3500, "valoracion": 0, "theBest": 5, "mustImprove": 3, "image": "img/ejemplo1.jpg", "stock": 30, "comments": [{ "id": 1, "user": "user", "content": "0_1Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit omnis animi et iure laudantium vitae, praesentium optio, sapiente distinctio illo?", "rating": "XX"}], "categoria": "xco", "referencia": 0,"bad": 1}...
- Status code: 200 (OK)
-
Add new categorie
- Method: POST
- URL: https://localhost:8443/rest/admin/categories
- Body:
{"nombre": "nueva"}
- Result:
{"id": 6,"publicidad": null,"productos": null,"nombre": "nueva"}
- Status code: 201 Created
-
Returns all products in a category
- Method: GET
- URL: https://localhost:8443/rest/admin/categories/{id}
- Result:
{"id": 4,"publicidad": [],"productos": [{"id": 25,"nombre": "Specialized TopFuel 2014","desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight","precio": 3500,"valoracion": 0,"theBest": 5,"mustImprove": 3, "image": "img/ejemplo1.jpg","stock": 30,"comments": [],"categoria": "cyclocross","bad": 1,"referencia": 0},
- Status code: 200 (OK)
-
Upgrade a category
- Method: PUT
- URL: https://localhost:8443/rest/admin/categories/{id}
- Body:
{"nombre": "nueva"}
- Result:
{"id": 4,"publicidad": [],"productos": [{"id": 25,"nombre": "Specialized TopFuel 2014","desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight","precio": 3500,"valoracion": 0,"theBest": 5,"mustImprove": 3, "image": "img/ejemplo1.jpg","stock": 30,"comments": [],"categoria": "nueva","bad": 1, "referencia": 0},...
- Status code: 201 Created
-
Delete a category
- Method: DELETE
- URL: https://localhost:8443/rest/admin/categories/{id}
- Result:
{"id": 4,null: [],"productos": [{"id": 25,"nombre": "Specialized TopFuel 2014","desProducto": "If you ask us, it had been too long since hardtails got their world shaken up. Well, our all-new Epic Hardtail Pro Carbon World Cup does just that. New geometry, crazy low frame weight","precio": 3500,"valoracion": 0,"theBest": 5,"mustImprove": 3, "image": "img/ejemplo1.jpg","stock": 30,"comments": [],"categoria": null ,"bad": 1, "referencia": 0},...
- Status code: 200 (OK)
-
Returns all users
- Method: GET
- URL: https://localhost:8443/rest/admin/users
- Result:
[{"id": 1,"name": "user","email": "userDomPru@gmail.com","password": $2a$10$wm/QYuSvX9abk.1QnFS5huGB910vJ3nTKQ0JpcYotbgj2feRKqX9u","role": ["ROLE_USER"],"address": "Thomas Nolan Kaszas I,5322 Otter Lane,Middleberge FL 32068","phone": 695698365,"comments": [],"pedidos": [],"fullName": "Dominguez Pruiz"},
- Status code: 200 (OK)
-
Returns an users
- Method: GET
- URL: https://localhost:8443/rest/admin/users/{id}
- Result:
{"id": 2,"name": "user2","email": "userDomPru@gmail.com", "password": "$2a$10$sKuh1QHsOr2sTcu7XYw68uaITfybeHe3b42QNkmQ32av58ulQg3va", "role": ["ROLE_USER"], "address": "Thomas Nolan Kaszas II,5322 Otter Lane,Middleberge FL 32068","phone": 695698365,"comments": [],"pedidos": [],"fullName": "Dominguez Pruiz"}
- Status code: 200 (OK)
-
Add an users
- Method: POST
- URL: https://localhost:8443/rest/admin/users
- Body:
{"name": "nuevouserpost","fullName": "Garcia Garcia","email": "nuevo@gmail.com","imgRuta": "","password": "pass", "phone": "668588558","address": "direccion calle"}
- Result:
{"id": 4,"name": "nuevouserpost","email": "nuevo@gmail.com","password": "pass","role": ["ROLE_USER","ROLE_ADMIN" ],"address": "direccion calle","phone": 668588558,"comments": [],"pedidos": [],"fullName": "Garcia Garcia"}
- Status code: 201 Created
-
Return ads
- Method: GET
- URL: https://localhost:8443/rest/admin/publicity
- Result:
[{"id": 1,"nomPublicidad": "Chania","imagen": "img/carousel1.jpg"},{"id": 2,"nomPublicidad": "Chania","imagen": "img/carousel2.jpg"},{"id": 3,"nomPublicidad": "Flower","imagen": "img/carousel3.jpg"}]
- Status code: 200 (OK)
-
Returns ande delete an ad
- Method: DELETE
- URL: https://localhost:8443/rest/admin/publicity/{id}
- Result:
{"id": 2,"nomPublicidad": "Chania","imagen": "img/carousel2.jpg"}
- Status code: 200 (OK)