# mauryadevesh/crea-horarios architecture

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

- Interactive diagram: https://gitdiagram.com/mauryadevesh/crea-horarios
- Repository: https://github.com/mauryadevesh/crea-horarios

## Overview

Weekly Timetable Maker lets users manage subjects and faculty, schedule weekly room/time slots, detect clashes, and view the result in responsive and matrix forms. Its principal flow runs from the timetable UI through shared context state to browser-local JSON persistence; account actions use the same persistence layer, with import/export and reset also available. The graph follows relationships shown in excerpts and README; unsampled component behavior is represented only where documented, without inferred call edges.

Main entry points: [`src/components/TimetableSetup.tsx`](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/TimetableSetup.tsx) (Timetable editor), [`src/lib/conflicts.ts`](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/conflicts.ts) (Conflict engine), [`src/App.tsx`](https://github.com/mauryadevesh/crea-horarios/blob/main/src/App.tsx) (Application shell), [`src/lib/storage.ts`](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/storage.ts) (Persistent state hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Planner experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_setup["Timetable editor<br/>[TimetableSetup.tsx]"]
  node_slotmodal["Slot editor<br/>[AddSlotModal.tsx]"]
  node_scheduleview["Schedule matrix"]
  node_conflictbanner["Clash notices"]
  node_feedback["Feedback form<br/>[FeedbackForm.tsx]"]
  node_errorboundary["Error boundary<br/>[ErrorBoundary.tsx]"]
end

subgraph group_scheduling["Scheduling domain"]
  node_conflicts["Conflict engine<br/>[conflicts.ts]"]
  node_seed["Default timetable<br/>[seed.ts]"]
  node_types["Timetable model<br/>[types.ts]"]
end

subgraph group_state["State and persistence"]
  node_provider["Timetable context"]
  node_persistentstate["Persistent state hook<br/>[storage.ts]"]
  node_jsondb[("Timetable JSON store<br/>[jsonDatabase.ts]")]
end

subgraph group_accounts["Local accounts"]
  node_authui["Account controls<br/>[AccountAuth.tsx]"]
  node_authdb[("Account JSON store")]
end

node_user(("Planner user"))

node_user -->|"uses planner"| node_app
node_app -->|"provides state"| node_provider
node_app -->|"renders"| node_setup
node_app -->|"renders"| node_authui
node_app -->|"renders"| node_feedback
node_setup -->|"reads and updates"| node_provider
node_setup -->|"opens and saves"| node_slotmodal
node_setup -->|"checks clashes"| node_conflicts
node_setup -->|"shows clashes"| node_conflictbanner
node_setup -.->|"renders matrix"| node_scheduleview
node_slotmodal -->|"validates slots"| node_conflicts
node_scheduleview -->|"checks clashes"| node_conflicts
node_conflictbanner -->|"formats clashes"| node_conflicts
node_provider -->|"uses hook"| node_persistentstate
node_persistentstate -->|"loads and saves"| node_jsondb
node_persistentstate -->|"manages accounts"| node_authdb
node_persistentstate -->|"resets to"| node_seed
node_authui -->|"uses account state"| node_provider
node_jsondb -->|"falls back to"| node_seed
node_jsondb -->|"derives slots"| node_conflicts
node_authdb -->|"defaults account data"| node_seed
node_authdb -->|"derives slots"| node_conflicts
node_seed -->|"derives default slots"| node_conflicts

click node_app "https://github.com/mauryadevesh/crea-horarios/blob/main/src/App.tsx"
click node_setup "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/TimetableSetup.tsx"
click node_slotmodal "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/AddSlotModal.tsx"
click node_scheduleview "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/ScheduleGridView.tsx"
click node_conflictbanner "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/SlotConflictBanner.tsx"
click node_feedback "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/FeedbackForm.tsx"
click node_errorboundary "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/ErrorBoundary.tsx"
click node_conflicts "https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/conflicts.ts"
click node_seed "https://github.com/mauryadevesh/crea-horarios/blob/main/src/data/seed.ts"
click node_types "https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/types.ts"
click node_provider "https://github.com/mauryadevesh/crea-horarios/blob/main/src/context/TimetableContext.tsx"
click node_persistentstate "https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/storage.ts"
click node_jsondb "https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/jsonDatabase.ts"
click node_authui "https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/AccountAuth.tsx"
click node_authdb "https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/jsonAuthDatabase.ts"

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_setup,node_slotmodal,node_scheduleview,node_conflictbanner,node_feedback,node_errorboundary,node_user toneBlue
class node_conflicts,node_seed,node_types toneAmber
class node_provider,node_persistentstate,node_jsondb toneMint
class node_authui,node_authdb toneRose
```

## Components

### Planner experience

- [Application shell](https://github.com/mauryadevesh/crea-horarios/blob/main/src/App.tsx): `src/App.tsx`
- [Timetable editor](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/TimetableSetup.tsx): `src/components/TimetableSetup.tsx`
- [Slot editor](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/AddSlotModal.tsx): `src/components/AddSlotModal.tsx`
- [Schedule matrix](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/ScheduleGridView.tsx): `src/components/ScheduleGridView.tsx`
- [Clash notices](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/SlotConflictBanner.tsx): `src/components/SlotConflictBanner.tsx`
- [Feedback form](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/FeedbackForm.tsx): `src/components/FeedbackForm.tsx`
- [Error boundary](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/ErrorBoundary.tsx): `src/components/ErrorBoundary.tsx`

### Scheduling domain

- [Conflict engine](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/conflicts.ts): `src/lib/conflicts.ts`
- [Default timetable](https://github.com/mauryadevesh/crea-horarios/blob/main/src/data/seed.ts): `src/data/seed.ts`
- [Timetable model](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/types.ts): `src/lib/types.ts`

### State and persistence

- [Timetable context](https://github.com/mauryadevesh/crea-horarios/blob/main/src/context/TimetableContext.tsx): `src/context/TimetableContext.tsx`
- [Persistent state hook](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Timetable JSON store](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/jsonDatabase.ts): `src/lib/jsonDatabase.ts`

### Local accounts

- [Account controls](https://github.com/mauryadevesh/crea-horarios/blob/main/src/components/AccountAuth.tsx): `src/components/AccountAuth.tsx`
- [Account JSON store](https://github.com/mauryadevesh/crea-horarios/blob/main/src/lib/jsonAuthDatabase.ts): `src/lib/jsonAuthDatabase.ts`

### Other components

- **Planner user**

## Connections

- Planner user → Application shell: uses planner (evidence: `README.md`)
- Application shell → Timetable context: provides state (evidence: `src/App.tsx`)
- Application shell → Timetable editor: renders (evidence: `src/App.tsx`)
- Application shell → Account controls: renders (evidence: `src/App.tsx`)
- Application shell → Feedback form: renders (evidence: `src/App.tsx`)
- Timetable editor → Timetable context: reads and updates (evidence: `src/components/TimetableSetup.tsx`)
- Timetable editor → Slot editor: opens and saves (evidence: `src/components/TimetableSetup.tsx`)
- Timetable editor → Conflict engine: checks clashes (evidence: `src/components/TimetableSetup.tsx`)
- Timetable editor → Clash notices: shows clashes (evidence: `src/components/TimetableSetup.tsx`)
- Timetable editor → Schedule matrix: renders matrix (evidence: `src/components/TimetableSetup.tsx`)
- Slot editor → Conflict engine: validates slots (evidence: `src/components/AddSlotModal.tsx`)
- Schedule matrix → Conflict engine: checks clashes (evidence: `src/components/ScheduleGridView.tsx`)
- Clash notices → Conflict engine: formats clashes (evidence: `src/components/SlotConflictBanner.tsx`)
- Timetable context → Persistent state hook: uses hook (evidence: `src/context/TimetableContext.tsx`)
- Persistent state hook → Timetable JSON store: loads and saves (evidence: `src/lib/storage.ts`)
- Persistent state hook → Account JSON store: manages accounts (evidence: `src/lib/storage.ts`)
- Persistent state hook → Default timetable: resets to (evidence: `src/lib/storage.ts`)
- Account controls → Timetable context: uses account state (evidence: `src/components/AccountAuth.tsx`)
- Timetable JSON store → Default timetable: falls back to (evidence: `src/lib/jsonDatabase.ts`)
- Timetable JSON store → Conflict engine: derives slots (evidence: `src/lib/jsonDatabase.ts`)
- Account JSON store → Default timetable: defaults account data (evidence: `src/lib/jsonAuthDatabase.ts`)
- Account JSON store → Conflict engine: derives slots (evidence: `src/lib/jsonAuthDatabase.ts`)
- Default timetable → Conflict engine: derives default slots (evidence: `src/data/seed.ts`)
