This repository contains the backend API for the Burger Queen Ordering System, built with Flask and Python.
It provides endpoints to manage users, products, and orders, and integrates with JWT-based authentication to ensure secure access.
The API was developed to be consumed by the Burger Queen frontend app.
- JWT-based authentication and authorization
- User management (admins can create, update, and delete users)
- Product management (CRUD operations for menu items)
- Order management (create, update status, delete, and list orders)
- Role-based access control (Admin, Waiter, Chef)
- CORS enabled to allow frontend integration
- Health check endpoint for deployment monitoring
- Framework: Flask
- Database: PostgreSQL (SQLAlchemy ORM)
- Authentication: Flask-JWT-Extended, Flask-Bcrypt
- CORS: Flask-CORS
- Deployment: Render (cloud hosting)
The API is deployed on Render: 👉 Live API
Role | Password | |
---|---|---|
Admin | admin@email.com | 123456 |
Chef | chef@email.com | 123456 |
Waiter | waiter@email.com | 123456 |
Before running the app, create a .env
file in the root directory with the following variables:
DATABASE_URL=your_postgresql_database_url
JWT_SECRET_KEY=your_secret_key
- DATABASE_URL: PostgreSQL connection string
- JWT_SECRET_KEY: Secret key for signing JWT tokens
Clone the repository and install dependencies:
git clone https://github.com/your-username/burger-queen-api.git
cd burger-queen-api
pip install -r requirements.txt
Run the app locally:
flask --app api.app:app run
By default, the API will be available at: http://127.0.0.1:5000
POST /login
→ Login with email & password, returns JWT token
GET /health
→ Returns { "status": "ok" }
GET /users
→ List all usersPOST /users
→ Create a new userPATCH /users/:id
→ Update userDELETE /users/:id
→ Delete user
GET /products
→ List all productsPOST /products
→ Create a new productPATCH /products/:id
→ Update productDELETE /products/:id
→ Delete product
GET /orders
→ List all ordersPOST /orders
→ Create a new orderPATCH /orders/:id
→ Update order statusDELETE /orders/:id
→ Delete an order
- Admin → Manage users and products
- Waiter → Take customer orders and send them to the kitchen
- Chef → View incoming orders and mark them as ready
Use Postman or Insomnia to interact with the API.
Make sure to include the JWT token in the Authorization header:
Authorization: Bearer <your_token>