How dont-wait/diagnosis-project works
Project Type and Purpose
• This is a full-stack AI-powered medical diagnosis system.
• The backend is a Python web service (Flask or FastAPI) that exposes a RESTful API.
• The frontend is a simple static UI (HTML/CSS/JS) for patient data entry and result display.
• Machine learning models (Scikit-learn, TensorFlow) live in the “models” folder and perform inference.
File Structure Analysis
• Top-level:
• app.py – main Flask/FastAPI app entry point
• client/ – static UI assets
• models/ – pre-trained ML artifacts (.pkl, .pth)
• README & IDE configs (.idea, .vscode)
• client/:
• index.html – UI skeleton
• css/style.css & tailwind-config.js – styling
• js/main.js, diagnosis.js – UI logic & AJAX calls to the API
• No database directory—likely the service is stateless, loading models on demand.
Key README Insights
• Purpose: symptom-based disease prediction, visual output for recommendations.
• Tech stack: Python + ML libs for backend; HTML/CSS/JS for frontend.
• RESTful API for integration/testing (e.g., via Postman).
a. Main Components
1. Client Browser UI
2. Web Server (Flask/FastAPI)
3. ML Inference Module
4. Machine Learning Models (stored artifacts)
5. (Optional) Data store or cache for usage logs or future persistence
6. External systems or tools (e.g., Postman for API testing)
b. Relationships & Data Flow
• UI → HTTP Request (JSON payload with symptoms) → Web Server API Endpoint
• Web Server loads or references ML models → invokes Inference Module
• Inference Module runs prediction → returns diagnosis JSON
• Web Server → JSON Response → UI
c. Architectural Patterns & Principles
• Separation of concerns: UI (client) vs. API (server) vs. ML logic
• Model-view-controller flavor: client = view, app.py routes = controller, models = business logic
• Stateless services: each API call loads model(s) and returns result
d. Key Technologies
• Flask or FastAPI (routing, request handling)
• Scikit-learn, TensorFlow, Pandas (data processing & model inference)
• HTML/CSS/Tailwind, vanilla JS (UI rendering & AJAX)
Detailed but Focused
• Piece of functionality as its own component.
• Don’t over-complicate—stick to your actual folder structure and runtime flow.