# zvyx/20adq architecture

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

- Interactive diagram: https://gitdiagram.com/zvyx/20adq
- Repository: https://github.com/zvyx/20adq

## Overview

CRM Adquisiciones is a procurement CRM whose implemented workflow presents a dashboard of acquisition metrics and recent orders, with an entry point for creating a request. The dashboard fetches metrics and orders through API routes; service modules query or write through Prisma. Provider listing is also exposed by an API route. The README additionally identifies suppliers, purchase orders, and contracts as product domains, but describes the backend as unfinished. The graph follows shown calls and imports; the new-request page’s submission behavior and unsampled contract handling are not established by the excerpts.

Main entry points: [`src/app/page.tsx`](https://github.com/zvyx/20adq/blob/main/src/app/page.tsx) (Dashboard page), [`src/lib/db.ts`](https://github.com/zvyx/20adq/blob/main/src/lib/db.ts) (Prisma client), [`src/app/solicitud/nueva/page.tsx`](https://github.com/zvyx/20adq/blob/main/src/app/solicitud/nueva/page.tsx) (New request page), [`src/app/layout.tsx`](https://github.com/zvyx/20adq/blob/main/src/app/layout.tsx) (App layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Application experience"]
  node_dashboard["Dashboard page<br/>[page.tsx]"]
  node_request_form["New request page<br/>[page.tsx]"]
  node_app_shell["App layout<br/>[layout.tsx]"]
  node_sidebar["Sidebar<br/>[Sidebar.tsx]"]
  node_topbar["Topbar<br/>[Topbar.tsx]"]
  node_button["Button<br/>[Button.tsx]"]
  node_data_table["Data table<br/>[DataTable.tsx]"]
  node_metric_card["Metric card<br/>[MetricCard.tsx]"]
  node_input["Input<br/>[Input.tsx]"]
end

subgraph group_procurement["Procurement API"]
  node_orders_api["Orders API<br/>[route.ts]"]
  node_dashboard_api["Dashboard API<br/>[route.ts]"]
  node_providers_api["Providers API<br/>[route.ts]"]
end

subgraph group_services["Data services"]
  node_order_service["Order service<br/>[orderService.ts]"]
  node_dashboard_service["Dashboard service"]
  node_provider_service["Provider service<br/>[providerService.ts]"]
end

subgraph group_data["Persistence"]
  node_prisma_client["Prisma client<br/>[db.ts]"]
  node_database[("SQLite database<br/>[dev.db]")]
  node_procurement_schema["Procurement schema<br/>[schema.prisma]"]
end

node_user(("CRM user"))

node_app_shell -->|"renders"| node_sidebar
node_app_shell -->|"renders"| node_topbar
node_dashboard -->|"renders"| node_button
node_dashboard -->|"renders"| node_metric_card
node_dashboard -->|"renders"| node_data_table
node_request_form -->|"renders"| node_button
node_request_form -->|"renders"| node_input
node_dashboard -->|"fetches metrics"| node_dashboard_api
node_dashboard -->|"fetches orders"| node_orders_api
node_orders_api -->|"calls"| node_order_service
node_dashboard_api -->|"calls"| node_dashboard_service
node_providers_api -->|"calls"| node_provider_service
node_order_service -->|"queries and writes"| node_prisma_client
node_dashboard_service -->|"queries"| node_prisma_client
node_provider_service -->|"queries"| node_prisma_client
node_user -.->|"views"| node_dashboard
node_prisma_client -.->|"accesses"| node_database
node_procurement_schema -.->|"defines data"| node_database

click node_dashboard "https://github.com/zvyx/20adq/blob/main/src/app/page.tsx"
click node_request_form "https://github.com/zvyx/20adq/blob/main/src/app/solicitud/nueva/page.tsx"
click node_app_shell "https://github.com/zvyx/20adq/blob/main/src/app/layout.tsx"
click node_sidebar "https://github.com/zvyx/20adq/blob/main/src/components/layout/Sidebar.tsx"
click node_topbar "https://github.com/zvyx/20adq/blob/main/src/components/layout/Topbar.tsx"
click node_button "https://github.com/zvyx/20adq/blob/main/src/components/ui/Button.tsx"
click node_data_table "https://github.com/zvyx/20adq/blob/main/src/components/ui/DataTable.tsx"
click node_metric_card "https://github.com/zvyx/20adq/blob/main/src/components/ui/MetricCard.tsx"
click node_input "https://github.com/zvyx/20adq/blob/main/src/components/ui/Input.tsx"
click node_orders_api "https://github.com/zvyx/20adq/blob/main/src/app/api/orders/route.ts"
click node_dashboard_api "https://github.com/zvyx/20adq/blob/main/src/app/api/dashboard/route.ts"
click node_providers_api "https://github.com/zvyx/20adq/blob/main/src/app/api/providers/route.ts"
click node_order_service "https://github.com/zvyx/20adq/blob/main/src/services/orderService.ts"
click node_dashboard_service "https://github.com/zvyx/20adq/blob/main/src/services/dashboardService.ts"
click node_provider_service "https://github.com/zvyx/20adq/blob/main/src/services/providerService.ts"
click node_prisma_client "https://github.com/zvyx/20adq/blob/main/src/lib/db.ts"
click node_database "https://github.com/zvyx/20adq/blob/main/prisma/dev.db"
click node_procurement_schema "https://github.com/zvyx/20adq/blob/main/prisma/schema.prisma"

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_dashboard,node_request_form,node_app_shell,node_sidebar,node_topbar,node_button,node_data_table,node_metric_card,node_input,node_user toneBlue
class node_orders_api,node_dashboard_api,node_providers_api toneAmber
class node_order_service,node_dashboard_service,node_provider_service toneMint
class node_prisma_client,node_database,node_procurement_schema toneRose
```

## Components

### Application experience

- [Dashboard page](https://github.com/zvyx/20adq/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [New request page](https://github.com/zvyx/20adq/blob/main/src/app/solicitud/nueva/page.tsx): `src/app/solicitud/nueva/page.tsx`
- [App layout](https://github.com/zvyx/20adq/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Sidebar](https://github.com/zvyx/20adq/blob/main/src/components/layout/Sidebar.tsx): `src/components/layout/Sidebar.tsx`
- [Topbar](https://github.com/zvyx/20adq/blob/main/src/components/layout/Topbar.tsx): `src/components/layout/Topbar.tsx`
- [Button](https://github.com/zvyx/20adq/blob/main/src/components/ui/Button.tsx): `src/components/ui/Button.tsx`
- [Data table](https://github.com/zvyx/20adq/blob/main/src/components/ui/DataTable.tsx): `src/components/ui/DataTable.tsx`
- [Metric card](https://github.com/zvyx/20adq/blob/main/src/components/ui/MetricCard.tsx): `src/components/ui/MetricCard.tsx`
- [Input](https://github.com/zvyx/20adq/blob/main/src/components/ui/Input.tsx): `src/components/ui/Input.tsx`

### Procurement API

- [Orders API](https://github.com/zvyx/20adq/blob/main/src/app/api/orders/route.ts): `src/app/api/orders/route.ts`
- [Dashboard API](https://github.com/zvyx/20adq/blob/main/src/app/api/dashboard/route.ts): `src/app/api/dashboard/route.ts`
- [Providers API](https://github.com/zvyx/20adq/blob/main/src/app/api/providers/route.ts): `src/app/api/providers/route.ts`

### Data services

- [Order service](https://github.com/zvyx/20adq/blob/main/src/services/orderService.ts): `src/services/orderService.ts`
- [Dashboard service](https://github.com/zvyx/20adq/blob/main/src/services/dashboardService.ts): `src/services/dashboardService.ts`
- [Provider service](https://github.com/zvyx/20adq/blob/main/src/services/providerService.ts): `src/services/providerService.ts`

### Persistence

- [Prisma client](https://github.com/zvyx/20adq/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [SQLite database](https://github.com/zvyx/20adq/blob/main/prisma/dev.db): `prisma/dev.db`
- [Procurement schema](https://github.com/zvyx/20adq/blob/main/prisma/schema.prisma): `prisma/schema.prisma`

### Other components

- **CRM user**

## Connections

- App layout → Sidebar: renders (evidence: `src/app/layout.tsx`)
- App layout → Topbar: renders (evidence: `src/app/layout.tsx`)
- Dashboard page → Button: renders (evidence: `src/app/page.tsx`)
- Dashboard page → Metric card: renders (evidence: `src/app/page.tsx`)
- Dashboard page → Data table: renders (evidence: `src/app/page.tsx`)
- New request page → Button: renders (evidence: `src/app/solicitud/nueva/page.tsx`)
- New request page → Input: renders (evidence: `src/app/solicitud/nueva/page.tsx`)
- Dashboard page → Dashboard API: fetches metrics (evidence: `src/app/page.tsx`)
- Dashboard page → Orders API: fetches orders (evidence: `src/app/page.tsx`)
- Orders API → Order service: calls (evidence: `src/app/api/orders/route.ts`)
- Dashboard API → Dashboard service: calls (evidence: `src/app/api/dashboard/route.ts`)
- Providers API → Provider service: calls (evidence: `src/app/api/providers/route.ts`)
- Order service → Prisma client: queries and writes (evidence: `src/services/orderService.ts`)
- Dashboard service → Prisma client: queries (evidence: `src/services/dashboardService.ts`)
- Provider service → Prisma client: queries (evidence: `src/services/providerService.ts`)
- CRM user → Dashboard page: views
- Prisma client → SQLite database: accesses
- Procurement schema → SQLite database: defines data
