# maif/izanami architecture

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

- Interactive diagram: https://gitdiagram.com/maif/izanami
- Repository: https://github.com/maif/izanami

## Overview

Izanami is a centralized feature-flag platform. Clients request evaluated flags through the API; authenticated administrators manage tenants, projects, contexts, tags, users, rights, imports, and webhooks through the frontend. Controllers dispatch to domain services, which apply feature and authorization rules and use PostgreSQL-backed datastores. Feature changes and usage generate events consumed by the webhook worker for external notifications. Some controller/service call sites were not sampled, so those relationships reflect explicit module responsibilities and documented capabilities.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API Runtime"]
  node_feature_controller["Feature API"]
  node_auth_layer["Auth Actions<br/>[AuthAction.scala]"]
  node_login_controller["Login API"]
end

subgraph group_features["Feature Domain"]
  node_feature_service["Feature Service"]
  node_usage_service["Usage Service"]
  node_feature_context["Feature Contexts"]
end

subgraph group_governance["Governance"]
  node_rights_service["Rights Service<br/>[RightService.scala]"]
end

subgraph group_integrations["Integrations UI"]
  node_frontend["Admin Frontend<br/>[App.tsx]"]
  node_import_controller["Import API"]
  node_webhook_listener["Webhook Worker"]
  node_webhook_controller["Webhook API"]
end

subgraph group_persistence["Persistence"]
  node_feature_store["Feature Store"]
  node_context_store["Context Store"]
  node_event_service["Event Service<br/>[EventService.scala]"]
  node_webhook_store["Webhook Store"]
  node_postgres[("PostgreSQL<br/>[postgresql.scala]")]
  node_user_store["User Store"]
end

node_feature_client(("Feature Client"))
node_admin_user(("Administrator"))
node_oauth_provider(("OAuth Provider"))
node_webhook_endpoint(("Webhook Endpoint"))

node_feature_client -->|"requests flags"| node_feature_controller
node_feature_controller -->|"checks access"| node_auth_layer
node_feature_controller -->|"evaluates flags"| node_feature_service
node_feature_service -->|"reads features"| node_feature_store
node_feature_service -->|"reads contexts"| node_context_store
node_feature_service -->|"records usage"| node_usage_service
node_feature_controller -->|"returns results"| node_feature_client
node_usage_service -->|"publishes usage"| node_event_service
node_feature_service -->|"publishes changes"| node_event_service
node_admin_user -->|"manages flags"| node_frontend
node_frontend -->|"calls API"| node_feature_controller
node_frontend -->|"authenticates"| node_login_controller
node_frontend -->|"manages hooks"| node_webhook_controller
node_admin_user -->|"uploads exports"| node_import_controller
node_import_controller -->|"imports transactionally"| node_postgres
node_login_controller -.->|"exchanges tokens"| node_oauth_provider
node_login_controller -->|"creates sessions"| node_user_store
node_auth_layer -->|"validates credentials"| node_user_store
node_admin_user -->|"changes rights"| node_rights_service
node_rights_service -->|"updates rights"| node_user_store
node_webhook_controller -->|"stores hooks"| node_webhook_store
node_event_service -->|"streams events"| node_webhook_listener
node_webhook_listener -->|"tracks deliveries"| node_webhook_store
node_webhook_listener -.->|"posts events"| node_webhook_endpoint
node_feature_store -->|"reads writes"| node_postgres
node_context_store -->|"reads writes"| node_postgres
node_webhook_store -->|"reads writes"| node_postgres
node_user_store -->|"reads writes"| node_postgres

click node_feature_controller "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/FeatureController.scala"
click node_auth_layer "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/AuthAction.scala"
click node_login_controller "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/LoginController.scala"
click node_feature_service "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/FeatureService.scala"
click node_usage_service "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/FeatureUsageService.scala"
click node_feature_context "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/FeatureContextController.scala"
click node_rights_service "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/RightService.scala"
click node_frontend "https://github.com/maif/izanami/blob/main/izanami-frontend/src/App.tsx"
click node_import_controller "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/ImportController.scala"
click node_webhook_listener "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/jobs/WebhookListener.scala"
click node_webhook_controller "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/WebhookController.scala"
click node_feature_store "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/FeaturesDatastore.scala"
click node_context_store "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/FeatureContextDatastore.scala"
click node_event_service "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/EventService.scala"
click node_webhook_store "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/WebhooksDatastore.scala"
click node_postgres "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/env/postgresql.scala"
click node_user_store "https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/UsersDatastore.scala"

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_feature_controller,node_auth_layer,node_login_controller,node_feature_client toneBlue
class node_feature_service,node_usage_service,node_feature_context toneAmber
class node_rights_service,node_webhook_endpoint toneMint
class node_frontend,node_import_controller,node_webhook_listener,node_webhook_controller toneRose
class node_feature_store,node_context_store,node_event_service,node_webhook_store,node_postgres,node_user_store,node_admin_user,node_oauth_provider toneIndigo
```

## Components

### API Runtime

- [Feature API](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/FeatureController.scala): `app/fr/maif/izanami/web/FeatureController.scala`
- [Auth Actions](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/AuthAction.scala): `app/fr/maif/izanami/web/AuthAction.scala`
- [Login API](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/LoginController.scala): `app/fr/maif/izanami/web/LoginController.scala`

### Feature Domain

- [Feature Service](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/FeatureService.scala): `app/fr/maif/izanami/services/FeatureService.scala`
- [Usage Service](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/FeatureUsageService.scala): `app/fr/maif/izanami/services/FeatureUsageService.scala`
- [Feature Contexts](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/FeatureContextController.scala): `app/fr/maif/izanami/web/FeatureContextController.scala`

### Governance

- [Rights Service](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/RightService.scala): `app/fr/maif/izanami/services/RightService.scala`

### Integrations UI

- [Admin Frontend](https://github.com/maif/izanami/blob/main/izanami-frontend/src/App.tsx): `izanami-frontend/src/App.tsx`
- [Import API](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/ImportController.scala): `app/fr/maif/izanami/web/ImportController.scala`
- [Webhook Worker](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/jobs/WebhookListener.scala): `app/fr/maif/izanami/jobs/WebhookListener.scala`
- [Webhook API](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/web/WebhookController.scala): `app/fr/maif/izanami/web/WebhookController.scala`

### Persistence

- [Feature Store](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/FeaturesDatastore.scala): `app/fr/maif/izanami/datastores/FeaturesDatastore.scala`
- [Context Store](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/FeatureContextDatastore.scala): `app/fr/maif/izanami/datastores/FeatureContextDatastore.scala`
- [Event Service](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/services/EventService.scala): `app/fr/maif/izanami/services/EventService.scala`
- [Webhook Store](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/WebhooksDatastore.scala): `app/fr/maif/izanami/datastores/WebhooksDatastore.scala`
- [PostgreSQL](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/env/postgresql.scala): `app/fr/maif/izanami/env/postgresql.scala`
- [User Store](https://github.com/maif/izanami/blob/main/app/fr/maif/izanami/datastores/UsersDatastore.scala): `app/fr/maif/izanami/datastores/UsersDatastore.scala`

### Other components

- **Feature Client**
- **Administrator**
- **OAuth Provider**
- **Webhook Endpoint**

## Connections

- Feature Client → Feature API: requests flags
- Feature API → Auth Actions: checks access
- Feature API → Feature Service: evaluates flags
- Feature Service → Feature Store: reads features
- Feature Service → Context Store: reads contexts
- Feature Service → Usage Service: records usage
- Feature API → Feature Client: returns results
- Usage Service → Event Service: publishes usage
- Feature Service → Event Service: publishes changes
- Administrator → Admin Frontend: manages flags
- Admin Frontend → Feature API: calls API
- Admin Frontend → Login API: authenticates
- Admin Frontend → Webhook API: manages hooks
- Administrator → Import API: uploads exports
- Import API → PostgreSQL: imports transactionally
- Login API → OAuth Provider: exchanges tokens
- Login API → User Store: creates sessions
- Auth Actions → User Store: validates credentials
- Administrator → Rights Service: changes rights
- Rights Service → User Store: updates rights
- Webhook API → Webhook Store: stores hooks
- Event Service → Webhook Worker: streams events
- Webhook Worker → Webhook Store: tracks deliveries
- Webhook Worker → Webhook Endpoint: posts events
- Feature Store → PostgreSQL: reads writes
- Context Store → PostgreSQL: reads writes
- Webhook Store → PostgreSQL: reads writes
- User Store → PostgreSQL: reads writes
