MedQuery is a specialized analytics platform designed to empower healthcare professionals to interact with complex clinical datasets, such as MIMIC-IV, using natural language. By leveraging a FastAPI backend and a React-based frontend, it translates plain English questions into precise SQL queries, providing real-time insights for clinical decision support.
The core logic, RAG engine, and API services can be found here: MedQuery-Backend
- Plain English Interface: Query clinical data without needing to know SQL.
- Real-time Processing: Fast execution of complex queries against large datasets.
- SQL Review Mode: Optional mode for users to inspect and edit the generated SQL before execution.
- JWT Authentication: Secure login system with token-based session management.
- Role-Based Access Control (RBAC): Specific routes and actions are restricted based on user roles (e.g.,
adminvs.doctor). - Protected Routes: Automatic redirection to login for unauthorized access attempts.
- Dynamic Analytics: Visualized data insights using Recharts.
- Session History: Track and revisit queries executed during the current session.
- Smart Stat Cards: High-level overview of database health and query metrics.
- Schema Exploration: Dedicated pages to view and understand the underlying database structure.
- Document Management: Integration for uploading and processing clinical notes or datasets.
- Markdown Support: Results are rendered with support for complex formatting and GFM.
- Frontend: React 18, TypeScript, Vite
- Styling: Tailwind CSS, Shadcn/UI
- State Management: TanStack Query (React Query)
- Routing: React Router DOM v6
- Icons: Lucide React
- Clone the repository:
git clone https://github.com/UmarYaksambi/MedQuery.git
cd MedQuery
- Install dependencies:
npm install
- Configure Environment:
Ensure your backend is running at
http://localhost:8000. You can update the API endpoint insrc/pages/Index.tsxif necessary. - Start Development Server:
npm run dev
src/components/auth: Authentication logic and route protection.src/components/layout: Dashboard and Sidebar navigation layouts.src/components/query: Components for inputting questions and displaying SQL/Data results.src/pages: Individual views for Analytics, Database, History, and Settings.src/lib: API utility functions and helper methods.