Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,63 +9,78 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# 🚦 SwiftCase.ai
|
| 13 |
|
| 14 |
-
SwiftCase.ai is a
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
---
|
| 22 |
|
| 23 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- Create new summons/case (structured fields reflect real PDRM ticket)
|
| 34 |
-
- See pending PDRM appeals and decide (tolak / dikurangkan)
|
| 35 |
-
- Decisions and payment receipts logged in **Bahasa Melayu**
|
| 36 |
|
| 37 |
-
|
| 38 |
-
- Review pending judicial appeals
|
| 39 |
-
- Record decisions (Approve No Fine / Approve Reduced / Reject)
|
| 40 |
-
- Record reviewer type (human_judge / ai_agent) and authority consent when AI is used
|
| 41 |
|
| 42 |
-
- **
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
---
|
| 48 |
|
| 49 |
-
##
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
- If **dikurangkan** → payable updated to reduced amount.
|
| 59 |
-
- PDRM issues a digital receipt upon successful payment.
|
| 60 |
-
- All PDRM logs are written in **Bahasa Melayu**.
|
| 61 |
-
4. **Magistrate** reviews judicial appeals and issues decisions; decisions update payable amounts and are logged.
|
| 62 |
-
5. **Citizen pays** after decision; payment & receipts saved.
|
| 63 |
|
| 64 |
---
|
| 65 |
|
| 66 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
### Requirements
|
| 69 |
-
- Python 3.10+
|
| 70 |
-
- Dependencies in `requirements.txt` (Gradio, pandas). Use `gradio==5.44.1` for compatibility.
|
| 71 |
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# 🚦 SwiftCase.ai – Traffic Summons & Appeals MVP
|
| 13 |
|
| 14 |
+
SwiftCase.ai is a **real-world prototype** for managing **traffic summons** in Malaysia.
|
| 15 |
+
It connects **citizens, PDRM traffic police, and magistrates** into one digital workflow,
|
| 16 |
+
reducing waiting times, giving fair chances to appeal, and enabling direct online payments.
|
| 17 |
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## ✨ Features
|
| 21 |
+
|
| 22 |
+
### 👨👩👧 Citizen Portal (Multilingual: English + Bahasa Melayu + 中文)
|
| 23 |
+
- **View Case**: Citizens can check details of their summons in **3 languages** at once.
|
| 24 |
+
- **Appeal to Magistrate**: Submit written appeals in English, BM, or Chinese.
|
| 25 |
+
- **Appeal to PDRM (compound fines)**: Citizens can request a reduced compound fine directly from PDRM.
|
| 26 |
+
- **Pay Online**: Pay fines securely, receive an **e-receipt**, no need to visit traffic police counters.
|
| 27 |
|
| 28 |
---
|
| 29 |
|
| 30 |
+
### 🚔 Traffic Police (PDRM) Portal (Bahasa Melayu only)
|
| 31 |
+
- **Review Appeals**: Police officers handle **compound fine appeals**.
|
| 32 |
+
- Decisions:
|
| 33 |
+
- **Tolak** (Reject) → Citizen pays full fine.
|
| 34 |
+
- **Lulus (Kurangkan Denda)** (Approve with Reduced Fine) → Citizen pays reduced fine.
|
| 35 |
+
- All **logs are written in Bahasa Melayu** for PDRM records.
|
| 36 |
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
### ⚖️ Magistrate Portal (Bilingual: English + BM)
|
| 40 |
+
- **Review Judicial Appeals**: Magistrates can approve or reject appeals.
|
| 41 |
+
- Decisions:
|
| 42 |
+
- Reject → Full fine must be paid.
|
| 43 |
+
- Approve with Reduced Fine → Citizen pays lower fine.
|
| 44 |
+
- Approve No Fine → Citizen pays nothing.
|
| 45 |
+
- Rationale is stored for audit, with logs sent to police and magistrate’s office.
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
|
| 49 |
+
## 📊 Database Schema
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
SQLite database: `cases.db`
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
- **summons_cases** – traffic summons details.
|
| 54 |
+
- **appeals** – citizen appeals.
|
| 55 |
+
- **judge_reviews** – magistrate decisions.
|
| 56 |
+
- **pdrm_reviews** – police decisions.
|
| 57 |
+
- **payments** – payment transactions.
|
| 58 |
+
- **receipts** – digital receipts.
|
| 59 |
+
- **audit_logs** – activity logs (BM for police, mixed for others).
|
| 60 |
|
| 61 |
---
|
| 62 |
|
| 63 |
+
## 🧪 Mock Data
|
| 64 |
+
|
| 65 |
+
Three seeded cases included on first run:
|
| 66 |
+
|
| 67 |
+
| Case ID | Name | Offence (EN) | Offence (BM) | Offence (中文) | Fine (RM) | Status |
|
| 68 |
+
|---------|--------|--------------------------|--------------------------------------|-----------------|-----------|-------------------------------|
|
| 69 |
+
| 1 | Ali | Not obeying correct lane | Tidak mematuhi lorong yang betul | 未按规定车道行驶 | 300.00 | ISSUED |
|
| 70 |
+
| 2 | Ah Kow | Running a red light | Melanggar lampu merah | 闯红灯 | 250.00 | APPEAL_PENDING |
|
| 71 |
+
| 3 | Muthu | Illegal parking | Letak kereta haram | 非法停车 | 100.00 | APPEAL_APPROVED_REDUCED |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
+
## 💻 Installation & Run
|
| 76 |
+
|
| 77 |
+
1. Clone the repo or deploy directly on [Hugging Face Spaces](https://huggingface.co/spaces).
|
| 78 |
+
2. Install dependencies:
|
| 79 |
+
```bash
|
| 80 |
+
pip install -r requirements.txt
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
|
|
|
|
|
|
|
|
|
|
| 86 |
|