# roopaskumar7/gamuts-guru-intern architecture

> Architecture diagram of the GitHub repository roopaskumar7/gamuts-guru-intern, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/roopaskumar7/gamuts-guru-intern
- Repository: https://github.com/roopaskumar7/gamuts-guru-intern

## Overview

##### Project type and purpose
- This is a full-stack Django web application named “Hospital Management System.”
- Purpose: Provide distinct interfaces and workflows for Admin, Doctor, and Patient roles to manage hospital operations (registration, appointment, discharge, billing).

##### File structure
- Top-level:
- manage.py – entry point for Django commands
- hospitalmanagement/ – Django project settings (ASGI/WSGI, settings.py, urls.py)
- hospital/ – Django app containing models, views, forms, admin config, migrations
- templates/ – Jinja2-style HTML templates for each user role
- static/ – CSS, images, profile pictures, screenshots
- requirement.txt – external Python dependencies
- Patterns:
- Follows Django’s MVC (Model-View-Template) pattern
- Single monolithic code base (no microservices)
- Separate templates per role under templates/hospital
- Uses Django ORM (models.py + migrations) for database interactions
- Uses xhtml2pdf for PDF invoice generation, SMTP for Contact Us email

##### Readme insights
- Three user personas with role-based approval workflows
- Email configuration for contact form in settings.py
- Steps to run: pip install, makemigrations, migrate, runserver
- Drawbacks: no admin approval, demo purpose only

##### Detailed element checklist
- “Forms” —> “Models” —> “Database”
- If generating invoice: “xhtml2pdf”
- If sending email: “SMTP Mail Server”
- Template Engine receives data from Views and returns “HTML + CSS”
- Static file server/network path to client

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interface
    subgraph "Presentation Layer"
        direction TB
        WebClient["Web Client (Browser)"]:::ui
        TemplateEngine["Template Engine\n(renders HTML templates)"]:::ui
        StaticAssets["Static Assets\n(CSS, Images)"]:::ui
    end

    %% Business Logic
    subgraph "Business Logic Layer"
        direction TB
        URLRouter["Django URL Router"]:::logic
        Views["Views\n(hospital/views.py)"]:::logic
        Forms["Forms\n(hospital/forms.py)"]:::logic
        AdminConfig["Admin Site Config\n(hospital/admin.py)"]:::logic
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Models["Models\n(hospital/models.py)"]:::data
        Migrations["Migrations\n(hospital/migrations/)"]:::data
        Database["Relational Database"]:::data
    end

    %% External Services
    subgraph "External Services"
        direction TB
        SMTP["SMTP Mail Server"]:::ext
        PDFService["PDF Generation\n(xhtml2pdf)"]:::ext
    end

    %% Infrastructure & Config
    subgraph "Infrastructure & Config"
        direction TB
        Manage["Entry Point\n(manage.py)"]:::config
        Settings["Project Settings\n(hospitalmanagement/settings.py)"]:::config
        ASGI["ASGI Config\n(hospitalmanagement/asgi.py)"]:::config
        WSGI["WSGI Config\n(hospitalmanagement/wsgi.py)"]:::config
        Requirements["Dependencies\n(requirement.txt)"]:::config
    end

    %% Flow Connections
    WebClient -->|HTTP GET/POST| URLRouter
    URLRouter -->|dispatch| Views
    Views -->|uses| Forms
    Views -->|uses| AdminConfig
    Forms -->|validates| Models
    AdminConfig -->|CRUD| Models
    Models -->|ORM queries| Database
    Views -->|render| TemplateEngine
    TemplateEngine -->|HTML/CSS| WebClient
    Views -->|generate invoice| PDFService
    Views -->|send email| SMTP
    Settings -->|configures| SMTP
    Manage -->|runs| ASGI
    Manage -->|runs| WSGI
    Settings -->|settings| URLRouter
    Settings -->|settings| Views

    %% Assets connections
    TemplateEngine -->|loads templates| TemplatesDir["templates/hospital/"]:::ui
    StaticAssets -->|serves| WebClient

    %% Migrations to Database
    Migrations -->|apply schema| Database

    %% Click Events
    click WebClient "https://github.com/roopaskumar7/gamuts-guru-intern/tree/main/static/"
    click TemplatesDir "https://github.com/roopaskumar7/gamuts-guru-intern/tree/main/templates/hospital/"
    click URLRouter "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospitalmanagement/urls.py"
    click Settings "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospitalmanagement/settings.py"
    click ASGI "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospitalmanagement/asgi.py"
    click WSGI "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospitalmanagement/wsgi.py"
    click Manage "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/manage.py"
    click Views "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospital/views.py"
    click Forms "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospital/forms.py"
    click AdminConfig "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospital/admin.py"
    click Models "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/hospital/models.py"
    click Migrations "https://github.com/roopaskumar7/gamuts-guru-intern/tree/main/hospital/migrations/"
    click Requirements "https://github.com/roopaskumar7/gamuts-guru-intern/blob/main/requirement.txt"

    %% Styles
    classDef ui fill:#D0E7FF,stroke:#0366D6,color:#0366D6,stroke-width:1px;
    classDef logic fill:#DFFFE0,stroke:#28A745,color:#28A745,stroke-width:1px;
    classDef data fill:#FFF4D0,stroke:#E69500,color:#E69500,stroke-width:1px;
    classDef ext fill:#F0E0FF,stroke:#6F42C1,color:#6F42C1,stroke-width:1px;
    classDef config fill:#E2E2E2,stroke:#6A737D,color:#6A737D,stroke-width:1px;
```
