Skip to content

Allaye/pitzza

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pitzza

An API for pitzza delivery

Project installation 💾💾:

  1. Clone the repository 🆑: git clone https://github.com/Allaye/pitzza.git
  2. Navigate to the project directory 🧭: ce pitzza
  3. Install the project using "npm install" command:
  4. Run the project using "npm start" command 👟:

To run the test suite and generate the coverage report:

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 📊:

🛠 Technologies

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)

Usage endpoints flow

  1. 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",
        }
    }
  1. 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"]
        }
    }
  1. 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"
    }
  1. 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

📖 License

This project is under license from MIT. See the LICENSE file for more details.

About

An API for pitzza delivery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published