API Design Document: Zomato-like App
1. Introduction
This document describes the design of the APIs for the Zomato-like app.
2. Authentication
- Authentication Method: OAuth 2.0 with JWT tokens.
3. Endpoints
3.1. Users
POST /api/v1/users/register- Register a new user.POST /api/v1/users/login- Log in a user.GET /api/v1/users/me- Get the current user's profile.
3.2. Restaurants
GET /api/v1/restaurants- Get a list of restaurants.GET /api/v1/restaurants/{id}- Get a restaurant by ID.
3.3. Orders
POST /api/v1/orders- Create a new order.GET /api/v1/orders/{id}- Get an order by ID.PUT /api/v1/orders/{id}/status- Update the status of an order.
4. Error Handling
| Status Code | Meaning |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |