# mohamedaminebenmansour/hydramanagmnet architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedaminebenmansour/hydramanagmnet
- Repository: https://github.com/mohamedaminebenmansour/hydramanagmnet

## Overview

Hydra is a multi-tenant business operations platform, with an Angular interface and a Spring backend. The main user journey is to enter through routed, permission-guarded screens, then manage project work, purchasing, stock, cash, documents, or tickets. Backend services enforce domain rules and persist operational state; audit and domain-event services provide separate activity records. The tree and sampled sources show several important links, but not the full controller-to-service or frontend-to-API wiring, so those connections are omitted rather than assumed.

Main entry points: [`frontend/src/app/app.routes.ts`](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/app.routes.ts) (App routes), [`backend/src/main/java/tn/hydra/cash/CashService.java`](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/cash/CashService.java) (Cash management), [`backend/src/main/java/tn/hydra/event/DomainEventService.java`](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/event/DomainEventService.java) (Domain events), [`backend/src/main/java/tn/hydra/user/AppUserRepository.java`](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/user/AppUserRepository.java) (User repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and platform"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_identity["User identity<br/>[AppUser.java]"]
  node_userrepo["User repository"]
  node_enterprise_ui["Organization settings"]
end

subgraph group_projects["Projects and records"]
  node_projects_domain["Projects"]
  node_ouvrages["Project works"]
  node_documents["Documents and revisions"]
  node_controle["Project controls"]
end

subgraph group_operations["Financial operations"]
  node_purchasing["Purchasing"]
  node_stock["Stock<br/>[StockService.java]"]
  node_cash["Cash management<br/>[CashService.java]"]
  node_cash_form["Movement entry"]
end

subgraph group_workflow["Work and oversight"]
  node_process["Approval processes"]
  node_tickets["Tickets<br/>[TicketService.java]"]
  node_audit["Audit log"]
  node_events["Domain events"]
end

node_user(("User"))
node_db[("Relational database")]

node_user -->|"opens screens"| node_routes
node_routes -->|"guards access"| node_auth
node_routes -->|"routes to"| node_cash_form
node_routes -->|"routes to"| node_enterprise_ui
node_routes -.->|"requests data"| node_projects_domain
node_routes -.->|"requests data"| node_documents
node_routes -.->|"requests data"| node_purchasing
node_routes -.->|"requests data"| node_stock
node_routes -.->|"requests data"| node_cash
node_routes -.->|"requests data"| node_process
node_routes -.->|"requests data"| node_tickets
node_projects_domain -->|"checks access"| node_ouvrages
node_ouvrages -->|"records changes"| node_audit
node_controle -->|"queries"| node_db
node_purchasing -->|"reads stock items"| node_stock
node_cash -->|"computes warnings"| node_purchasing
node_cash -->|"uses documents"| node_documents
node_cash -->|"emits events"| node_events
node_cash -->|"logs activity"| node_audit
node_process -->|"uses cash service"| node_cash
node_process -->|"emits events"| node_events
node_tickets -->|"emits events"| node_events
node_audit -->|"writes log"| node_db
node_events -->|"writes and reads"| node_db
node_controle -->|"resolves users"| node_userrepo
node_userrepo -->|"loads records"| node_identity
node_userrepo -.->|"persists identity"| node_db

click node_routes "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/app.routes.ts"
click node_auth "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/core/auth.service.ts"
click node_identity "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/user/AppUser.java"
click node_userrepo "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/user/AppUserRepository.java"
click node_projects_domain "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/project/ProjectService.java"
click node_ouvrages "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/project/OuvrageService.java"
click node_documents "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/document/service/DocumentService.java"
click node_controle "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/controle/ControleQueryService.java"
click node_purchasing "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/purchase/PurchaseOrderService.java"
click node_stock "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/stock/StockService.java"
click node_cash "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/cash/CashService.java"
click node_process "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/process/ProcessService.java"
click node_tickets "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/ticket/TicketService.java"
click node_audit "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/audit/EventLogService.java"
click node_events "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/event/DomainEventService.java"
click node_cash_form "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/features/cash/movement-form.component.ts"
click node_enterprise_ui "https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/features/entreprise/entreprise.component.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_auth,node_identity,node_userrepo,node_enterprise_ui,node_user toneBlue
class node_projects_domain,node_ouvrages,node_documents,node_controle,node_db toneAmber
class node_purchasing,node_stock,node_cash,node_cash_form toneMint
class node_process,node_tickets,node_audit,node_events toneRose
```

## Components

### Access and platform

- [App routes](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Authentication](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/core/auth.service.ts): `frontend/src/app/core/auth.service.ts`
- [User identity](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/user/AppUser.java): `backend/src/main/java/tn/hydra/user/AppUser.java`
- [User repository](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/user/AppUserRepository.java): `backend/src/main/java/tn/hydra/user/AppUserRepository.java`
- [Organization settings](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/features/entreprise/entreprise.component.ts): `frontend/src/app/features/entreprise/entreprise.component.ts`

### Projects and records

- [Projects](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/project/ProjectService.java): `backend/src/main/java/tn/hydra/project/ProjectService.java`
- [Project works](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/project/OuvrageService.java): `backend/src/main/java/tn/hydra/project/OuvrageService.java`
- [Documents and revisions](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/document/service/DocumentService.java): `backend/src/main/java/tn/hydra/document/service/DocumentService.java`
- [Project controls](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/controle/ControleQueryService.java): `backend/src/main/java/tn/hydra/controle/ControleQueryService.java`

### Financial operations

- [Purchasing](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/purchase/PurchaseOrderService.java): `backend/src/main/java/tn/hydra/purchase/PurchaseOrderService.java`
- [Stock](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/stock/StockService.java): `backend/src/main/java/tn/hydra/stock/StockService.java`
- [Cash management](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/cash/CashService.java): `backend/src/main/java/tn/hydra/cash/CashService.java`
- [Movement entry](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/frontend/src/app/features/cash/movement-form.component.ts): `frontend/src/app/features/cash/movement-form.component.ts`

### Work and oversight

- [Approval processes](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/process/ProcessService.java): `backend/src/main/java/tn/hydra/process/ProcessService.java`
- [Tickets](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/ticket/TicketService.java): `backend/src/main/java/tn/hydra/ticket/TicketService.java`
- [Audit log](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/audit/EventLogService.java): `backend/src/main/java/tn/hydra/audit/EventLogService.java`
- [Domain events](https://github.com/mohamedaminebenmansour/hydramanagmnet/blob/main/backend/src/main/java/tn/hydra/event/DomainEventService.java): `backend/src/main/java/tn/hydra/event/DomainEventService.java`

### Other components

- **User**
- **Relational database**

## Connections

- User → App routes: opens screens (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Authentication: guards access (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Movement entry: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Organization settings: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Projects: requests data
- App routes → Documents and revisions: requests data
- App routes → Purchasing: requests data
- App routes → Stock: requests data
- App routes → Cash management: requests data
- App routes → Approval processes: requests data
- App routes → Tickets: requests data
- Projects → Project works: checks access (evidence: `backend/src/main/java/tn/hydra/project/OuvrageService.java`)
- Project works → Audit log: records changes (evidence: `backend/src/main/java/tn/hydra/project/OuvrageService.java`)
- Project controls → Relational database: queries (evidence: `backend/src/main/java/tn/hydra/controle/ControleQueryService.java`)
- Purchasing → Stock: reads stock items (evidence: `backend/src/main/java/tn/hydra/purchase/PurchaseOrderService.java`)
- Cash management → Purchasing: computes warnings (evidence: `backend/src/main/java/tn/hydra/cash/CashService.java`)
- Cash management → Documents and revisions: uses documents (evidence: `backend/src/main/java/tn/hydra/cash/CashService.java`)
- Cash management → Domain events: emits events (evidence: `backend/src/main/java/tn/hydra/cash/CashService.java`)
- Cash management → Audit log: logs activity (evidence: `backend/src/main/java/tn/hydra/cash/CashService.java`)
- Approval processes → Cash management: uses cash service (evidence: `backend/src/main/java/tn/hydra/process/ProcessService.java`)
- Approval processes → Domain events: emits events (evidence: `backend/src/main/java/tn/hydra/process/ProcessService.java`)
- Tickets → Domain events: emits events (evidence: `backend/src/main/java/tn/hydra/ticket/TicketService.java`)
- Audit log → Relational database: writes log (evidence: `backend/src/main/java/tn/hydra/audit/EventLogService.java`)
- Domain events → Relational database: writes and reads (evidence: `backend/src/main/java/tn/hydra/event/DomainEventService.java`)
- Project controls → User repository: resolves users (evidence: `backend/src/main/java/tn/hydra/controle/ControleQueryService.java`)
- User repository → User identity: loads records (evidence: `backend/src/main/java/tn/hydra/user/AppUserRepository.java`)
- User repository → Relational database: persists identity
