# aashutoshrathi/medtour architecture

> Architecture diagram of the GitHub repository aashutoshrathi/medtour, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aashutoshrathi/medtour
- Repository: https://github.com/aashutoshrathi/medtour

## Overview

##### Main System Components

a) Web Application Layer
- Django Framework as the core
- Three main Django apps:
- Landing App (User Management & Authentication)
- Hospital App (Medical Services Management)
- MedTour Core (Project Configuration)

b) Database Layer
- Based on Django's presence, likely PostgreSQL (for Heroku deployment)
- Major data models

c) External Services
- Email Service (evident from email templates)
- Static File Hosting (for CSS/JS/images)

##### Detailed Component Breakdown

Frontend Components:
- Base template (landing/templates/landing/base.html)
- User-specific views (patient_home, doc_home)
- Hospital management views
- Authentication views

Backend Components:
- Authentication System
- Custom user management (visible in landing app)
- Social authentication (pipeline.py suggests this)
- Hospital Management System
- Appointment handling
- Doctor profiles
- Hospital profiles
- Location Services
- Region and City management

##### Data Flow Representation

- User request flow through URLs (medtour/urls.py → app-specific urls.py)
- Form submissions (landing/forms.py, hospital/forms.py)
- Authentication flow
- Appointment booking process

##### Specific Architectural Elements

**[Client Browser] ←→ [Django Web Server]**
- ↑               ↑

- [Static Files]    [Database]
- ↑               ↑

- [File Storage] [Email Service]

##### Important Details

- User Types (Patients, Doctors, Administrators)
- Authentication flows
- Appointment management system
- Hospital and doctor profile management
- Location-based services
- Static file handling (CSS/JS/images)

##### Technical Stack Indicators

Technologies:
- Django Framework
- UIKit (frontend framework, evident from static files)
- Service Worker (for progressive web app features)
- Database system
- Email service integration

##### Deployment Architecture

Include:
- Heroku hosting environment
- Static file serving
- Database service
- Web server configuration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        PWA["Progressive Web App"]:::pwa
    end

    subgraph "Django Web Server"
        DjangoCore["Django Core"]:::django
        click DjangoCore "https://github.com/aashutoshrathi/medtour/blob/master/medtour/settings.py"

        subgraph "Authentication Layer"
            AuthSystem["Authentication System"]:::auth
            click AuthSystem "https://github.com/aashutoshrathi/medtour/blob/master/landing/pipeline.py"
            UserMgmt["User Management"]:::auth
            click UserMgmt "https://github.com/aashutoshrathi/medtour/blob/master/landing/views.py"
        end

        subgraph "Application Layer"
            HospitalMgmt["Hospital Management"]:::hospital
            click HospitalMgmt "https://github.com/aashutoshrathi/medtour/blob/master/hospital/views.py"
            ApptSystem["Appointment System"]:::hospital
            click ApptSystem "https://github.com/aashutoshrathi/medtour/blob/master/hospital/templates/hospital/appointment.html"
            LocationSvc["Location Services"]:::location
            click LocationSvc "https://github.com/aashutoshrathi/medtour/blob/master/landing/templates/hr/region_list.html"
        end

        subgraph "Template Layer"
            BaseTemplate["Base Template"]:::template
            click BaseTemplate "https://github.com/aashutoshrathi/medtour/blob/master/landing/templates/landing/base.html"
            UserViews["User Views"]:::template
            click UserViews "https://github.com/aashutoshrathi/medtour/blob/master/landing/templates/landing/patient_home.html"
            HospitalViews["Hospital Views"]:::template
            click HospitalViews "https://github.com/aashutoshrathi/medtour/blob/master/hospital/templates/hospital/hospital-profile.html"
            AuthViews["Auth Views"]:::template
            click AuthViews "https://github.com/aashutoshrathi/medtour/blob/master/landing/templates/registration/login.html"
        end
    end

    subgraph "External Services"
        EmailService["Email Service"]:::external
        click EmailService "https://github.com/aashutoshrathi/medtour/blob/master/hospital/templates/emails/approved_appointment.html"
        StaticFiles["Static Files"]:::external
        click StaticFiles "https://github.com/aashutoshrathi/medtour/blob/master/medtour/static/css/uikit.css"
        Database[(PostgreSQL)]:::database
    end

    %% Connections
    Browser --> DjangoCore
    PWA --> DjangoCore
    DjangoCore --> AuthSystem
    DjangoCore --> UserMgmt
    AuthSystem --> UserViews
    AuthSystem --> AuthViews
    UserMgmt --> UserViews
    HospitalMgmt --> HospitalViews
    ApptSystem --> EmailService
    LocationSvc --> HospitalViews
    BaseTemplate --> UserViews
    BaseTemplate --> HospitalViews
    BaseTemplate --> AuthViews
    DjangoCore --> Database
    DjangoCore --> StaticFiles
    Browser --> StaticFiles

    %% Styles
    classDef django fill:#1c4b82,color:white
    classDef auth fill:#ff7f0e,color:white
    classDef hospital fill:#9467bd,color:white
    classDef location fill:#2ca02c,color:white
    classDef template fill:#17a2b8,color:white
    classDef external fill:#7f7f7f,color:white
    classDef database fill:#e377c2,color:white
    classDef pwa fill:#bcbd22,color:white

    %% Legend
    subgraph Legend
        L1["Django Core"]:::django
        L2["Authentication"]:::auth
        L3["Hospital Services"]:::hospital
        L4["Location Services"]:::location
        L5["Templates"]:::template
        L6["External Services"]:::external
        L7["Database"]:::database
        L8["PWA Features"]:::pwa
    end
```
