- Clone the repository 🆑: git clone https://github.com/Allaye/pitzza.git
- Navigate to the project directory 🧭: ce pitzza
- Install the project using "npm install" command:
- Run the project using "npm start" command 👟:
make sure you have installed the project using "npm install" command and navigate to the project directory 🧭: the testing code is located in the "test" folder 📂 5. Run the test suite using "npm test" command 🧪: the coverage report will be generated 📊:
This project was built using the following technologies: nodejs, typescript, mongodb, express, mongoose orm and the jest testing framework.
To be able to run the project on your local machine, you will need to install the following dependencies: mongocompass (for mongodb)
- create some menu items using the below command:
### method: POST
### request body:
{
"foodname": "burger",
"price": 100,
"description": "burger with cheese",
"category": "food",
}
### response:
{
"status": "success",
{
"foodname": "burger",
"price": 100,
"description": "burger with cheese",
}
}
- register as a user using the below command: this endpoint is used to register a user, it expects a json object with the following properties:
### method: POST
### request body:
{
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"password": "12345678",
"address" : "123, street, city, country",
}
### response:
the endpoint return a response object with the registration details and a token
{
"status": "success",
{
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"password": "12345678",
"address" : "123, street, city, country",
"tokens: [token: "asdfgfbdfrdvczdfgfhffre324546gfg"]
}
}
- login as a user using the below command: this endpoint is used to login a user, it expects an email and a password used in registration NB this is a protected endpoint
### method: POST
### request body:
{
"email": "[email protected]",
"password": "12345678",
}
### response:
the endpoint return a response object attached with a token
{
userobject
token:"erszretgdgyjcfhfghh"
}
- create a new order using the below command need to pass token to this endpoint: this endpoint is used to create a new order, it expects a json object with the following properties: NB this is a protected endpoint
### method: POST
### request body:
{
"foodname": "rice",
"quantity": 1,
"comment": "i want the food quickly",
}
Bearer token: "erszretgdgyjcfhfghh"
### response:
{
"message": "Order added successfully"
}
NB without a local instance of mongodb the db connection is going to fail
This project is under license from MIT. See the LICENSE file for more details.