How devbyritesh/human-disease-prediction-full-stack-website works
Main Components
a. Client/Browser – Users interact with the website via a web browser. This layer includes the various UI templates (found in the “templates” directory), organized by roles (admin, doctor, patient, and general views like the homepage and signin pages).
b. Web Server – The Django application itself represents the core backend. In the file structure, the “disease_prediction” directory (holding settings.py, urls.py, wsgi.py) acts as the project’s configuration and entry point.
c. Django Sub-Applications – There are three main Django apps:
• Accounts – Handles user authentication and profile management.
• Chats – Manages real-time consultation or messaging features.
• Main_app – Likely contains core business logic for the disease prediction workflow, appointments, ratings, and reviews.
d. Machine Learning Module – The “trained_model” directory indicates the presence of a pre-trained ML model that processes symptom inputs to predict diseases.
e. Database – The project requires PostgreSQL (as stated in the README) and relies upon Django’s ORM (with migrations under each app) for database interactions.
f. Static/Supporting Files – This includes CSS, JavaScript, images, and fonts stored under the “templates” and “pics” directories.
Establishing Relationships and Data Flow
a. Client Interaction: Users access the site via a browser. All HTML/CSS/JS files (rendered by Django templates) represent the front-end.
b. HTTP Requests & Django Routing: The user’s requests are handled by Django’s URL dispatcher (configured in “disease_prediction/urls.py” and each app’s urls.py files). Different endpoints will route to view functions and class-based views within each respective module (accounts, chats, main_app).
c. Business Logic & Database Interaction: View functions call the business logic and interact with the database using Django’s ORM. Migrations in each app indicate database schema designs.
d. Machine Learning Integration: At relevant endpoints (likely within main_app), the system collects symptom data from users, passes this data to the machine learning model in “trained_model” for inference, and then sends the prediction back to the front-end.
e. Communication Between Modules: Although Django apps are modular, they may also interact indirectly to share data (for instance, account data used by chats or main_app modules).
Architectural Patterns and Design Principles
a. Model-View-Template (MVT): This is evident throughout the project – models (in models.py) for database schema, views (in views.py) for handling logic, and templates for rendering the UI.
b. Separation of Concerns: The clear division into separate apps (accounts, chats, main_app) promotes modularity.
c. Reusability and Extensibility: The structure of the “templates” directory (with separate folders for admin, patient, doctor, etc.) suggests designed extensibility and a focus on role-specific interfaces.
d. Integration of Machine Learning: The ML component is integrated with the traditional web backend, showing the coexistence of rule-based web app logic and predictive analysis.
Final Reminders for the Principal Software Engineer
• Annotations that highlight how Django’s MVT architecture, modular Django apps, and the integrated machine learning model work together to deliver the full-stack functionality.