This is a simple rest api for pizza portal. As a guest you can only see the basic products, but after creating an account and logging in, you also get access to special products and the possibility of placing them in the basket. As an administrator, you can do what the user can do with the extension of the ability to add new products, delete, edit and view all baskets. In the directory test_database is database for testing with some records. As admin you can login as email: [email protected] pass: admin123.
Live demo: IN PROGRESS
Github backend: https://github.com/iwanczakrafal/PizzaBack
Github frontend: https://github.com/iwanczakrafal/PizzaFront
PizzaBack/
├── src/
│ ├── auth/
│ │ └── dto
│ ├── basket/
│ │ ├── dto
│ │ └── entities
│ ├── decorators/
│ │ └── user-obj.decorator.ts
│ ├── option/
│ │ ├── dto
│ │ └── entities
│ ├── products/
│ │ ├── dto
│ │ └── entities
│ ├── types/
│ │ ├── basket
│ │ ├── files
│ │ ├── option
│ │ ├── product
│ │ └── user
│ ├── user/
│ │ ├── dto
│ │ └── entities
│ └── utils/
│ ├── hash-password.ts
│ └── storage.ts
├── storage/
│ └── products-photos/
│ ├── 0b7a9328-4cec-479b-bb38-a9b0fbe70a5a.png
│ ├── 2cbc5ab8-bbd5-4963-ba64-ea36dbef4307.png
│ ├── 4a9871a2-70e7-409d-ba6c-7cc681a43835.png
│ ├── 6bd18e4e-b18a-4d56-bcbf-dbb46e51aa31.png
│ ├── 8734dbf0-c339-496a-8226-aba10cc66e6f.png
│ ├── 026057c6-cb5a-4b6e-8ad3-2f0c18d44b9a.png
│ ├── abcbbef8-0c92-4622-8dd0-bdd738db6934.png
│ └── cc011a30-c216-4955-853b-b3e733d5234a.png
├── test/
│ ├── app.e2e-spec.ts
│ └── jest-e2e.json
├── test_database/
│ └── _NEST_PIZZA_.sql
├── .gitignore
├── .prettierrc
├── nest-cli.json
├── package.json
├── package-lock.json
├── README.md
├── tsconfig.build.json
└── tsconfig.json
As Admin
GET: Get all users
As All
POST: Create a new account. Example body {"name": "Tom", "lastName": "ToMmm", "email": "[email protected]", "password": "tom123"}
As User
PUT: Update password. Example {"password": "123"}DELETE: Delete a account
As Admin
GET: Get a user
As Admin
POST: Create a new product. Multipart: name, price, description, photo : some file, isSecial: true/false
As All
GET: Get all product without special
As All
GET: Get a product
As Admin
DELETE: Delete a product
As User
GET: Get all products with special products
As User
GET: Get one product inculdes special porducts
GET: Get product photo
As Admin
POST: Create a new addon. Example {"name": "Cheese", "price": 2 }
As All
GET: Get all addons
As Admin
PUT: Change price of addon. Example {"price": 1 }DELETE: Delete addon
As User
GET: Get addon
As User
POST: Add product to basket. Example { "productId" : product id, "count": 1, "optionId": addon id}GET: Get all products in basket
As Admin
GET: Get all baskets
As Admin
GET: Get average price of products in baskets
As User
GET: Get total price of basket =======
As User
DELETE: Clear user basket
As User
DELETE: Remove one product from basket
Clone the project:
git clone https://github.com/iwanczakrafal/PizzaBack.git
Go to the project directory:
cd PizzaBack
Install dependencies:
npm install
Start the server:
npm start
npm start:dev (for developer)
- implement mailer system,
- online order fulfillment,
- payment execution,