# sebasttiant/swdrogueriaespecifica architecture

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

- Interactive diagram: https://gitdiagram.com/sebasttiant/swdrogueriaespecifica
- Repository: https://github.com/sebasttiant/swdrogueriaespecifica

## Overview

Específica GO is a mobile-first web system for operating a pharmacy. Staff sign in, then use dashboard modules to manage products and stock, record incoming inventory, handle customer orders and shortages, and review operational reports and audit history. The documented server-side pattern is action → service → repository, backed by PostgreSQL. The graph preserves the README’s principal capabilities; most feature internals were not sampled, so detailed links are limited to documented architecture and the excerpts shown.

Main entry points: [`apps/web/app/(auth)/login/page.tsx`](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(auth)/login/page.tsx) (Login), [`apps/web/server/actions/auth.actions.ts`](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/actions/auth.actions.ts) (Auth actions), [`apps/web/server/services/auth.service.ts`](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/auth.service.ts) (Auth service), [`apps/web/app/(dashboard)/productos/page.tsx`](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/productos/page.tsx) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_login["Login<br/>[page.tsx]"]
  node_auth_action["Auth actions<br/>[auth.actions.ts]"]
  node_auth_service["Auth service<br/>[auth.service.ts]"]
  node_users_repo["User repository<br/>[user.repository.ts]"]
  node_app_shell["App shell<br/>[app-shell.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
end

subgraph group_catalog["Catalog and inventory"]
  node_products["Product catalog<br/>[page.tsx]"]
  node_product_service["Product services<br/>[product.service.ts]"]
  node_batches_expiry["Batches and expiry"]
  node_entries["Inventory entries<br/>[page.tsx]"]
  node_entry_service["Entry service"]
  node_inventory_store[("Inventory repositories")]
end

subgraph group_orders["Orders and shortages"]
  node_pending["Customer orders<br/>[page.tsx]"]
  node_pending_service["Pending service<br/>[pending.service.ts]"]
  node_pending_repo[("Pending repository")]
  node_missing["Shortages<br/>[page.tsx]"]
  node_missing_service["Shortage services"]
end

subgraph group_oversight["Administration and oversight"]
  node_admin["User administration<br/>[page.tsx]"]
  node_audit["Audit history<br/>[page.tsx]"]
  node_reports["Reports<br/>[page.tsx]"]
  node_report_service["Report services<br/>[reports.service.ts]"]
end

node_staff(("Pharmacy staff"))

node_staff -->|"signs in"| node_login
node_login -->|"submits credentials"| node_auth_action
node_auth_action -->|"verifies credentials"| node_auth_service
node_auth_service -->|"looks up user"| node_users_repo
node_staff -->|"uses"| node_app_shell
node_staff -->|"opens"| node_dashboard
node_staff -->|"manages products"| node_products
node_products -.->|"uses product services"| node_product_service
node_staff -->|"reviews expiry"| node_batches_expiry
node_staff -->|"records arrivals"| node_entries
node_entries -.->|"registers entry"| node_entry_service
node_entry_service -.->|"persists inventory"| node_inventory_store
node_staff -->|"manages orders"| node_pending
node_pending -.->|"uses order services"| node_pending_service
node_pending_service -->|"reads and writes"| node_pending_repo
node_staff -->|"reviews shortages"| node_missing
node_missing -->|"exports shortages"| node_missing_service
node_staff -->|"administers users"| node_admin
node_staff -->|"reviews activity"| node_audit
node_staff -->|"views reports"| node_reports
node_reports -->|"requests analytics"| node_report_service

click node_login "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(auth)/login/page.tsx"
click node_auth_action "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/actions/auth.actions.ts"
click node_auth_service "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/auth.service.ts"
click node_users_repo "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/repositories/user.repository.ts"
click node_app_shell "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/_components/app-shell/app-shell.tsx"
click node_dashboard "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/dashboard/page.tsx"
click node_products "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/productos/page.tsx"
click node_product_service "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/product.service.ts"
click node_batches_expiry "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/features/vencimientos/expiring-batch-list.tsx"
click node_entries "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/entradas/page.tsx"
click node_entry_service "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/inventory-entry.service.ts"
click node_inventory_store "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/repositories/inventory-entry.repository.ts"
click node_pending "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/pendientes/page.tsx"
click node_pending_service "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/pending.service.ts"
click node_pending_repo "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/repositories/pending.repository.ts"
click node_missing "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/faltantes/page.tsx"
click node_missing_service "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/missing-item.service.ts"
click node_admin "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/admin/page.tsx"
click node_audit "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/auditoria/page.tsx"
click node_reports "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/reportes/page.tsx"
click node_report_service "https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/reports.service.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_login,node_auth_action,node_auth_service,node_users_repo,node_app_shell,node_dashboard toneBlue
class node_products,node_product_service,node_batches_expiry,node_entries,node_entry_service,node_inventory_store toneAmber
class node_pending,node_pending_service,node_pending_repo,node_missing,node_missing_service toneMint
class node_admin,node_audit,node_reports,node_report_service toneRose
class node_staff toneIndigo
```

## Components

### Access and shell

- [Login](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(auth)/login/page.tsx): `apps/web/app/(auth)/login/page.tsx`
- [Auth actions](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/actions/auth.actions.ts): `apps/web/server/actions/auth.actions.ts`
- [Auth service](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/auth.service.ts): `apps/web/server/services/auth.service.ts`
- [User repository](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/repositories/user.repository.ts): `apps/web/server/repositories/user.repository.ts`
- [App shell](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/_components/app-shell/app-shell.tsx): `apps/web/app/_components/app-shell/app-shell.tsx`
- [Dashboard](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/dashboard/page.tsx): `apps/web/app/(dashboard)/dashboard/page.tsx`

### Catalog and inventory

- [Product catalog](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/productos/page.tsx): `apps/web/app/(dashboard)/productos/page.tsx`
- [Product services](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/product.service.ts): `apps/web/server/services/product.service.ts`
- [Batches and expiry](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/features/vencimientos/expiring-batch-list.tsx): `apps/web/features/vencimientos/expiring-batch-list.tsx`
- [Inventory entries](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/entradas/page.tsx): `apps/web/app/(dashboard)/entradas/page.tsx`
- [Entry service](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/inventory-entry.service.ts): `apps/web/server/services/inventory-entry.service.ts`
- [Inventory repositories](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/repositories/inventory-entry.repository.ts): `apps/web/server/repositories/inventory-entry.repository.ts`

### Orders and shortages

- [Customer orders](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/pendientes/page.tsx): `apps/web/app/(dashboard)/pendientes/page.tsx`
- [Pending service](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/pending.service.ts): `apps/web/server/services/pending.service.ts`
- [Pending repository](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/repositories/pending.repository.ts): `apps/web/server/repositories/pending.repository.ts`
- [Shortages](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/faltantes/page.tsx): `apps/web/app/(dashboard)/faltantes/page.tsx`
- [Shortage services](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/missing-item.service.ts): `apps/web/server/services/missing-item.service.ts`

### Administration and oversight

- [User administration](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/admin/page.tsx): `apps/web/app/(dashboard)/admin/page.tsx`
- [Audit history](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/auditoria/page.tsx): `apps/web/app/(dashboard)/auditoria/page.tsx`
- [Reports](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/app/(dashboard)/reportes/page.tsx): `apps/web/app/(dashboard)/reportes/page.tsx`
- [Report services](https://github.com/sebasttiant/swdrogueriaespecifica/blob/main/apps/web/server/services/reports.service.ts): `apps/web/server/services/reports.service.ts`

### Other components

- **Pharmacy staff**

## Connections

- Pharmacy staff → Login: signs in
- Login → Auth actions: submits credentials
- Auth actions → Auth service: verifies credentials
- Auth service → User repository: looks up user (evidence: `apps/web/server/services/auth.service.ts`)
- Pharmacy staff → App shell: uses
- Pharmacy staff → Dashboard: opens
- Pharmacy staff → Product catalog: manages products
- Product catalog → Product services: uses product services
- Pharmacy staff → Batches and expiry: reviews expiry
- Pharmacy staff → Inventory entries: records arrivals
- Inventory entries → Entry service: registers entry
- Entry service → Inventory repositories: persists inventory
- Pharmacy staff → Customer orders: manages orders
- Customer orders → Pending service: uses order services
- Pending service → Pending repository: reads and writes (evidence: `apps/web/server/services/pending.service.ts`)
- Pharmacy staff → Shortages: reviews shortages
- Shortages → Shortage services: exports shortages
- Pharmacy staff → User administration: administers users
- Pharmacy staff → Audit history: reviews activity
- Pharmacy staff → Reports: views reports
- Reports → Report services: requests analytics
