How ravija-pasalkar/team_mitrix works
Project Type and Purpose
• This is a full-stack, AI-powered Digital KYC (Know Your Customer) system with two web front-ends (user flow + admin portal) backed by a Python/Flask server, AI modules for OCR, face matching and liveness, and a MySQL database.
File Structure
• Root directory
• app.py → main Flask backend serving user KYC endpoints
• OCR.py → OCR and tamper-detection logic
• first.html, second.html → standalone HTML pages for user onboarding flow
• templates/ → Flask templates (third.html, fourth.html)
• admin_portal/
• app.py → Flask app for admin UI
• detect.py → admin’s AI-driven analysis module
• index.html, script.js, styles.css → static assets for the admin portal
• requirements.txt, .vscode/ → environment & editor setup
Extract Key Architecture Insights from README
• User frontend collects documents, captures video+audio for liveness.
• Python back end orchestrates:
• OCR.py for document forgery detection (OCR + image comparison)
• Gemini GenAI API to generate dynamic spoken prompts
• Speech-to-text to verify the prompt was read correctly
• Face-matching module to compare live video frames with uploaded document photo
• Admin portal provides oversight and GenAI-driven analytics.
• MySQL used for persisting user data and KYC results.
Main Components & Their Interactions
a. User Browser (first.html → Flask app.py)
b. Flask Backend (app.py)
• Routes: /upload-documents, /start-liveness, /submit-consent
• Modules: OCR.py, AI-liveness, face matcher, Gemini API client
c. MySQL Database (kyc_verification)
d. External Service: Google Gemini API
e. Admin Portal (admin_portal/app.py + static assets + detect.py)
Data Flow Sequence:
1. User Browser → HTTP POST /upload-documents → Flask Backend
2. Flask calls OCR.py → returns tamper flag → stores result in MySQL
3. Flask requests Gemini API → generates prompt → returns to browser
4. Browser captures video+audio → HTTP POST /submit-liveness → Flask
5. Flask runs speech-to-text + face matcher → stores pass/fail in MySQL
6. Browser posts GDPR/DPDP consent → Flask finalizes status
7. Admin Browser → HTTP GET /admin-dashboard → Flask Admin App
8. Admin app calls detect.py & MySQL to render analytics
Architectural Patterns & Design Principles
• Separation of concerns: Presentation (HTML/JS), Application (Flask), AI Modules (OCR, GenAI wrapper, speech, face matcher), Data (MySQL)
• Modular AI services (OCR.py, detect.py) can be swapped or scaled independently
• Single-page flows in plain HTML/JS for rapid front-end changes without complex frameworks
Essential Details to Capture
• Distinct service endpoints for user vs. admin flows
• AI-pipeline ordering (OCR → prompt generation → liveness → face match)
• Data persistence interactions (read/write to MySQL)
• External dependency on Gemini API