Skip to content
Snippets Groups Projects
Select Git revision
  • 93df90f74293534342ac8f51af1e617b75e602ab
  • main default protected
2 results

idatg2204-project

  • Open with
  • Download source code
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • Electromart Database Implementation

    This documentation will provide details about a simple backend implementation which is fully integrated with a relational database created in MariaDB.

    Electromart

    ElectroMart is an electronics store that sells a large variety of different electronic products.Product categories include phones, tablets, laptops, cameras, home applications

    Deployment

    The service can be hosted locally on your computer after running the code included in the Backend directory. The service can be accessed at the URL: http://localhost:8080

    Services being provided

    Homepage

    http://localhost:8080/ Method = ["GET"]

    Category

    http://localhost:8080/category Method = ["GET"]

    http://localhost:8080/category/string:category_name Method = ["GET"]

    User

    http://localhost:8080/register Method = ["POST"]

    Example JSON data

    {
        "firstname": "Ola",
        "lastname": "Nordmann",
        "address": "Tollbugata 2",
        "email": "ola.nordmann@example.com",
        "password": "Hemmelig"
    }

    http://localhost:8080/login Method = ["POST"]

    Example JSON data

    {
        "email": "ola.nordmann@example.com",
        "password": "Hemmelig"
    }

    http://localhost:8080/logout Method = ["POST"]

    Product

    http://localhost:8080/product Method = ["GET"]

    http://localhost:8080/product/search/string:search Method = ["GET"]

    http://localhost:8080/product/int:product_id Method = ["GET"]

    Order

    http://localhost:8080/order/ Method = ["GET"]

    http://localhost:8080/order/ Method = ["POST"]

    {
        "products": [
            {"product_id": 1, "quantity": 2},
            {"product_id": 2, "quantity": 1},
            {"product_id": 3, "quantity": 3}
        ]
    }

    http://localhost:8080/order/payment Method = ["POST"]

    {
        "order_id": 1,
        "payment_method": "Vipps"
    }