How dinakar-s/aimed-compliance works
Project Type and Purpose
• The project is a full-stack web application focused on the healthcare domain. It evaluates AI-generated responses for accuracy, compliance (HIPAA, GDPR, ethical standards), bias, and security issues.
• The README clearly outlines several modules like a Medical Chatbot, AI Model Comparison, Compliance Checker, Bias Detector, and Security Module. Although it relies on external AI API calls (via OpenRouter.ai), most logic is handled in the frontend.
• The purpose is to empower healthcare institutions with a tool that “ensures AI safety” before deployment by providing multi-faceted testing and reporting functionality.
File Structure
• There is a mix of top-level files (App.jsx, api.js, index.html, etc.) and a well-organized source structure under the “src” directory.
• “src/components”, “src/pages”, and “src/utils” indicate that the application is built in a modular way:
• Components: Reusable UI elements for various parts like Chat, Navbar, Controls, HospitalFinder, etc.
• Pages: Specific application pages such as Home, Chatbot, ComplianceChecker, AIModelComparison, etc.
• Utils and Data: Contain helper modules for bias detection, compliance checking, security evaluation, and local datasets (CSV and JSON) that drive the comparisons and analysis.
• The “assistants” directory in “src” houses integrations with different AI providers (deepseekai, googleai, openai), suggesting a plug-and-play approach to handling AI service calls.
• Configuration files like vite.config.js, package.json, and .env exist, which support building and deployment using modern tooling (React, Vite).
Main Components
a. Frontend User Interface
• React Components & Pages: Covering layout, navigation (Navbar, Header, Footer), and individual functionality (Chat, HospitalFinder, AI Comparison).
• Styling: Managed via modules (module.css files) and global CSS.
• Data Interaction: Pages trigger various functionalities such as chat processing and report generation.
b. API Communication Module
• API files (api.js in root, src/api/aiModels.js) that wrap calls to external services. These encapsulate interactions with the LLM-based backend (OpenRouter.ai).
c. AI Service Integrations
• “src/assistants” folder holds helper scripts to interact with multiple AI models/providers (Google AI, DeepSeek, OpenAI). This layer represents the modular integration point with external AI engines.
d. Data Management & Utility Modules
• “src/data” and “src/utils” contain training data, evaluation logic, and scripts for compliance, bias, and security checks.
• CSV and JSON data (e.g., train.csv, medical-qna.json) are fed into evaluation processes.
e. PDF Report Generation Module
• Utilizes libraries like jsPDF (as noted in the README) for creating audit reports based on evaluation results.
f. External Services & Deployment
• The external AI service (OpenRouter.ai) is a key dependency.
• Deployment on Vercel shows how the frontend is hosted, with GitHub as source control.
Relationships and Interactions
• End-user interactions begin at the UI (via browser) – e.g., the user submits a query through the Medical Chatbot.
• The UI sends a request through internal API modules which handle routing and aggregation of responses from the various AI service integrations.
• These API modules process the response through internal utilities (complianceChecker, biasDetection, securityCheck) before rendering the final output.
• For features like PDF Export or AI Model Comparison, the data flows from the evaluation modules, is formatted appropriately, and then passed to the rendering or export component.
• There’s also a clear separation between authenticated modules (ClerkAuth and related components) and public accessible pages, indicating a security-layer integration.
• “User Interface (React components & pages)” for the front-end layer.
• “API Communication Module” for files such as api.js and modules under /src/api.
• “AI Integration Assistants” representing the multiple AI providers.
• “Evaluation & Utility Modules” capturing compliance, security, bias detection utilities.
• “Data Store” as a generic component for training data and configuration files.
• “External Services” block for OpenRouter.ai and deployment (Vercel).
• From UI → API Communication → AI Assistant modules → Evaluation/Utility modules → UI Response.
• Notes where necessary, like “Compliance Checks (HIPAA, GDPR)” in the evaluation module, or “PDF Report Generation” indicating the use of jsPDF.