FoodApp API Documentation

Overview

The FoodApp API provides endpoints for managing food items and orders. This documentation outlines the available endpoints, their functionalities, and sample requests.

Getting Started

To start the server, use the command npm start. The base URL for the API is http://localhost:3000. Note that a MongoDB online cluster is used for data storage.

Authentication

Authentication is required for certain endpoints. Ensure that you are authenticated by accessing http://localhost:3000 before using the API.

API Endpoints

1. Add Food

{
    "id": "99",
    "name": "Biryani",
    "description": "Delicious Biryani.",
    "price": 100,
    "image": "Biryani.jpg",
    "category": "non-veg"
}

2. Get All Food

3. Add Order

{
    "foodId": "1",
    "userId": "user123",
    "orderId": "order123",
    "status": "pending",
    "userAddressId": "address123",
    "paymentMode": "card"
}

4. Update Order

{
    "status": "completed"
}

5. Search Food

6. Filter Food by Category

7. Auto-Recommendation

8. Mock Payment

Sample Data for /add-order Endpoint:

{
  "foodId": "sample_food_id",
  "userId": "sample_user_id",
  "userAddressId": "sample_address_id",
  "paymentMode": "credit_card"
}

Sample Data for /mock-payment Endpoint:

{
    "status": "completed"
}