Skip to content

Latest commit

 

History

History
410 lines (359 loc) · 18.9 KB

README.md

File metadata and controls

410 lines (359 loc) · 18.9 KB

Dirando

Aplicación web de compra de productos de ciclismo

Video Review

Review: Dirando SPA+Tradicional Docker .

Descripción de la temática de la web

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.

Entidades

  1. Producto: Cada producto tendrá un nombre e identificador, además de una fotografía, descripción, precio y demás características.
  2. Pedido: El usuario tendrá pedidos acumulados, registrando los productos de dichos pedidos.
  3. Usuarios: Perfil de cada usuario y funciones diferenciadas entre Usuario no logueado, Usuario logueado y Administrador.
  4. Categoría Productos: Además, se podrán identificar los productos mediante una categoría asignada.
  5. Valoración y comentarios: Pequeña descripción más una valoración del producto.
  6. Publicidad: Gestión de productos populares o, si estás registrado, productos favoritos para mostrarlos en espacios especificos de publicidad.

Integrantes

Diagrama navegación fase 2:

logo

Diagrama navegación fase 3:

logo

Diagrama Entidades fase 3:

logo

Diagrama Clases y templates V1 fase 3:

logo

Diagrama Clases y templates (V2 ACTUALIZADO):

WebControllers + Services + Repositories [FRONTEND]

logo

Templates + WebControllers [FRONTEND]

logo

Diagrama API REST [FRONTEND]:

WebRestControllers + Services + Repositories [FRONTEND]

logo

AdminRestControllers + Services + Repositories [FRONTEND]

logo

Diagrama ANGULAR 2:

Components & Services

logo

logo

Ejecutar la aplicación

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)

Template bootstrap

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/

Dirando Wiki

Small description of the methods used

WebController Guide

WebRestControllerCategory

  • 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)

WebRestControllerLog

  • 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)

WebRestControllerOrder

  • 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

  • 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

  • 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)

WebRestControllerProduct

  • 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

WebRestControllerUser

  • 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)

AdminController Guide

AdminRestController

  • 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

  • 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