Benny-Tang commited on
Commit
b844dcf
·
verified ·
1 Parent(s): b24fec9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +58 -43
README.md CHANGED
@@ -9,63 +9,78 @@ app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- # 🚦 SwiftCase.ai Real-world Traffic Offence MVP
13
 
14
- SwiftCase.ai is a Minimum Viable Product (MVP) to streamline traffic offence handling between **citizens**, **PDRM (traffic police)** and the **magistrate / online judge**. This MVP supports:
 
 
15
 
16
- - Digital **compound payments** to PDRM.
17
- - **PDRM compound appeals** (rayuan kompaun) reviewed online by police officers (BM logs).
18
- - **Judicial appeals** to Magistrate (human or AI with authority consent).
19
- - Full **audit trail** (immutable logs) and digital receipts for PDRM payments.
 
 
 
 
 
20
 
21
  ---
22
 
23
- ## Key Features (real-world oriented)
 
 
 
 
 
24
 
25
- - **Citizen Portal** (all labels/messages shown in 3 languages simultaneously):
26
- - View case details (EN / BM / ZH)
27
- - Pay compound (simulate PDRM payment)
28
- - Submit **PDRM compound appeal** (Rayuan Kompaun Bahasa Melayu)
29
- - Submit **Judicial appeal** to Magistrate (EN/BM/ZH fields)
30
- - View audit logs
 
 
 
 
 
31
 
32
- - **PDRM (Police) Portal** — **Bahasa Melayu only**:
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
- - **Magistrate Portal**:
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
- - **Data & Audit**:
43
- - SQLite schema includes `summons_cases`, `appeals`, `judge_reviews`, `pdrm_reviews`, `payments`, `receipts`, and `audit_logs`.
44
- - PDRM-related logs/messages are recorded in **Bahasa Melayu** per requirement.
45
- - Seeded demo data includes 3 fictitious cases (Ali, Ah Kow, Muthu) with tri-lingual descriptions.
 
 
 
46
 
47
  ---
48
 
49
- ## How it works (flow)
50
-
51
- 1. **PDRM issues summons** data stored in `summons_cases`.
52
- 2. **Citizen**:
53
- - Can **Pay Compound** immediately (payable amount stored in case).
54
- - Or **Appeal to PDRM** for a reduced compound (handled by police portal).
55
- - Or **Appeal to Magistrate** (judicial path).
56
- 3. **PDRM Officer** (Police Portal) decides on compound appeal:
57
- - If **tolak** payable stays standard RM300.
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
- ## Quick start (local / Hugging Face)
 
 
 
 
 
 
 
 
 
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