Strapi backend application


General information

This is a strapi backend application, that is related to the Integrated Circuit Shop. That application enables to creation of orders, products and other basic things related to shop topic.

A published application includes:

  • 5 Collection types: Order, Product, Regular Customer, Shipping, User
  • 2 created Orders
  • 5 created Products
  • 2 created Regular Customers
  • 4 created Shippings
  • 3 created Users
  • 3 created Roles for users

Getting started

Run that application in production mode with this command:

npm start

Run that application in development mode with this command:

npm run develop

At the login page, enter the credentials to interact with the application as a SuperAdmin user:

Email: admin@gmail.com
Password: Admin123!

Created content

Collection types

  1. Order
  2. Product
  3. Regular Customer
  4. Shipping
  5. User

Orders

  1. AMD Order
  2. Intel Order

Products

  1. Integrated circuit MAX8556ETE+T
  2. Integrated circuit ADA4091-2ARZ
  3. Integrated circuit LT6100IMS8#PBF
  4. Integrated circuit TLE8104EXUMA2
  5. Integrated circuit LT1633CS#PBF

Regular Customers

  1. Intel
  2. AMD

Shippings

  1. Personal Collection
  2. InPost Parcel Machine
  3. Orlen Parcel Machine
  4. InPost Courier

Users

  1. AMD
  2. John Smith
  3. Boss

Roles for users

  1. Customer -> role to enable customers to view products and create orders.
  2. Company worker -> role for the regular worker to enable basic actions of products category.
  3. Shop Manager -> role for Shop Manager to enable all actions related to content types.

How to Interact

Example with using Postman software.

  1. Login with an identifier and password.

AMD user

  • Enter the URL in the proper box, and choose POST method:
http://localhost:1337/api/auth/local
  • In the body section, enter that JSON structure:
{
    "identifier": "amd@amd.com",
    "password": "AMD123"
}
  • Click the Send button

All those actions will guarantee that you will log in. On the output, there will be an authorized token, which will be needed to perform actions with the application. Save that token for later actions.

  • Example message:

    {
      "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
      "user": {
          "id": 2,
          "username": "AMD",
          "email": "amd@amd.com",
          "provider": "local",
          "confirmed": true,
          "blocked": false,
          "createdAt": "2024-04-20T11:51:46.323Z",
          "updatedAt": "2024-04-20T19:37:40.602Z"
      }
    }
    

John Smith User

  • Enter the URL in the proper box, and choose POST method:
http://localhost:1337/api/auth/local
  • In the body section, enter that JSON structure:
{
    "identifier": "john.smith@shop.com",
    "password": "JOHN123"
}
  • Click the Send button

All those actions will guarantee that you will log in. On the output, there will be an authorized token, which will be needed to perform actions with the application. Save that token for later actions.

  • Example message:

    {
      "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
      "user": {
          "id": 3,
          "username": "John Smith",
          "email": "john.smith@shop.com",
          "provider": "local",
          "confirmed": true,
          "blocked": false,
          "createdAt": "2024-04-20T19:45:31.696Z",
          "updatedAt": "2024-04-21T13:47:02.772Z"
      }
    }
    

Boss User

  • Enter the URL in the proper box, and choose POST method:
http://localhost:1337/api/auth/local
  • In the body section, enter that JSON structure:
{
    "identifier": "boss@shop.com",
    "password": "BOSSS123"
}
  • Click the Send button

All those actions will guarantee that you will log in. On the output, there will be an authorized token, which will be needed to perform actions with the application. Save that token for later actions.

  • Example message:

    {
      "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
      "user": {
          "id": 4,
          "username": "Boss",
          "email": "boss@shop.com",
          "provider": "local",
          "confirmed": true,
          "blocked": false,
          "createdAt": "2024-04-20T19:51:42.236Z",
          "updatedAt": "2024-04-21T13:48:28.105Z"
      }
    }
    

Example actions for user

AMD user

The mentioned user has assigned the role Customer so that the user can perform actions like:

  • create order -> POST /api/orders
  • find product by ID -> GET /api/products/:id
  • find all products -> GET /api/products

With the saved authorization token from the logging stage do the following actions:

  • In the Authorization section, select Type Bearer Token and enter Token generated at the login action

  • Enter the URL in the proper box, choose GET method:

http://localhost:1337/api/products
  • Click the Send button.

  • It will print on the output that example structure:

{
    "data": [
        {
            "id": 1,
            "attributes": {
                "Name": "Integrated circuit TLE8104EXUMA2",
                "Manufacturer": "Infineon",
                "Internal_ID": "IC000450",
                "Available": true,
                "Manufacturer_code": "TLE8104EXUMA2",
                "Price": 25,
                "Mounting_type": "SMD",
                "Case": "SOIC-20",
                "Category": "Power switches - Power distribution",
                "createdAt": "2024-04-15T18:07:53.720Z",
                "updatedAt": "2024-04-20T20:21:37.959Z",
                "locale": "en",
                "Description": null,
                "Available_Quantity": 5
            }
        },
        {
            "id": 2,
            "attributes": {
                "Name": "Integrated circuit ADA4091-2ARZ",
                "Manufacturer": "Analog Devices",
                "Internal_ID": "IC000440",
                "Available": true,
                "Manufacturer_code": "ADA4091-2ARZ",
                "Price": 30,
                "Mounting_type": "SMD",
                "Case": "SOIC-8",
                "Category": "Measuring amplifier",
                "createdAt": "2024-04-20T10:12:48.424Z",
                "updatedAt": "2024-04-20T20:21:24.360Z",
                "locale": "en",
                "Description": null,
                "Available_Quantity": 2
            }
        },
        {
            "id": 3,
            "attributes": {
                "Name": "Integrated circuit LT6100IMS8#PBF",
                "Manufacturer": "Analog Devices",
                "Internal_ID": "IC000445",
                "Available": true,
                "Manufacturer_code": "LT6100IMS8#PBF",
                "Price": 20,
                "Mounting_type": "SMD",
                "Case": "MSOP-8",
                "Category": "Measuring amplifier",
                "createdAt": "2024-04-20T10:21:21.920Z",
                "updatedAt": "2024-04-20T20:21:30.576Z",
                "locale": "en",
                "Description": null,
                "Available_Quantity": 25
            }
        },
        {
            "id": 4,
            "attributes": {
                "Name": "Integrated circuit MAX8556ETE+T",
                "Manufacturer": "Maxim",
                "Internal_ID": "IC000003",
                "Available": true,
                "Manufacturer_code": "MAX8556ETE+T",
                "Price": 45,
                "Mounting_type": "SMD",
                "Case": "TQFN-16",
                "Category": "LDO voltage regulators",
                "createdAt": "2024-04-20T10:22:31.222Z",
                "updatedAt": "2024-04-20T20:21:19.677Z",
                "locale": "en",
                "Description": null,
                "Available_Quantity": 6
            }
        },
        {
            "id": 5,
            "attributes": {
                "Name": "Integrated circuit LT1633CS#PBF",
                "Manufacturer": "Analog Devices",
                "Internal_ID": "IC000465",
                "Available": true,
                "Manufacturer_code": "LT1633CS#PBF",
                "Price": 75,
                "Mounting_type": "SMD",
                "Case": "SOIC-14",
                "Category": "Operational amplifier",
                "createdAt": "2024-04-20T10:23:47.697Z",
                "updatedAt": "2024-04-20T20:21:43.322Z",
                "locale": "en",
                "Description": null,
                "Available_Quantity": 78
            }
        }
    ],
    "meta": {
        "pagination": {
            "page": 1,
            "pageSize": 25,
            "pageCount": 1,
            "total": 5
        }
    }
}

John Smith user

The mentioned user has been assigned the role of Company worker so that the user can perform actions like:

  • create product -> POST /api/products
  • delete product -> DELETE /api/products/:id
  • find product by ID -> GET /api/products/:id
  • find all products -> GET /api/products
  • update product information -> PUT /api/products/:id

Boss user

The mentioned user has been assigned the role of Shop Manager so that the user can perform actions like:

  • create order -> POST /api/orders
  • delete order -> DELETE /api/orders/:id
  • find order by ID -> GET /api/orders/:id
  • find all orders -> GET /api/orders
  • update order information -> PUT /api/orders/:id

  • create product -> POST /api/products
  • delete product -> DELETE /api/products/:id
  • find product by ID -> GET /api/products/:id
  • find all products -> GET /api/products
  • update product information -> PUT /api/products/:id

  • create regular-customer -> POST /api/regular-customers
  • delete regular-customer -> DELETE /api/regular-customers/:id
  • find regular-customer by ID -> GET /api/regular-customers/:id
  • find all regular-customers -> GET /api/regular-customers
  • update regular-customer information -> PUT /api/regular-customers/:id

  • create shipping -> POST /api/shippings
  • delete shipping -> DELETE /api/shippings/:id
  • find shipping by ID -> GET /api/shippings/:id
  • find all shippings -> GET /api/shippings
  • update shipping information -> PUT /api/shippings/:id

More information

For more details you can contact gdx167822@student.gdansk.merito.pl or touunix@gmail.com