# jonnathitq/clinicaproyectofinal architecture

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

- Interactive diagram: https://gitdiagram.com/jonnathitq/clinicaproyectofinal
- Repository: https://github.com/jonnathitq/clinicaproyectofinal

## Overview

##### Project Type and Purpose
- This is a full-stack, server-side-rendered (SSR) web application for a dental clinic (“ClinicaDental”).
- Frontend: Angular 20 application (with Universal for SSR).
- Backend: Node.js/Express REST API serving appointment scheduling, user (admin/doctor/paciente) management, availability, patient history, and services.
- Database: MongoDB (via Mongoose models in backend/models).

##### File-Structure Analysis
- Top-level files: angular.json, package.json (workspace config), README.md.
- “backend” directory:
– config/db.js – MongoDB connection setup
– models/*.js – Mongoose schemas (admin, doctor, paciente, citas, disponibilidad, historial, servicios)
– routes/*.js – Express route modules, all prefixed “/api/…” in server.js
– server.js – boots Express API server on configurable port
- “src” directory: Angular application
– src/app – core client code (components, pages, module UI, routing, CSS/HTML/TS)
– src/main.ts & src/main.server.ts – Angular entry points for client and SSR
– src/server.ts – Express wrapper that serves Angular Universal + static assets
- “public” – static assets served by SSR/Express
- tsconfig*.json – TypeScript and spec/test configs
- test.css, test.html – likely scratch files

##### Key README Insights
- Angular CLI scaffolding & dev server commands (ng serve, ng build).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Workspace & Build Configuration"
        Workspace["Workspace Config\n(angular.json, package.json)"]:::config
    end

    subgraph "Frontend Layer"
        Browser["Browser (Angular CSR)"]:::browser
        subgraph "Angular Universal Server"
            SSR["Angular Universal Server\n(src/main.server.ts, src/server.ts)"]:::ssr
            Index["Index & Styles\n(src/index.html, src/styles.css)"]:::static
        end
        ClientBundle["Angular Client Bundle\n(src/main.ts)"]:::browser
        PublicAssets["Public Assets (static)"]:::static
    end

    subgraph "Backend Layer"
        API["Express API Server\n(backend/server.js)"]:::api
        Routes["API Routes\n(backend/routes/)"]:::api
        DBConfig["DB Config\n(backend/config/db.js)"]:::db
        Models["Mongoose Models\n(backend/models/)"]:::db
        MongoDB[(MongoDB)]:::db
    end

    Workspace -->|configures| SSR
    Workspace -->|configures| API

    Browser -->|"Initial GET /"| SSR
    SSR -->|"Serves SSR HTML + JS"| Browser
    SSR -->|"Serves static files"| PublicAssets
    PublicAssets -.->|"Delivered to client"| Browser
    Browser -->|"GET/POST /api/*"| API
    SSR -->|"Server-side data fetch /api/*"| API
    API -->|"routes handled by"| Routes
    API -->|"connects via config"| DBConfig
    DBConfig -->|"loads schemas"| Models
    Models -->|"queries"| MongoDB

    click Browser "https://github.com/jonnathitq/clinicaproyectofinal/tree/master/src/app/"
    click SSR "https://github.com/jonnathitq/clinicaproyectofinal/blob/master/src/server.ts"
    click ClientBundle "https://github.com/jonnathitq/clinicaproyectofinal/blob/master/src/main.ts"
    click Index "https://github.com/jonnathitq/clinicaproyectofinal/blob/master/src/index.html"
    click PublicAssets "https://github.com/jonnathitq/clinicaproyectofinal/tree/master/public/"
    click API "https://github.com/jonnathitq/clinicaproyectofinal/blob/master/backend/server.js"
    click Routes "https://github.com/jonnathitq/clinicaproyectofinal/tree/master/backend/routes/"
    click DBConfig "https://github.com/jonnathitq/clinicaproyectofinal/blob/master/backend/config/db.js"
    click Models "https://github.com/jonnathitq/clinicaproyectofinal/tree/master/backend/models/"
    click Workspace "https://github.com/jonnathitq/clinicaproyectofinal/blob/master/angular.json"

    classDef browser fill:#CCE5FF,stroke:#0366d6,color:#000
    classDef ssr fill:#B3D7FF,stroke:#0366d6,color:#000
    classDef api fill:#D5E8D4,stroke:#2E7D32,color:#000
    classDef db fill:#F8CECC,stroke:#A41E11,color:#000
    classDef static fill:#F2F2F2,stroke:#888888,color:#000,stroke-dasharray: 2 2
    classDef config fill:#E1D5E7,stroke:#5A3E85,color:#000
```
