# omerlahav/onco architecture

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

- Interactive diagram: https://gitdiagram.com/omerlahav/onco
- Repository: https://github.com/omerlahav/onco

## Overview

##### Project Overview
This is a full-stack web application for hospital oncology department management, built with Laravel 5.6 backend and HTML5/CSS3/JavaScript frontend.

##### Main System Components

A. Frontend Layer:
- Admin Panel (portal for staff management)
- Patient Portal (symptom reporting, appointments)
- Authentication interfaces
- Dashboard views
- Treatment management interfaces

B. Backend Layer:
- Laravel MVC Architecture
- Authentication System
- Controllers for different modules:
- Appointments
- Medications
- Symptoms
- Treatments
- Patient Management
- Staff Management

C. External Services Integration:
- Google Charts API
- Google Calendar API
- Nexmo (Communications)
- LHNCBC API

D. Database Layer:
- User Management
- Patient Records
- Medical Data (Treatments, Medications, Symptoms)
- Appointment Management

**[Client Layer]**
- ↑↓
**[Web Server Layer]**
- ↑↓
**[Application Layer]**
- ↑↓
**[Database Layer]**

##### Specific Implementation Details

Frontend Section:
**[Admin Portal] ← → [Patient Portal]**
- ↓               ↓
**[Dashboard Views] [Medical Forms]**
- ↓               ↓
**[Authentication Layer]**

Backend Section:
**[Laravel Controllers]**
- ↙     ↓     ↘
**[Models] [Views] [Services]**
- ↓
**[Database]**

External Services:
**[Application]**
- ↑   ↑   ↑
**[Google] [Nexmo] [LHNCBC]**

##### Important Elements

- Security layer showing authentication flow
- Cron job system for scheduled tasks
- Email notification system
- File storage system for medical records
- API integration points
- Database relationships between patients, treatments, and medications

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#e74c3c,stroke:#c0392b,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef auth fill:#9b59b6,stroke:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        AdminPanel["Admin Panel"]
        PatientPortal["Patient Portal"]
        AuthUI["Authentication Interface"]
        Dashboard["Dashboard Views"]
        TreatmentUI["Treatment Interface"]
        MedicationUI["Medication Interface"]
        SymptomUI["Symptom Interface"]
        AppointmentUI["Appointment Interface"]
        EmailTemplates["Email Templates"]
        ChartViews["Chart Views"]
        CalendarJS["Calendar Integration"]
    end

    %% Backend Layer
    subgraph Backend
        AuthController["Auth Controller"]
        DashboardController["Dashboard Controller"]
        PatientController["Patient Controller"]
        TreatmentController["Treatment Controller"]
        MedicationController["Medication Controller"]
        SymptomController["Symptom Controller"]
        AppointmentController["Appointment Controller"]
        ChartsController["Charts Controller"]
        MailHelper["Mail Helper"]
    end

    %% Database Layer
    subgraph Database
        UserDB[(User Management)]
        PatientDB[(Patient Records)]
        TreatmentDB[(Treatments)]
        MedicationDB[(Medications)]
        SymptomDB[(Symptoms)]
        AppointmentDB[(Appointments)]
    end

    %% External Services
    subgraph External
        GoogleCharts["Google Charts API"]
        GoogleCalendar["Google Calendar API"]
        Nexmo["Nexmo Communications"]
        LHNCBC["LHNCBC API"]
    end

    %% Relationships
    AdminPanel --> AuthUI
    PatientPortal --> AuthUI
    AuthUI --> AuthController
    Dashboard --> DashboardController
    TreatmentUI --> TreatmentController
    MedicationUI --> MedicationController
    SymptomUI --> SymptomController
    AppointmentUI --> AppointmentController
    ChartViews --> ChartsController

    AuthController --> UserDB
    PatientController --> PatientDB
    TreatmentController --> TreatmentDB
    MedicationController --> MedicationDB
    SymptomController --> SymptomDB
    AppointmentController --> AppointmentDB

    ChartsController --> GoogleCharts
    CalendarJS --> GoogleCalendar
    MailHelper --> Nexmo
    PatientController --> LHNCBC

    %% Click Events
    click AdminPanel "https://github.com/OmerLahav/onco/tree/master/front/admin-panel/"
    click AuthUI "https://github.com/OmerLahav/onco/blob/master/front/login.html"
    click AuthController "https://github.com/OmerLahav/onco/tree/master/laravel/app/Http/Controllers/Auth/"
    click Dashboard "https://github.com/OmerLahav/onco/tree/master/front/admin-panel/dashboard/"
    click DashboardController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/DashboardController.php"
    click PatientController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/PatientsController.php"
    click TreatmentController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/TreatmentsController.php"
    click MedicationController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/MedicationsController.php"
    click SymptomController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/SymptomsController.php"
    click AppointmentController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/AppointmentsController.php"
    click EmailTemplates "https://github.com/OmerLahav/onco/tree/master/front/emails/"
    click MailHelper "https://github.com/OmerLahav/onco/blob/master/laravel/app/Helpers/MailSendHelper.php"
    click CalendarJS "https://github.com/OmerLahav/onco/blob/master/front/js/calendar.js"
    click ChartViews "https://github.com/OmerLahav/onco/tree/master/laravel/resources/views/charts/"
    click ChartsController "https://github.com/OmerLahav/onco/blob/master/laravel/app/Http/Controllers/ChartsController.php"

    %% Style Applications
    class AdminPanel,PatientPortal,AuthUI,Dashboard,TreatmentUI,MedicationUI,SymptomUI,AppointmentUI,EmailTemplates,ChartViews,CalendarJS frontend
    class AuthController,DashboardController,PatientController,TreatmentController,MedicationController,SymptomController,AppointmentController,ChartsController,MailHelper backend
    class UserDB,PatientDB,TreatmentDB,MedicationDB,SymptomDB,AppointmentDB database
    class GoogleCharts,GoogleCalendar,Nexmo,LHNCBC external
    class AuthUI,AuthController auth
```
