# atharva2001/doctors-gallery architecture

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

- Interactive diagram: https://gitdiagram.com/atharva2001/doctors-gallery
- Repository: https://github.com/atharva2001/doctors-gallery

## Overview

##### Project type and purpose
- This is a microservices-based Doctor-Patient appointment platform.
- It comprises three standalone Python REST APIs—auth_service, core_services, and appointment_service—each containerized via Docker and orchestrated with docker-compose.

##### File structure
- Top-level files:
- docker-compose.yaml → defines multi-container orchestration and networking
- .gitignore / .dockerignore / LICENSE / README.md
- Services directories:
- auth_service/
– Dockerfile, main.py
– app/routes/ (login.py, register.py)
– app/model/ (User.py, Login.py)
– app/database/ (core.py, init.sql, register.py, login.py)
– app/common_utils/ (jwt_utils, log_utils, password_hash)
- core_services/
– Dockerfile, main.py
– app/routes/ (doctors.py, patients.py)
– app/models/ (users.py)
– app/database/ (core.py, doctors.py, patients.py)
- appointment_service/
– Dockerfile, main.py
– app/routes/appointment.py
– app/model/ (appointment.py, slots.py)
– app/database/ (core.py, appointment.py, slots.py)
– appointment.db (SQLite file)
- Common pattern: each service has its own code, DB layer, models, and HTTP routes.

##### README for additional insights
- Confirms the domain: “Doctor-Patient appointment platform.”

- Clients (Web/Mobile)
- auth_service container + User DB
- core_services container + Doctor/Patient DB
- appointment_service container + Appointment DB
- docker-compose network overlay
b. Relationships & interactions:
- Client → auth_service (POST /register, POST /login)
- Client → core_services (GET /doctors, GET /patients)
- Client → appointment_service (GET/POST /appointments)
- appointment_service → core_services (to verify doctor/patient IDs)
- appointment_service & core_services → auth_service (to verify JWT)
c. Architectural patterns & design principles:
- Microservices for bounded contexts
- Database-per-service for data autonomy
- RESTful APIs with clear route separation
- Containerization (Docker) + docker-compose for local orchestration
d. Key technologies & libraries:
- Python + Flask or FastAPI (app/routes structure)
- SQLAlchemy or direct SQLite (app/database modules)
- JSON Web Tokens (auth_service/common_utils/jwt_utils)
- Docker / docker-compose

## Diagram (Mermaid)

```mermaid
flowchart TD
    Clients["Clients\n(Web/Mobile)"]:::client

    subgraph "Docker Compose Network"
        direction TB
        Auth["Auth Service"]:::service
        AuthDB["Auth DB"]:::db
        Core["Core Service"]:::service
        CoreDB["Core DB"]:::db
        Appointment["Appointment Service"]:::service
        AppointmentDB["Appointment DB"]:::db
    end

    Infra[/"docker-compose.yaml"/]:::infra

    Clients -->|POST /register\nPOST /login| Auth
    Clients -->|GET /doctors\nGET /patients| Core
    Clients -->|GET/POST /appointments| Appointment

    Appointment -.->|"verify JWT"| Auth
    Appointment -->|"verify doctor/patient IDs"| Core
    Core -.->|"verify JWT"| Auth

    Auth --> AuthDB
    Core --> CoreDB
    Appointment --> AppointmentDB

    click Infra "https://github.com/atharva2001/doctors-gallery/blob/main/docker-compose.yaml"

    click Auth "https://github.com/atharva2001/doctors-gallery/tree/main/auth_service/Dockerfile"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/main.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/routes/register.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/routes/login.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/model/User.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/model/Login.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/database/core.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/database/init.sql"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/database/register.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/database/login.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/common_utils/jwt_utils.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/common_utils/log_utils.py"
    click Auth "https://github.com/atharva2001/doctors-gallery/blob/main/auth_service/app/common_utils/password_hash.py"

    click Core "https://github.com/atharva2001/doctors-gallery/tree/main/core_services/Dockerfile"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/main.py"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/app/routes/doctors.py"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/app/routes/patients.py"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/app/models/users.py"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/app/database/core.py"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/app/database/doctors.py"
    click Core "https://github.com/atharva2001/doctors-gallery/blob/main/core_services/app/database/patients.py"

    click Appointment "https://github.com/atharva2001/doctors-gallery/tree/main/appointment_service/Dockerfile"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/main.py"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/app/routes/appointment.py"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/app/model/appointment.py"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/app/model/slots.py"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/app/database/core.py"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/app/database/appointment.py"
    click Appointment "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/app/database/slots.py"
    click AppointmentDB "https://github.com/atharva2001/doctors-gallery/blob/main/appointment_service/appointment.db"

    classDef service fill:#ADD8E6,stroke:#333,color:#000;
    classDef db fill:#FFA500,stroke:#333,color:#000;
    classDef client fill:#90EE90,stroke:#333,color:#000;
    classDef infra fill:#D3D3D3,stroke:#333,color:#000;
    classDef component fill:#f9f,stroke:#333,color:#000;
```
