The Inspiration: Demystifying Consumer Justice
Every single day, thousands of citizens across Bangladesh fall victim to F-commerce delivery fraud, extreme retail overcharging above Maximum Retail Price (MRP), and dangerous counterfeit pharmaceuticals with forged DGDA DAR registrations. While the Consumer Rights Protection Act (CRPA) 2009 offers bulletproof statutory protection—including a unique 25% cash bounty reward for reported administrative fines under Section 76(2)—the traditional manual filing system creates an overwhelming backlog.
From the bangla word Haq that means rights... I built Haq AI to weaponize technology for the everyday consumer. By automating evidence verification and introducing a strict, time-bound pre-litigation sandbox, Haq AI turns consumer laws into code, settling disputes between buyers and merchants before they ever burden a Magistrate court docket.
How I Built It
As a solo developer, I built the entire end-to-end ecosystem over an intense 5-day sprint. The platform is architected to run blazingly fast without corporate fluff:
- Frontend Layer: Engineered using Vite + React with fully interactive elements, responsive UI layouts, and a zero-delay state machine tracking dispute windows.
- Backend Architecture: Built with Node.js (Express) handling live transaction state changes, secure SMS (Onecodesoft) / Email OTP (Titan mail) authentication flows, and real-time database indexing.
- Database & Memory Engine: Driven by MongoDB, keeping a permanent, unalterable digital audit trail of every dispute communication log.
- AI Cognitive Pipeline: Integrated Ultramarine Flash AI model by Paperinstruments for instant context-aware text parsing, proof validation, and defensive anti-trolling logic—excelling in law, consulting, and serious professional work.
- Localization Matrix: Leveraged ElevenLabs v4 Bangla TTS/STT API endpoints, rendering natural local-language synthesis to ensure the platform remains fully accessible by voice for citizens of all literacy backgrounds.
Technical Math: The 72-Hour Resolution Matrix
To quantify legal urgency and prevent stall tactics from malicious merchants, the platform relies on an automated exponential decay resolution window tracking mechanism:
$$\Delta t_{\text{remaining}} = T_{\text{max}} - (t_{\text{current}} - t_{\text{dispatch}})$$
Where (T_{\text{max}} = 72 \text{ hours}). If (\Delta t_{\text{remaining}} \le 0) without a verified bilateral digital settlement token, the state machine triggers an automated escalation sequence, mathematically scaling the potential administrative liability (L_{\text{admin}}) under Section 40/44/45 of CRPA 2009:
$$L_{\text{admin}} = \sum (F_{\text{statutory}} + C_{\text{damages}}) \times (1 + \alpha_{\text{delay}})$$
Where the complainant's legal bounty return (B_{\text{complainant}}) is hardcoded strictly at:
$$B_{\text{complainant}} = 0.25 \times L_{\text{admin}}$$
Challenges I Faced & Overcame
- Finding tools: Building it seriously required me to find robust tools and packages which are good for UX and performance so the user doesn't feel any clutter.
- Contextual Anti-Troll Filtering: Forging fake dispute receipts or weaponizing bad reviews is common. Overcoming this required engineering strict, multi-tiered algorithmic validation rules within the Ultramarine Flash AI engine to filter out noise, parse raw transactional logs, and flag malicious claim profiles.
- Bangla Voice Processing: Tuning regional inflections to ensure the voice agent parsed audio without misinterpreting statutory references was tough, but tweaking custom phonetic mappings via ElevenLabs v4 cracked the problem.
What I Learned
Building Haq AI proved that small, agile, solo developers can build production-ready civic technology with the power of tech, AI, and ease of information in this generation. I learned how to seamlessly connect complex, rigid statutory frameworks with smooth AI engines—proving that the best way to scale legal equality is to wrap the law inside an automated, secure codebase that humanity will find easy to use.
Built With
- cors
- elevanlabs
- express.js
- mongodb
- onecodesoft
- openai-compatible
- paperinstruments
- react
- titanmail
- typescript
- vite