# juanpablonie77-droid/derma-sim architecture

> Architecture diagram of the GitHub repository juanpablonie77-droid/derma-sim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juanpablonie77-droid/derma-sim
- Repository: https://github.com/juanpablonie77-droid/derma-sim

## Overview

Derma-Sim is an educational dermatology case simulator: students authenticate, browse and inspect a case, submit a diagnostic decision, then receive an AI tutor’s evaluation and feedback. The server also supports clinical case activation and reviewer scoring of session metrics. The graph separates presentation, API, domain workflows, and persistence/tutoring. Relationships are limited to calls and dependencies visible in excerpts or the SOURCE INDEX, plus the README’s documented client-server boundary; unsampled details are not inferred.

Main entry points: [`client/src/main.js`](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/main.js) (Vue application), [`server/src/routes.js`](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/routes.js) (HTTP routes), [`client/src/api.js`](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/api.js) (API client), [`server/src/services/SesionService.js`](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/SesionService.js) (Session and evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Student presentation"]
  node_app["Vue application<br/>[main.js]"]
  node_shell["App shell<br/>[App.vue]"]
  node_authviews["Login and registration<br/>[Login.vue]"]
  node_authstore["Auth store<br/>[stores.js]"]
  node_caseview["Case listing<br/>[Casos.vue]"]
  node_caseviewer["Case viewer<br/>[Visor.vue]"]
  node_decisionview["Decision form<br/>[Decision.vue]"]
  node_resultview["Evaluation result<br/>[Resultado.vue]"]
  node_steps["Workflow steps<br/>[Pasos.vue]"]
  node_apihelper["API client<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_routes["HTTP routes<br/>[routes.js]"]
  node_middleware["Access middleware<br/>[middleware.js]"]
  node_errors["Domain errors<br/>[errores.js]"]
end

subgraph group_domain["Case and session workflows"]
  node_casework["Case catalog and review<br/>[CasoService.js]"]
  node_sessionwork["Session and evaluation<br/>[SesionService.js]"]
  node_states["Session transitions<br/>[estados.js]"]
end

subgraph group_support["Tutor and persistence"]
  node_tutor["AI tutor adapter<br/>[index.js]"]
  node_database[("SQLite database<br/>[db.js]")]
end

node_student(("Student"))
node_reviewer(("Clinical reviewer"))

node_student -->|"uses"| node_app
node_reviewer -->|"uses"| node_app
node_app -->|"mounts"| node_shell
node_app -->|"routes to"| node_authviews
node_app -->|"routes to"| node_caseview
node_app -->|"routes to"| node_caseviewer
node_app -->|"routes to"| node_decisionview
node_app -->|"routes to"| node_resultview
node_shell -->|"uses"| node_authstore
node_authviews -->|"uses"| node_authstore
node_authstore -->|"calls"| node_apihelper
node_caseview -->|"calls"| node_apihelper
node_caseviewer -->|"calls"| node_apihelper
node_decisionview -->|"calls"| node_apihelper
node_resultview -->|"calls"| node_apihelper
node_caseview -->|"renders"| node_steps
node_decisionview -->|"renders"| node_steps
node_resultview -->|"renders"| node_steps
node_apihelper -->|"requests API"| node_routes
node_routes -->|"applies"| node_middleware
node_routes -->|"raises"| node_errors
node_routes -->|"dispatches"| node_casework
node_routes -->|"dispatches"| node_sessionwork
node_routes -->|"reads and writes"| node_database
node_routes -->|"creates"| node_tutor
node_casework -->|"reads and writes"| node_database
node_casework -->|"raises"| node_errors
node_sessionwork -->|"reads and writes"| node_database
node_sessionwork -->|"validates transitions"| node_states
node_sessionwork -->|"raises"| node_errors
node_sessionwork -->|"evaluates with"| node_tutor
node_tutor -->|"raises"| node_errors

click node_app "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/main.js"
click node_shell "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/App.vue"
click node_authviews "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Login.vue"
click node_authstore "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/stores.js"
click node_caseview "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Casos.vue"
click node_caseviewer "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Visor.vue"
click node_decisionview "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Decision.vue"
click node_resultview "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Resultado.vue"
click node_steps "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/components/Pasos.vue"
click node_apihelper "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/api.js"
click node_routes "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/routes.js"
click node_middleware "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/middleware.js"
click node_errors "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/errores.js"
click node_casework "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/CasoService.js"
click node_sessionwork "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/SesionService.js"
click node_states "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/estados.js"
click node_tutor "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/tutor/index.js"
click node_database "https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/db.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_shell,node_authviews,node_authstore,node_caseview,node_caseviewer,node_decisionview,node_resultview,node_steps,node_apihelper,node_reviewer toneBlue
class node_routes,node_middleware,node_errors toneAmber
class node_casework,node_sessionwork,node_states toneMint
class node_tutor,node_database toneRose
class node_student toneIndigo
```

## Components

### Student presentation

- [Vue application](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/main.js): `client/src/main.js`
- [App shell](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/App.vue): `client/src/App.vue`
- [Login and registration](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Login.vue): `client/src/views/Login.vue`
- [Auth store](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/stores.js): `client/src/stores.js`
- [Case listing](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Casos.vue): `client/src/views/Casos.vue`
- [Case viewer](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Visor.vue): `client/src/views/Visor.vue`
- [Decision form](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Decision.vue): `client/src/views/Decision.vue`
- [Evaluation result](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/views/Resultado.vue): `client/src/views/Resultado.vue`
- [Workflow steps](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/components/Pasos.vue): `client/src/components/Pasos.vue`
- [API client](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/client/src/api.js): `client/src/api.js`

### API and access

- [HTTP routes](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/routes.js): `server/src/routes.js`
- [Access middleware](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/middleware.js): `server/src/middleware.js`
- [Domain errors](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/errores.js): `server/src/errores.js`

### Case and session workflows

- [Case catalog and review](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/CasoService.js): `server/src/services/CasoService.js`
- [Session and evaluation](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/SesionService.js): `server/src/services/SesionService.js`
- [Session transitions](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/services/estados.js): `server/src/services/estados.js`

### Tutor and persistence

- [AI tutor adapter](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/tutor/index.js): `server/src/tutor/index.js`
- [SQLite database](https://github.com/juanpablonie77-droid/derma-sim/blob/feature/prototipo-inicial/server/src/db.js): `server/src/db.js`

### Other components

- **Student**
- **Clinical reviewer**

## Connections

- Student → Vue application: uses (evidence: `README.md`)
- Clinical reviewer → Vue application: uses (evidence: `README.md`)
- Vue application → App shell: mounts (evidence: `client/src/main.js`)
- Vue application → Login and registration: routes to (evidence: `client/src/main.js`)
- Vue application → Case listing: routes to (evidence: `client/src/main.js`)
- Vue application → Case viewer: routes to (evidence: `client/src/main.js`)
- Vue application → Decision form: routes to (evidence: `client/src/main.js`)
- Vue application → Evaluation result: routes to (evidence: `client/src/main.js`)
- App shell → Auth store: uses (evidence: `client/src/App.vue`)
- Login and registration → Auth store: uses (evidence: `client/src/views/Login.vue`)
- Auth store → API client: calls (evidence: `client/src/stores.js`)
- Case listing → API client: calls (evidence: `client/src/views/Casos.vue`)
- Case viewer → API client: calls (evidence: `client/src/views/Visor.vue`)
- Decision form → API client: calls (evidence: `client/src/views/Decision.vue`)
- Evaluation result → API client: calls (evidence: `client/src/views/Resultado.vue`)
- Case listing → Workflow steps: renders (evidence: `client/src/views/Casos.vue`)
- Decision form → Workflow steps: renders (evidence: `client/src/views/Decision.vue`)
- Evaluation result → Workflow steps: renders (evidence: `client/src/views/Resultado.vue`)
- API client → HTTP routes: requests API (evidence: `README.md`)
- HTTP routes → Access middleware: applies (evidence: `server/src/routes.js`)
- HTTP routes → Domain errors: raises (evidence: `server/src/routes.js`)
- HTTP routes → Case catalog and review: dispatches (evidence: `server/src/routes.js`)
- HTTP routes → Session and evaluation: dispatches (evidence: `server/src/routes.js`)
- HTTP routes → SQLite database: reads and writes (evidence: `server/src/routes.js`)
- HTTP routes → AI tutor adapter: creates (evidence: `server/src/routes.js`)
- Case catalog and review → SQLite database: reads and writes (evidence: `server/src/services/CasoService.js`)
- Case catalog and review → Domain errors: raises (evidence: `server/src/services/CasoService.js`)
- Session and evaluation → SQLite database: reads and writes (evidence: `server/src/services/SesionService.js`)
- Session and evaluation → Session transitions: validates transitions (evidence: `server/src/services/SesionService.js`)
- Session and evaluation → Domain errors: raises (evidence: `server/src/services/SesionService.js`)
- Session and evaluation → AI tutor adapter: evaluates with (evidence: `server/src/services/SesionService.js`)
- AI tutor adapter → Domain errors: raises (evidence: `server/src/tutor/index.js`)
