-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
46 lines (35 loc) · 1.48 KB
/
Copy pathREADME
File metadata and controls
46 lines (35 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Kobra Kai FastAPI Prototype
This is a lightweight prototype built with **Python / FastAPI** to demonstrate the core functionality of the Kobra Kai charity website.
The prototype implements user registration and login with JWT authentication, role-based access (beneficiary vs member), meal listings, order placement, and token transactions.
A minimal HTML/JS frontend client is included for testing the API.
---
## 🚀 Features
- Register and login as **beneficiary** (receives 10 tokens) or **member**.
- JWT-based authentication and role-based access control.
- Members can **create meals** with title, description, dietary tags, portions, delivery days, and token cost.
- Beneficiaries can **order meals**, with tokens deducted automatically.
- Members can **deliver or cancel orders**; cancelled orders refund tokens.
- Simple HTML/JS frontend for manual testing in addition to Swagger UI.
---
## 🛠️ Installation & Setup
### 1. Clone the repo
```bash
git clone https://github.com/<your-username>/<your-repo>.git
cd <your-repo>
python -m venv .venv
# Activate (choose your shell):
# Git Bash
source .venv/Scripts/activate
# PowerShell
.\.venv\Scripts\Activate.ps1
# Command Prompt
.\.venv\Scripts\activate.bat
pip install --upgrade pip
pip install -r requirements.txt
python -m uvicorn app.main:app --reload
The API will be available at:
👉 http://127.0.0.1:8000
Swagger UI: http://127.0.0.1:8000/docs
cd client
python -m http.server 5500
Go to 👉 http://127.0.0.1:5500 in your browser.