# cacic-fct/event-manager architecture

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

- Interactive diagram: https://gitdiagram.com/cacic-fct/event-manager
- Repository: https://github.com/cacic-fct/event-manager

## Overview

#### Overview

CACiC Event Manager is a monorepo for event registrations, attendance control, and certificate issuance. It contains public and administrative Angular applications, a TypeScript backend, shared libraries, persistent storage definitions, and operational integrations.

#### Components

- **Public application** — `apps/public/src/main.ts`  
  Angular application for public event discovery, registration, profiles, calendars, attendance collection, certificates, notifications, sports, and offline workflows. Routes and feature areas live under `apps/public/src/app`.

- **Administrative application** — `apps/admin/src/main.ts`  
  Angular application for event, attendance, subscription, certificate, people, permissions, publication, audit, place, prize-draw, and sports administration. Its backend-facing API adapters are organized under `apps/admin/src/app/graphql`.

- **Backend service** — `apps/backend/src/main.ts`  
  Server-side application exposing feature areas through GraphQL resolvers and HTTP controllers. Major domains include authentication and authorization, events, attendance, event forms, subscriptions, certificates, people, publishing, sports, prize draws, audit logs, calendars, privacy, notifications, search, and realtime updates.

- **Relational persistence** — `apps/backend/prisma/schema`  
  Prisma schema is split by domain, including events, people, attendance, certificates, permissions, forms, sports, and subscriptions. Historical database changes are recorded under `apps/backend/prisma/migrations`, establishing PostgreSQL as durable application state.

- **Shared domain and API contracts** — `libs/shared-data-types/src/index.ts`  
  Reusable TypeScript models and inputs for events, attendance, certificates, users, forms, subscriptions, sports, and related entities. Dedicated public and admin contract libraries provide narrower consumer-facing surfaces through `libs/event-manager-public-contracts/src/index.ts` and `libs/event-manager-admin-contracts/src/index.ts`.

- **Reusable Angular platform code** — `libs/shared-angular/src/index.ts`  
  Shared authentication, service-worker, privacy, realtime, forms, scanner, sports, notification, and UI components used by the applications.

- **Browser offline state** — `libs/public-indexed-db/src/index.ts`  
  IndexedDB-backed caches and queues for public data, attendance, oral attendance, sports operations, calendar preferences, and user offline data. This is a client-side persistence boundary rather than backend storage.

- **Certificate template assets** — `certificate-templates/certificate-template.schema.json`  
  Schema and template assets define certificate presentation variants, while certificate issuance and validation remain backend responsibilities.

#### External interfaces and dependencies

The README documents local backend dependencies on PostgreSQL, Redis, Typesense, and SeaweedFS, configured operationally under `docker`. The tree also exposes Keycloak authentication, S3 storage, Novu notifications, gRPC contracts, Turnstile, weather, and realtime/search integrations. These providers are external actors; the repository contains adapters and configuration boundaries, not the provider systems themselves.

#### Relationships

Browser users and administrators interact with the public or admin Angular applications. Those applications expose route-level pages and API clients, while backend resolvers/controllers define the server interface; the tree supports this boundary but does not prove exact request sequencing. Backend domain services own authorization, business rules, and durable writes through Prisma, with Redis, search, object storage, notifications, and realtime services serving specialized concerns. Shared contracts and libraries provide common models and UI behavior without owning feature persistence. Certificate templates are consumed as assets by the certificate area, and public IndexedDB supports offline client behavior independently of PostgreSQL.

Main entry points: [`apps/backend/src/main.ts`](https://github.com/cacic-fct/event-manager/blob/main/apps/backend/src/main.ts) (Backend service), [`apps/public/src/main.ts`](https://github.com/cacic-fct/event-manager/blob/main/apps/public/src/main.ts) (Public application), [`apps/admin/src/main.ts`](https://github.com/cacic-fct/event-manager/blob/main/apps/admin/src/main.ts) (Administrative application), [`libs/shared-data-types/src/index.ts`](https://github.com/cacic-fct/event-manager/blob/main/libs/shared-data-types/src/index.ts) (Shared domain types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_applications["Applications and backend"]
  node_public_app["Public application<br/>Angular application<br/>[main.ts]"]
  node_admin_app["Administrative application<br/>Angular application<br/>[main.ts]"]
  node_backend["Backend service<br/>TypeScript backend<br/>[main.ts]"]
  node_persistence[("Relational persistence<br/>Prisma schema")]
end

subgraph group_shared["Shared libraries and assets"]
  node_shared_types["Shared domain types<br/>TypeScript contracts<br/>[index.ts]"]
  node_shared_angular["Shared Angular platform<br/>Angular library<br/>[index.ts]"]
  node_offline_state[("Browser offline state<br/>IndexedDB library<br/>[index.ts]")]
  node_certificate_templates["Certificate templates<br/>Template assets"]
end

subgraph group_external["External systems"]
  node_browser_users(("Browser users<br/>External actor"))
  node_administrators(("Administrators<br/>External actor"))
  node_postgresql[("PostgreSQL<br/>External database")]
  node_redis[("Redis<br/>External service")]
  node_typesense[("Typesense<br/>External search service")]
  node_object_storage[("Object storage<br/>External storage service")]
  node_integration_providers{{"Integration providers<br/>External providers"}}
end

node_browser_users -->|"interacts with"| node_public_app
node_administrators -->|"interacts with"| node_admin_app
node_public_app -->|"uses API"| node_backend
node_admin_app -->|"uses API"| node_backend
node_shared_types -->|"defines models for"| node_public_app
node_shared_types -->|"defines models for"| node_admin_app
node_shared_types -->|"defines models for"| node_backend
node_shared_angular -->|"provides platform code"| node_public_app
node_shared_angular -->|"provides platform code"| node_admin_app
node_public_app -->|"uses offline state"| node_offline_state
node_backend -->|"writes durable state"| node_persistence
node_persistence -->|"targets"| node_postgresql
node_backend -->|"uses"| node_redis
node_backend -->|"uses search"| node_typesense
node_backend -->|"uses storage"| node_object_storage
node_backend -->|"integrates with"| node_integration_providers
node_certificate_templates -->|"provides certificate assets"| node_backend

click node_public_app "https://github.com/cacic-fct/event-manager/blob/main/apps/public/src/main.ts"
click node_admin_app "https://github.com/cacic-fct/event-manager/blob/main/apps/admin/src/main.ts"
click node_backend "https://github.com/cacic-fct/event-manager/blob/main/apps/backend/src/main.ts"
click node_persistence "https://github.com/cacic-fct/event-manager/tree/main/apps/backend/prisma/schema"
click node_shared_types "https://github.com/cacic-fct/event-manager/blob/main/libs/shared-data-types/src/index.ts"
click node_shared_angular "https://github.com/cacic-fct/event-manager/blob/main/libs/shared-angular/src/index.ts"
click node_offline_state "https://github.com/cacic-fct/event-manager/blob/main/libs/public-indexed-db/src/index.ts"
click node_certificate_templates "https://github.com/cacic-fct/event-manager/blob/main/certificate-templates/certificate-template.schema.json"

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_public_app,node_admin_app,node_backend,node_persistence toneBlue
class node_shared_types,node_shared_angular,node_offline_state,node_certificate_templates toneAmber
class node_browser_users,node_administrators,node_postgresql,node_redis,node_typesense,node_object_storage,node_integration_providers toneMint
```

## Components

### Applications and backend

- [Public application](https://github.com/cacic-fct/event-manager/blob/main/apps/public/src/main.ts): Angular application · Public event discovery, registration, attendance, certificates, and offline workflows. · `apps/public/src/main.ts`
- [Administrative application](https://github.com/cacic-fct/event-manager/blob/main/apps/admin/src/main.ts): Angular application · Administrative management for events, attendance, people, certificates, and permissions. · `apps/admin/src/main.ts`
- [Backend service](https://github.com/cacic-fct/event-manager/blob/main/apps/backend/src/main.ts): TypeScript backend · GraphQL resolvers and HTTP controllers for domain services and integrations. · `apps/backend/src/main.ts`
- [Relational persistence](https://github.com/cacic-fct/event-manager/tree/main/apps/backend/prisma/schema): Prisma schema · Defines durable PostgreSQL application state by domain. · `apps/backend/prisma/schema`

### Shared libraries and assets

- [Shared domain types](https://github.com/cacic-fct/event-manager/blob/main/libs/shared-data-types/src/index.ts): TypeScript contracts · Reusable models and inputs for application domains. · `libs/shared-data-types/src/index.ts`
- [Shared Angular platform](https://github.com/cacic-fct/event-manager/blob/main/libs/shared-angular/src/index.ts): Angular library · Reusable authentication, forms, realtime, scanner, notification, and UI code. · `libs/shared-angular/src/index.ts`
- [Browser offline state](https://github.com/cacic-fct/event-manager/blob/main/libs/public-indexed-db/src/index.ts): IndexedDB library · Client-side caches and queues for public offline workflows. · `libs/public-indexed-db/src/index.ts`
- [Certificate templates](https://github.com/cacic-fct/event-manager/blob/main/certificate-templates/certificate-template.schema.json): Template assets · Certificate presentation schemas and variants. · `certificate-templates/certificate-template.schema.json`

### External systems

- **Browser users**: External actor
- **Administrators**: External actor
- **PostgreSQL**: External database
- **Redis**: External service
- **Typesense**: External search service
- **Object storage**: External storage service · Includes configured S3-compatible storage such as SeaweedFS.
- **Integration providers**: External providers · Authentication, notifications, gRPC, Turnstile, weather, and realtime providers.

## Connections

- Browser users → Public application: interacts with
- Administrators → Administrative application: interacts with
- Public application → Backend service: uses API
- Administrative application → Backend service: uses API
- Shared domain types → Public application: defines models for
- Shared domain types → Administrative application: defines models for
- Shared domain types → Backend service: defines models for
- Shared Angular platform → Public application: provides platform code
- Shared Angular platform → Administrative application: provides platform code
- Public application → Browser offline state: uses offline state
- Backend service → Relational persistence: writes durable state
- Relational persistence → PostgreSQL: targets
- Backend service → Redis: uses · Specialized cache and operational dependency.
- Backend service → Typesense: uses search
- Backend service → Object storage: uses storage
- Backend service → Integration providers: integrates with
- Certificate templates → Backend service: provides certificate assets
