Your Comprehensive Guide for the Project
<a name="seed-database"
To seed the database:
- Configure your
.env
file. - Navigate to the root of the application.
- Run the following command in the terminal:
make seed
To seed the database:
- Configure your
.env
file. - Navigate to the root of the application.
- Run the following command in the terminal:
make serve
-
After executing the command you will be prompt with 2 options:
- option 1: Docker
- option 2: local
-
Choose the Docker
-
You will see an error saying that connection failed but a db container will be created
-
Run the following command in another termianl in the same directory:
make seed
- Terminate the make serve terminal and restart the project using
make serve
To start the application locally
- configure the .env file
- go to root of the application
- run the following command in the terminal
make serve
-
After executing the command you will be prompt with 2 options:
- option 1: Docker
- option 2: local
-
Choose the Docker
-
You will see an error saying that connection failed but a db container will be created
-
Run the following command in another termianl in the same directory:
make seed
- if used docker: http://localhost:5000/docs/index.html
- if used local: http://localhost:8080/docs/index.html
http://localhost:5000/api/brands
{
"name": "ASUS",
"status_id": 1
}
http://localhost:5000/api/brands/:id
http://localhost:5000/api/brands/:id
{
"name": "Lenevo",
"status_id": 1
}
http://localhost:5000/api/brands/:id
http://localhost:5000/api/brands?page=1&limit=2
Param | value |
---|---|
page | 1 |
limit | 2 |
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
http://localhost:5000/api/products
{
"name": "Lenovo Think V2",
"description": "Powerful laptop for professional use.",
"brand_id": "5f2dc58e-d3a8-4580-b4fb-0e72d93f0afe",
"category_id": "8ace9e3f-3bca-4deb-8128-e0f67b0c0924",
"supplier_id": "5d96a2df-370b-4afd-a7c4-cfcc1e7241d2",
"unit_price": 50.05,
"discount_price": 12.54,
"tags": ["business", "professional"],
"status_id": 1,
"stock_quantity": 100
}
http://localhost:5000/api/products/:id
http://localhost:5000/api/products/:id
{
"productName": "Lenovo Think V2",
"productDescription": "A powerful laptop designed for professional use.",
"brandId": "5f2dc58e-d3a8-4580-b4fb-0e72d93f0afe",
"categoryId": "8ace9e3f-3bca-4deb-8128-e0f67b0c0924",
"supplierId": "5d96a2df-370b-4afd-a7c4-cfcc1e7241d2",
"unitPrice": 50.05,
"discountPrice": 12.54,
"tags": ["abc", "xyz"],
"statusId": 1,
"stockQuantity": 100
}
http://localhost:5000/api/products/:id
http://localhost:5000/api/products?page=1&limit=20
Param | value |
---|---|
page | 1 |
limit | 20 |
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
http://localhost:5000/api/suppliers
{
"name": "Iqbal Hossain",
"email": "zafar.iq3089@gmail.com",
"phone": "01403229479",
"status_id": 1,
"is_verified_supplier": true
}
http://localhost:5000/api/suppliers/:id
http://localhost:5000/api/suppliers/:id
{
"name": "THE KRAKEN",
"email": "kraken@gmail.com",
"phone": "01403229479",
"status_id": 1,
"is_verified_supplier": true
}
http://localhost:5000/api/suppliers/:id
http://localhost:5000/api/suppliers?page=1&limit=5
Param | value |
---|---|
page | 1 |
limit | 5 |
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
http://localhost:5000/api/categories
{
"name": "Android",
"parent_id": "pef438e9-2c04-4e12-961d-d35e2d75e5cf",
"status_id": 1
}
http://localhost:5000/api/categories/:id
http://localhost:5000/api/categories/:id
{
"name": "iphone",
"status_id": 1
}
http://localhost:5000/api/categories/:id
http://localhost:5000/api/categories?page=1&limit=5
http://localhost:5000/api/categories/tree
Param | value |
---|---|
page | 1 |
limit | 5 |
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
Thank you for your time and assistance! 🙌 If you have any more questions or need further help, feel free to reach out. Have a great day!