# josesanchez90/proyecto-padomi-ninos-v2 architecture

> Architecture diagram of the GitHub repository josesanchez90/proyecto-padomi-ninos-v2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josesanchez90/proyecto-padomi-ninos-v2
- Repository: https://github.com/josesanchez90/proyecto-padomi-ninos-v2

## Overview

This repository is a TypeScript Next.js frontend, built with the App Router and centered around a single app shell rather than a large multi-route backend system.

1. The top-level entry point is the Next.js app layer in `app/`
   - `app/layout.tsx` defines the global shell for the entire site.
   - `app/page.tsx` is the main screen entry point.
   - `app/globals.css` provides app-wide styling.
   - The README confirms this is a standard `create-next-app` project using `next/font` with Geist.

2. The UI is organized as a dashboard-style application
   - The presence of `components/header.tsx`, `components/sidebar.tsx`, and `components/login.tsx` suggests a shell with authentication-facing UI plus persistent navigation.
   - The app likely renders one primary frame and swaps content modules inside it, rather than relying on many filesystem routes.

3. Business functionality is split into standalone view modules
   - `components/views/` contains the domain screens:
     - `dashboard.tsx`
     - `indicadores.tsx`
     - `graficos.tsx`
     - `expedientes.tsx`
     - `lista-pacientes.tsx`
     - `registrar-paciente.tsx`
     - `gestion-personal.tsx`
   - These look like feature panels for a healthcare/admin system, with Spanish naming indicating patient, records, indicators, charts, and staff management.
   - For an architecture diagram, these are the main “feature layer” nodes.

4. There is a shared component library for reusable UI primitives
   - `components/ui/` is a broad shadcn-style design system layer.
   - It contains low-level controls like buttons, inputs, dialogs, dropdowns, tabs, tables, toasts, sheets, and more.
   - This layer is a foundation used by the higher-level shell and feature views.

5. The repository includes explicit theming support
   - `components/theme-provider.tsx` and `components/theme-initializer.tsx` indicate theme state is handled centrally.
   - This likely wraps the app and initializes dark/light theme behavior on the client.
   - Theme management is part of the presentation shell, not the business logic.

6. Mock or local data appears to drive the current UI
   - `lib/sample-data.ts` strongly suggests the dashboard screens are populated from in-repo mock data.
   - There is no evidence in the tree of API routes, server actions, database clients, or external data services.
   - Architecturally, this is important: the current app is frontend-only and data-backed by static/local fixtures.

7. Shared app logic is kept in `lib/`
   - `lib/utils.ts` likely contains utility helpers used across components.
   - `lib/constants.ts` probably holds navigation labels, app metadata, or UI constants.
   - `lib/fonts.ts` centralizes font setup.
   - This is the small cross-cutting layer below UI components.

8. Hooks encapsulate client-side behavior
   - `hooks/use-mobile.ts` and `hooks/use-toast.ts` provide reusable state/behavior.
   - Similar hooks also exist under `components/ui/`, which is consistent with shadcn-generated patterns.
   - These support responsive behavior and transient notifications in the UI layer.

9. Notifications and overlays are built into the component stack
   - `components/ui/toaster.tsx`, `components/ui/sonner.tsx`, and related toast hook files show the app supports user feedback with toast notifications.
   - Dialog, sheet, popover, drawer, and tooltip components imply interactions are largely handled on the client.

10. Charts and data visualization are first-class concerns
   - `components/ui/chart.tsx` and the `graficos.tsx` view indicate reporting/analytics functionality.
   - Combined with `indicadores.tsx`, this suggests the app is not just CRUD; it also presents operational metrics.

11. The app is mobile-aware
   - `hooks/use-mobile.ts` and `components/ui/use-mobile.tsx` point to responsive UI adaptations.
   - The sidebar/sheet/resizable components reinforce a layout designed to work across viewport sizes.

12. Styling and build pipeline are standard Next.js/Tailwind-oriented
   - `postcss.config.mjs`, `tsconfig.json`, `next.config.ts`, and `components.json` suggest a modern component-driven frontend setup.
   - The project appears to rely on utility CSS plus component primitives rather than a custom CSS architecture.

13. Static assets are minimal and localized
   - `public/Logo/` is the only visible asset folder.
   - That reinforces the idea that the project is primarily a UI shell with branded assets, not a media-heavy application.

14. Overall data flow
   - `app/page.tsx` composes the page.
   - The layout/theme wrappers establish global appearance.
   - The shell components (`header`, `sidebar`, `login`) provide navigation and session-facing UI.
   - Feature views render the domain screens.
   - Shared UI primitives, hooks, and `lib/sample-data.ts` supply reusable presentation and local data.
   - There is no visible backend boundary in this repo snapshot, so all behavior appears to terminate in the frontend.

15. Best architecture-diagram takeaway
   - Model this as a single Next.js frontend with four layers: app shell, reusable UI system, domain views, and local data/utilities.
   - The key boundary is between the presentation shell and the mocked/domain data layer; no external service boundary is evident from the repository structure alone.

Main entry points: [`app/page.tsx`](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/page.tsx) (Main page), [`components/ui`](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/components/ui) (UI system), [`lib/sample-data.ts`](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/lib/sample-data.ts) (Sample data), [`app/layout.tsx`](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/layout.tsx) (Root layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["App shell"]
  node_node_app_layout["Root layout<br/>next app layout<br/>[layout.tsx]"]
  node_node_app_page["Main page<br/>next entry page<br/>[page.tsx]"]
  node_node_app_css["Global styles<br/>app stylesheet<br/>[globals.css]"]
end

subgraph group_group_shell["Shell components"]
  node_node_header["Header<br/>[header.tsx]"]
  node_node_sidebar["Sidebar<br/>shell navigation<br/>[sidebar.tsx]"]
  node_node_login["Login<br/>auth ui<br/>[login.tsx]"]
  node_node_theme_provider["Theme provider<br/>theme wrapper<br/>[theme-provider.tsx]"]
  node_node_theme_init["Theme init<br/>theme bootstrap"]
end

subgraph group_group_views["Feature views"]
  node_node_dashboard["Dashboard<br/>feature view<br/>[dashboard.tsx]"]
  node_node_indicadores["Indicadores<br/>feature view<br/>[indicadores.tsx]"]
  node_node_graficos["Gráficos<br/>feature view<br/>[graficos.tsx]"]
  node_node_expedientes["Expedientes<br/>feature view<br/>[expedientes.tsx]"]
  node_node_pacientes["Pacientes<br/>feature view"]
  node_node_registrar["Registrar<br/>feature view"]
  node_node_personal["Personal<br/>feature view"]
end

subgraph group_group_ui["UI primitives"]
  node_node_ui_primitives["UI system<br/>component library"]
  node_node_chart_ui["Charts UI<br/>visualization primitive<br/>[chart.tsx]"]
  node_node_toasts["Toasts<br/>feedback layer<br/>[toaster.tsx]"]
end

subgraph group_group_shared["Shared logic"]
  node_node_hooks["Hooks"]
  node_node_sample_data["Sample data<br/>local fixtures<br/>[sample-data.ts]"]
  node_node_lib["Lib utils<br/>shared helpers"]
end

node_node_app_layout -->|"wraps"| node_node_theme_provider
node_node_app_layout -->|"initializes"| node_node_theme_init
node_node_app_layout -->|"loads"| node_node_app_css
node_node_app_layout -->|"hosts"| node_node_app_page
node_node_app_page -->|"composes"| node_node_header
node_node_app_page -->|"composes"| node_node_sidebar
node_node_app_page -->|"routes to"| node_node_login
node_node_app_page -->|"shows"| node_node_dashboard
node_node_app_page -->|"shows"| node_node_indicadores
node_node_app_page -->|"shows"| node_node_graficos
node_node_app_page -->|"shows"| node_node_expedientes
node_node_app_page -->|"shows"| node_node_pacientes
node_node_app_page -->|"shows"| node_node_registrar
node_node_app_page -->|"shows"| node_node_personal
node_node_header -->|"uses"| node_node_ui_primitives
node_node_sidebar -->|"uses"| node_node_ui_primitives
node_node_login -->|"uses"| node_node_ui_primitives
node_node_dashboard -->|"reads"| node_node_sample_data
node_node_indicadores -->|"reads"| node_node_sample_data
node_node_graficos -->|"renders with"| node_node_chart_ui
node_node_graficos -->|"reads"| node_node_sample_data
node_node_expedientes -->|"reads"| node_node_sample_data
node_node_pacientes -->|"reads"| node_node_sample_data
node_node_registrar -->|"uses"| node_node_ui_primitives
node_node_personal -->|"uses"| node_node_ui_primitives
node_node_toasts -->|"supported by"| node_node_hooks
node_node_ui_primitives -->|"uses"| node_node_hooks
node_node_lib -->|"supports"| node_node_ui_primitives
node_node_lib -->|"contains"| node_node_sample_data

click node_node_app_layout "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/layout.tsx"
click node_node_app_page "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/page.tsx"
click node_node_app_css "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/globals.css"
click node_node_header "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/header.tsx"
click node_node_sidebar "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/sidebar.tsx"
click node_node_login "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/login.tsx"
click node_node_theme_provider "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/theme-provider.tsx"
click node_node_theme_init "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/theme-initializer.tsx"
click node_node_dashboard "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/dashboard.tsx"
click node_node_indicadores "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/indicadores.tsx"
click node_node_graficos "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/graficos.tsx"
click node_node_expedientes "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/expedientes.tsx"
click node_node_pacientes "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/lista-pacientes.tsx"
click node_node_registrar "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/registrar-paciente.tsx"
click node_node_personal "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/gestion-personal.tsx"
click node_node_ui_primitives "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/components/ui"
click node_node_chart_ui "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/ui/chart.tsx"
click node_node_toasts "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/ui/toaster.tsx"
click node_node_hooks "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/hooks"
click node_node_sample_data "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/lib/sample-data.ts"
click node_node_lib "https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/lib"

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_node_app_layout,node_node_app_page,node_node_app_css toneBlue
class node_node_header,node_node_sidebar,node_node_login,node_node_theme_provider,node_node_theme_init toneAmber
class node_node_dashboard,node_node_indicadores,node_node_graficos,node_node_expedientes,node_node_pacientes,node_node_registrar,node_node_personal toneMint
class node_node_ui_primitives,node_node_chart_ui,node_node_toasts toneRose
class node_node_hooks,node_node_sample_data,node_node_lib toneIndigo
```

## Components

### App shell

Next.js App Router entrypoint and global presentation shell.

- [Root layout](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/layout.tsx): next app layout · Global site shell and app-wide providers. · `app/layout.tsx`
- [Main page](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/page.tsx): next entry page · Primary screen composition for the application. · `app/page.tsx`
- [Global styles](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/app/globals.css): app stylesheet · Application-wide CSS baseline. · `app/globals.css`

### Shell components

Persistent layout, navigation, auth-facing UI, and theming.

- [Header](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/header.tsx): shell header · Top-level navigation and page chrome. · `components/header.tsx`
- [Sidebar](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/sidebar.tsx): shell navigation · Persistent navigation and dashboard framing. · `components/sidebar.tsx`
- [Login](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/login.tsx): auth ui · Authentication-facing entry UI. · `components/login.tsx`
- [Theme provider](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/theme-provider.tsx): theme wrapper · Central theme context for light/dark presentation. · `components/theme-provider.tsx`
- [Theme init](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/theme-initializer.tsx): theme bootstrap · Client-side theme initialization. · `components/theme-initializer.tsx`

### Feature views

Domain screens rendered inside the shell.

- [Dashboard](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/dashboard.tsx): feature view · Overview screen for operational status. · `components/views/dashboard.tsx`
- [Indicadores](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/indicadores.tsx): feature view · Metrics and indicators screen. · `components/views/indicadores.tsx`
- [Gráficos](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/graficos.tsx): feature view · Charts and reporting screen. · `components/views/graficos.tsx`
- [Expedientes](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/expedientes.tsx): feature view · Records and case management screen. · `components/views/expedientes.tsx`
- [Pacientes](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/lista-pacientes.tsx): feature view · Patient listing and management screen. · `components/views/lista-pacientes.tsx`
- [Registrar](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/registrar-paciente.tsx): feature view · Patient registration screen. · `components/views/registrar-paciente.tsx`
- [Personal](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/views/gestion-personal.tsx): feature view · Staff management screen. · `components/views/gestion-personal.tsx`

### UI primitives

Reusable component system and interaction primitives.

- [UI system](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/components/ui): component library · Reusable shadcn-style primitives used across the app. · `components/ui`
- [Charts UI](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/ui/chart.tsx): visualization primitive · Shared charting helpers for analytics views. · `components/ui/chart.tsx`
- [Toasts](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/components/ui/toaster.tsx): feedback layer · Toast and sonner notification stack. · `components/ui/toaster.tsx`

### Shared logic

Cross-cutting utilities, data fixtures, and hooks.

- [Hooks](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/hooks): client hooks · Reusable client-side behavior and responsive helpers. · `hooks`
- [Sample data](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/blob/master/lib/sample-data.ts): local fixtures · In-repo data backing the current UI. · `lib/sample-data.ts`
- [Lib utils](https://github.com/josesanchez90/proyecto-padomi-ninos-v2/tree/master/lib): shared helpers · Common utilities, constants, and font setup. · `lib`

## Connections

- Root layout → Theme provider: wraps · The root layout applies the theme context.
- Root layout → Theme init: initializes · The layout bootstraps client-side theme state.
- Root layout → Global styles: loads · Global stylesheet is applied at the app boundary.
- Root layout → Main page: hosts · The root layout contains the primary page.
- Main page → Header: composes · Page shell includes the header.
- Main page → Sidebar: composes · Page shell includes the sidebar navigation.
- Main page → Login: routes to · Login is part of the main app experience.
- Main page → Dashboard: shows · Dashboard is the primary default view.
- Main page → Indicadores: shows · Metrics view is one of the main screens.
- Main page → Gráficos: shows · Analytics and charts are rendered as a feature view.
- Main page → Expedientes: shows · Records management is available as a view.
- Main page → Pacientes: shows · Patient list is a major domain view.
- Main page → Registrar: shows · Patient registration is a dedicated screen.
- Main page → Personal: shows · Staff management is a dedicated screen.
- Header → UI system: uses · Header is built from shared UI controls.
- Sidebar → UI system: uses · Sidebar relies on reusable primitives.
- Login → UI system: uses · Login form is composed from UI primitives.
- Dashboard → Sample data: reads · Dashboard content is driven by local fixtures.
- Indicadores → Sample data: reads · Indicators view uses mock/local data.
- Gráficos → Charts UI: renders with · Charts view depends on shared charting helpers.
- Gráficos → Sample data: reads · Charts are populated from local data.
- Expedientes → Sample data: reads · Records screen is backed by sample data.
- Pacientes → Sample data: reads · Patient list is backed by sample data.
- Registrar → UI system: uses · Registration form uses shared inputs and controls.
- Personal → UI system: uses · Staff management screen uses shared controls.
- Toasts → Hooks: supported by · Toast feedback is surfaced through reusable hooks.
- UI system → Hooks: uses · UI primitives include responsive and toast behavior.
- Lib utils → UI system: supports · Shared utilities and fonts underpin the UI system.
- Lib utils → Sample data: contains · Local data fixtures live in the shared library layer.
