# erwinasseng/test-trx architecture

> Architecture diagram of the GitHub repository erwinasseng/test-trx, 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/erwinasseng/test-trx
- Repository: https://github.com/erwinasseng/test-trx

## Overview

Transmex is a role-based business operations application covering sales and customer management, cash operations, journals, dossiers, HR, administration, and reporting. Users enter through the authenticated Angular application, navigate permission-guarded modules, and use feature screens backed by domain services; the services communicate with a server that exposes API routes and performs server-side authentication and access control. The graph preserves major modules visible in the route map and source index. Evidence is limited to the provided excerpts and index; uncertain backend wiring is omitted.

Main entry points: [`src/app/app.routes.ts`](https://github.com/erwinasseng/test-trx/blob/main/src/app/app.routes.ts) (Route map), [`src/server.ts`](https://github.com/erwinasseng/test-trx/blob/main/src/server.ts) (Express API and SSR), [`src/app/core/services/cashier.service.ts`](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/cashier.service.ts) (Cashier service), [`src/app/features/dashboard`](https://github.com/erwinasseng/test-trx/tree/main/src/app/features/dashboard) (Dashboards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application access"]
  node_routes["Route map<br/>[app.routes.ts]"]
  node_authguard["Authentication guard<br/>[auth.guard.ts]"]
  node_layout["Main layout<br/>[main-layout.ts]"]
  node_launcher["App launcher<br/>[app-launcher.ts]"]
  node_dashboard["Dashboards"]
  node_hr["HR management<br/>[hr-management.ts]"]
end

subgraph group_sales["Sales and customer operations"]
  node_crm["CRM<br/>[crm.ts]"]
  node_prospects["Prospects<br/>[prospects.ts]"]
  node_quotes["Quotes<br/>[quotes.ts]"]
  node_dossiers["Dossiers"]
  node_crmservice["CRM service<br/>[crm.service.ts]"]
  node_prospectservice["Prospect service"]
  node_quoteservice["Quote service<br/>[quote.service.ts]"]
  node_dossierservice["Dossier service<br/>[dossier.service.ts]"]
end

subgraph group_finance["Finance and operations"]
  node_cashier["Cashier management"]
  node_journals["Journal configuration"]
  node_cashierservice["Cashier service<br/>[cashier.service.ts]"]
  node_journalservice["Journal service<br/>[journal.service.ts]"]
end

subgraph group_security["Identity and administration"]
  node_login["Login<br/>[login.ts]"]
  node_admin["Access administration<br/>[access-control.ts]"]
  node_authservice["Authentication service<br/>[auth.service.ts]"]
  node_accessservice["Access control service"]
end

subgraph group_server["Server API"]
  node_supabase["Supabase client"]
  node_server["Express API and SSR<br/>[server.ts]"]
  node_serverauth["Server authentication<br/>[auth.ts]"]
  node_serveraccess["Permission evaluation<br/>[access-control.ts]"]
  node_accesshandlers["Access control handlers"]
end

node_user(("Business user"))

node_user -->|"opens"| node_routes
node_routes -->|"guards routes"| node_authguard
node_routes -->|"loads layout"| node_layout
node_routes -->|"routes to"| node_launcher
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_crm
node_routes -->|"routes to"| node_prospects
node_routes -->|"routes to"| node_quotes
node_routes -->|"routes to"| node_dossiers
node_routes -->|"routes to"| node_cashier
node_routes -->|"routes to"| node_journals
node_routes -->|"routes to"| node_hr
node_routes -->|"routes to"| node_admin
node_authguard -->|"checks session"| node_authservice
node_crm -->|"uses"| node_crmservice
node_crm -->|"uses view"| node_prospects
node_prospects -->|"uses"| node_prospectservice
node_quotes -->|"uses"| node_quoteservice
node_cashier -->|"uses"| node_cashierservice
node_journals -.->|"uses"| node_journalservice
node_dashboard -->|"reads operations"| node_cashierservice
node_dashboard -->|"loads journal data"| node_journalservice
node_authservice -->|"uses client"| node_supabase
node_cashierservice -->|"uses client"| node_supabase
node_journalservice -->|"uses client"| node_supabase
node_accessservice -.->|"requests permissions"| node_serveraccess
node_server -->|"uses authentication"| node_serverauth
node_server -.->|"routes handlers"| node_accesshandlers
node_accesshandlers -->|"resolves permissions"| node_serveraccess
node_serveraccess -->|"loads profiles"| node_serverauth
node_cashierservice -.->|"calls cashier API"| node_server
node_prospectservice -.->|"calls API"| node_server
node_quoteservice -.->|"calls API"| node_server
node_dossierservice -.->|"calls API"| node_server

click node_routes "https://github.com/erwinasseng/test-trx/blob/main/src/app/app.routes.ts"
click node_authguard "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/guards/auth.guard.ts"
click node_layout "https://github.com/erwinasseng/test-trx/blob/main/src/app/layout/main-layout/main-layout.ts"
click node_launcher "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/app-launcher/app-launcher.ts"
click node_dashboard "https://github.com/erwinasseng/test-trx/tree/main/src/app/features/dashboard"
click node_login "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/auth/login/login.ts"
click node_crm "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/crm/crm.ts"
click node_prospects "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/prospects/prospects.ts"
click node_quotes "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/quotes/quotes.ts"
click node_dossiers "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/dossiers/dossier-management.ts"
click node_cashier "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/cashier/cashier-management.ts"
click node_journals "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/configuration/journal/configuration-journal.ts"
click node_hr "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/hr/hr-management.ts"
click node_admin "https://github.com/erwinasseng/test-trx/blob/main/src/app/features/admin/access-control/access-control.ts"
click node_authservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/auth.service.ts"
click node_accessservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/access-control.service.ts"
click node_cashierservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/cashier.service.ts"
click node_journalservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/journal.service.ts"
click node_supabase "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/supabase.service.ts"
click node_server "https://github.com/erwinasseng/test-trx/blob/main/src/server.ts"
click node_serverauth "https://github.com/erwinasseng/test-trx/blob/main/src/server/auth.ts"
click node_serveraccess "https://github.com/erwinasseng/test-trx/blob/main/src/server/access-control.ts"
click node_accesshandlers "https://github.com/erwinasseng/test-trx/blob/main/src/server/access-control.handlers.ts"
click node_crmservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/crm.service.ts"
click node_prospectservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/prospect.service.ts"
click node_quoteservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/quote.service.ts"
click node_dossierservice "https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/dossier.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_routes,node_authguard,node_layout,node_launcher,node_dashboard,node_hr,node_user toneBlue
class node_crm,node_prospects,node_quotes,node_dossiers,node_crmservice,node_prospectservice,node_quoteservice,node_dossierservice toneAmber
class node_cashier,node_journals,node_cashierservice,node_journalservice toneMint
class node_login,node_admin,node_authservice,node_accessservice toneRose
class node_supabase,node_server,node_serverauth,node_serveraccess,node_accesshandlers toneIndigo
```

## Components

### Application access

- [Route map](https://github.com/erwinasseng/test-trx/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Authentication guard](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/guards/auth.guard.ts): `src/app/core/guards/auth.guard.ts`
- [Main layout](https://github.com/erwinasseng/test-trx/blob/main/src/app/layout/main-layout/main-layout.ts): `src/app/layout/main-layout/main-layout.ts`
- [App launcher](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/app-launcher/app-launcher.ts): `src/app/features/app-launcher/app-launcher.ts`
- [Dashboards](https://github.com/erwinasseng/test-trx/tree/main/src/app/features/dashboard): `src/app/features/dashboard`
- [HR management](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/hr/hr-management.ts): `src/app/features/hr/hr-management.ts`

### Sales and customer operations

- [CRM](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/crm/crm.ts): `src/app/features/crm/crm.ts`
- [Prospects](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/prospects/prospects.ts): `src/app/features/prospects/prospects.ts`
- [Quotes](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/quotes/quotes.ts): `src/app/features/quotes/quotes.ts`
- [Dossiers](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/dossiers/dossier-management.ts): `src/app/features/dossiers/dossier-management.ts`
- [CRM service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/crm.service.ts): `src/app/core/services/crm.service.ts`
- [Prospect service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/prospect.service.ts): `src/app/core/services/prospect.service.ts`
- [Quote service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/quote.service.ts): `src/app/core/services/quote.service.ts`
- [Dossier service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/dossier.service.ts): `src/app/core/services/dossier.service.ts`

### Finance and operations

- [Cashier management](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/cashier/cashier-management.ts): `src/app/features/cashier/cashier-management.ts`
- [Journal configuration](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/configuration/journal/configuration-journal.ts): `src/app/features/configuration/journal/configuration-journal.ts`
- [Cashier service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/cashier.service.ts): `src/app/core/services/cashier.service.ts`
- [Journal service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/journal.service.ts): `src/app/core/services/journal.service.ts`

### Identity and administration

- [Login](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/auth/login/login.ts): `src/app/features/auth/login/login.ts`
- [Access administration](https://github.com/erwinasseng/test-trx/blob/main/src/app/features/admin/access-control/access-control.ts): `src/app/features/admin/access-control/access-control.ts`
- [Authentication service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/auth.service.ts): `src/app/core/services/auth.service.ts`
- [Access control service](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/access-control.service.ts): `src/app/core/services/access-control.service.ts`

### Server API

- [Supabase client](https://github.com/erwinasseng/test-trx/blob/main/src/app/core/services/supabase.service.ts): `src/app/core/services/supabase.service.ts`
- [Express API and SSR](https://github.com/erwinasseng/test-trx/blob/main/src/server.ts): `src/server.ts`
- [Server authentication](https://github.com/erwinasseng/test-trx/blob/main/src/server/auth.ts): `src/server/auth.ts`
- [Permission evaluation](https://github.com/erwinasseng/test-trx/blob/main/src/server/access-control.ts): `src/server/access-control.ts`
- [Access control handlers](https://github.com/erwinasseng/test-trx/blob/main/src/server/access-control.handlers.ts): `src/server/access-control.handlers.ts`

### Other components

- **Business user**

## Connections

- Business user → Route map: opens (evidence: `src/app/app.routes.ts`)
- Route map → Authentication guard: guards routes (evidence: `src/app/app.routes.ts`)
- Route map → Main layout: loads layout (evidence: `src/app/app.routes.ts`)
- Route map → App launcher: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Dashboards: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Login: routes to (evidence: `src/app/app.routes.ts`)
- Route map → CRM: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Prospects: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Quotes: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Dossiers: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Cashier management: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Journal configuration: routes to (evidence: `src/app/app.routes.ts`)
- Route map → HR management: routes to (evidence: `src/app/app.routes.ts`)
- Route map → Access administration: routes to (evidence: `src/app/app.routes.ts`)
- Authentication guard → Authentication service: checks session (evidence: `src/app/core/guards/auth.guard.ts`)
- CRM → CRM service: uses (evidence: `src/app/features/crm/crm.ts`)
- CRM → Prospects: uses view (evidence: `src/app/features/crm/crm.ts`)
- Prospects → Prospect service: uses (evidence: `src/app/features/prospects/prospects.ts`)
- Quotes → Quote service: uses (evidence: `src/app/features/quotes/quotes.ts`)
- Cashier management → Cashier service: uses (evidence: `src/app/features/cashier/cashier-management.ts`)
- Journal configuration → Journal service: uses
- Dashboards → Cashier service: reads operations (evidence: `src/app/features/dashboard/dashboard-manager/dashboard-manager.ts`)
- Dashboards → Journal service: loads journal data (evidence: `src/app/features/dashboard/dashboard-manager/dashboard-manager.ts`)
- Authentication service → Supabase client: uses client (evidence: `src/app/core/services/auth.service.ts`)
- Cashier service → Supabase client: uses client (evidence: `src/app/core/services/cashier.service.ts`)
- Journal service → Supabase client: uses client (evidence: `src/app/core/services/journal.service.ts`)
- Access control service → Permission evaluation: requests permissions
- Express API and SSR → Server authentication: uses authentication (evidence: `src/server.ts`)
- Express API and SSR → Access control handlers: routes handlers (evidence: `src/server.ts`)
- Access control handlers → Permission evaluation: resolves permissions (evidence: `src/server/access-control.handlers.ts`)
- Permission evaluation → Server authentication: loads profiles (evidence: `src/server/access-control.ts`)
- Cashier service → Express API and SSR: calls cashier API
- Prospect service → Express API and SSR: calls API
- Quote service → Express API and SSR: calls API
- Dossier service → Express API and SSR: calls API
