# uatisdeproblem/egm-app architecture

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

- Interactive diagram: https://gitdiagram.com/uatisdeproblem/egm-app
- Repository: https://github.com/uatisdeproblem/egm-app

## Overview

#### 1. Purpose and topology
EGM app is an event-management system for participants, registrations/spots, content scheduling, meals, communications, and participating organizations. It is a TypeScript monorepo with an Ionic/Angular client, AWS serverless backend, and standalone data scripts.
- `front-end/src/main.ts`
- `back-end/deploy/main.ts`
- `scripts/src/sessionFeedback.ts`

#### 2. Client application and entry
The user-facing application is an Angular/Ionic single-page app. Its root module, router, and shell establish startup, navigation, guards, and tabbed event workflows. Capacitor wraps the same web app for Android and iOS distribution.
- `front-end/src/app/app.module.ts`
- `front-end/src/app/app-routing.module.ts`
- `front-end/src/app/tabs/tabs.routing.module.ts`

#### 3. Authentication and authorization boundary
Cognito is the identity provider. Client auth pages/services acquire identity and route protection is enforced by authentication, initialization, management, and spot guards. Backend handlers expose auth/Cognito integration and apply the server-side identity boundary.
- `front-end/src/app/auth/auth.service.ts`
- `front-end/src/app/auth.guard.ts`
- `back-end/src/handlers/auth.ts`
- `back-end/deploy/cognito-stack.ts`

#### 4. Event domain API and persistence model
The backend is organized as API handlers around event aggregates: users/registrations and spots; sessions/speakers/venues/rooms; organizations, meals, contests, and communications. Model files define the shared persistence-facing domain shapes. The API contract is published in Swagger.
- `back-end/src/handlers/registrations.ts`
- `back-end/src/handlers/sessions.ts`
- `back-end/src/handlers/eventSpots.ts`
- `back-end/src/models/session.model.ts`
- `back-end/swagger.yaml`

#### 5. Primary client-to-backend flow
Feature pages and their services load or mutate API resources, then render event workflows. Management routes separate privileged configuration/content/registration operations from attendee-facing session, meal, organization, and personal-user areas. Guards gate route access before feature modules activate.
- `front-end/src/app/tabs/manage/manage.routing.module.ts`
- `front-end/src/app/tabs/sessions/sessions.service.ts`
- `front-end/src/app/tabs/meals/meals.service.ts`
- `front-end/src/app/tabs/user/user.service.ts`

#### 6. Registration, spots, and notifications
Registration/spot lifecycle is a central cross-cutting flow: administrators or delegation roles manage capacity and participant assignments; backend registration and spot handlers trigger communications. SES notification handling and Handlebars templates form the email delivery boundary for confirmations, invoices, assignments, releases, and transfers.
- `back-end/src/handlers/registrations.ts`
- `back-end/src/handlers/eventSpots.ts`
- `back-end/src/handlers/communications.ts`
- `back-end/src/handlers/sesNotifications.ts`
- `back-end/assets/registration-confirmed.hbs`

#### 7. AWS infrastructure and external services
AWS CDK composes environment-specific stacks for the API/domain, Cognito, static frontend delivery, media, maps, SES, and an “idea” deployment variant. The platform therefore depends materially on AWS API hosting, Cognito identity, SES email, media storage/delivery, and map-related infrastructure; Stripe is surfaced in the client payment UI.
- `back-end/deploy/api-stack.ts`
- `back-end/deploy/front-end-stack.ts`
- `back-end/deploy/media-stack.ts`
- `back-end/deploy/map-stack.ts`
- `back-end/deploy/ses-stack.ts`

#### 8. Native and operational delivery
Web builds can be packaged through Capacitor into Android and iOS host projects. Deployment is driven from the backend CDK entry/deploy scripts; separate scripts support direct data-oriented operations such as session feedback processing.
- `front-end/capacitor.config.ts`
- `front-end/android/app/src/main/java/org/esn/egm/MainActivity.java`
- `front-end/ios/App/App/AppDelegate.swift`
- `back-end/deploy.sh`

Main entry points: [`back-end/src/handlers/registrations.ts`](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/handlers/registrations.ts) (Event API handlers), [`back-end/deploy/main.ts`](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/main.ts) (CDK deployment entry), [`front-end/src/app/app-routing.module.ts`](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/app-routing.module.ts) (App shell & router), [`front-end/src/main.ts`](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/main.ts) (SPA entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client app"]
  node_client_entry["SPA entry<br/>Angular bootstrap<br/>[main.ts]"]
  node_client_shell["App shell &amp; router<br/>Angular modules"]
  node_feature_services["Event feature services<br/>Angular services"]
  node_management_routes["Management routes<br/>Angular routes"]
  node_client_auth["Client auth &amp; guards<br/>Angular auth<br/>[auth.service.ts]"]
  node_payment_ui["Payment UI<br/>Stripe client UI"]
end

subgraph group_backend["Backend API"]
  node_api_handlers{{"Event API handlers<br/>Lambda handlers<br/>[registrations.ts]"}}
  node_domain_models["Event domain models<br/>TypeScript models<br/>[session.model.ts]"]
  node_api_contract["Swagger contract<br/>OpenAPI<br/>[swagger.yaml]"]
  node_notification_flow["Email notifications<br/>SES handlers &amp; templates"]
end

subgraph group_aws["AWS platform"]
  node_cdk_entry{{"CDK deployment entry<br/>AWS CDK<br/>[main.ts]"}}
  node_api_hosting{{"API hosting<br/>AWS API &amp; Lambda<br/>[api-stack.ts]"}}
  node_cognito["Cognito identity<br/>AWS Cognito<br/>[cognito-stack.ts]"]
  node_ses["SES email<br/>AWS SES<br/>[ses-stack.ts]"]
  node_frontend_hosting["Static frontend delivery<br/>AWS hosting<br/>[front-end-stack.ts]"]
  node_media_maps["Media &amp; maps<br/>AWS infrastructure<br/>[media-stack.ts]"]
end

subgraph group_delivery["Delivery &amp; operations"]
  node_native_hosts["Android &amp; iOS hosts<br/>Capacitor native apps"]
  node_feedback_script["Session feedback script<br/>Data operation<br/>[sessionFeedback.ts]"]
end

node_client_entry -->|"bootstraps"| node_client_shell
node_client_shell -->|"applies guards"| node_client_auth
node_client_shell -->|"activates features"| node_feature_services
node_management_routes -->|"requires privileged access"| node_client_auth
node_feature_services -->|"calls event API"| node_api_handlers
node_payment_ui -->|"uses payment flow"| node_api_handlers
node_client_auth -->|"authenticates with"| node_cognito
node_api_handlers -->|"uses"| node_domain_models
node_api_handlers -.->|"publishes"| node_api_contract
node_api_handlers -->|"triggers registration updates"| node_notification_flow
node_notification_flow -->|"sends through"| node_ses
node_cdk_entry -->|"deploys"| node_api_hosting
node_cdk_entry -->|"deploys"| node_cognito
node_cdk_entry -->|"deploys"| node_ses
node_cdk_entry -->|"deploys"| node_frontend_hosting
node_cdk_entry -->|"deploys"| node_media_maps
node_api_hosting -->|"runs"| node_api_handlers
node_frontend_hosting -->|"serves"| node_client_entry
node_native_hosts -->|"packages"| node_client_entry
node_feedback_script -.->|"operates on event data"| node_api_handlers

click node_client_entry "https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/main.ts"
click node_client_shell "https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/app-routing.module.ts"
click node_feature_services "https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/tabs/sessions/sessions.service.ts"
click node_management_routes "https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/tabs/manage/manage.routing.module.ts"
click node_client_auth "https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/auth/auth.service.ts"
click node_api_handlers "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/handlers/registrations.ts"
click node_domain_models "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/models/session.model.ts"
click node_api_contract "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/swagger.yaml"
click node_notification_flow "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/handlers/sesNotifications.ts"
click node_cdk_entry "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/main.ts"
click node_api_hosting "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/api-stack.ts"
click node_cognito "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/cognito-stack.ts"
click node_ses "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/ses-stack.ts"
click node_frontend_hosting "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/front-end-stack.ts"
click node_media_maps "https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/media-stack.ts"
click node_native_hosts "https://github.com/uatisdeproblem/egm-app/blob/main/front-end/capacitor.config.ts"
click node_feedback_script "https://github.com/uatisdeproblem/egm-app/blob/main/scripts/src/sessionFeedback.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_client_entry,node_client_shell,node_feature_services,node_management_routes,node_client_auth,node_payment_ui toneBlue
class node_api_handlers,node_domain_models,node_api_contract,node_notification_flow toneAmber
class node_cdk_entry,node_api_hosting,node_cognito,node_ses,node_frontend_hosting,node_media_maps toneMint
class node_native_hosts,node_feedback_script toneRose
```

## Components

### Client app

Angular/Ionic attendee and management application.

- [SPA entry](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/main.ts): Angular bootstrap · `front-end/src/main.ts`
- [App shell & router](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/app-routing.module.ts): Angular modules · Establishes navigation, tabs, and route activation. · `front-end/src/app/app-routing.module.ts`
- [Event feature services](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/tabs/sessions/sessions.service.ts): Angular services · Loads sessions, meals, user, and management workflows. · `front-end/src/app/tabs/sessions/sessions.service.ts`
- [Management routes](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/tabs/manage/manage.routing.module.ts): Angular routes · Separates privileged event administration workflows. · `front-end/src/app/tabs/manage/manage.routing.module.ts`
- [Client auth & guards](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/src/app/auth/auth.service.ts): Angular auth · Acquires identity and protects routes. · `front-end/src/app/auth/auth.service.ts`
- **Payment UI**: Stripe client UI

### Backend API

Serverless event-domain API and notifications.

- [Event API handlers](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/handlers/registrations.ts): Lambda handlers · Serves registrations, spots, sessions, communications, and event resources. · `back-end/src/handlers/registrations.ts`
- [Event domain models](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/models/session.model.ts): TypeScript models · Persistence-facing shapes for event aggregates. · `back-end/src/models/session.model.ts`
- [Swagger contract](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/swagger.yaml): OpenAPI · `back-end/swagger.yaml`
- [Email notifications](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/src/handlers/sesNotifications.ts): SES handlers & templates · Delivers registration, assignment, release, transfer, and invoice emails. · `back-end/src/handlers/sesNotifications.ts`

### AWS platform

CDK-defined hosting and external-service boundaries.

- [CDK deployment entry](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/main.ts): AWS CDK · Composes environment-specific infrastructure stacks. · `back-end/deploy/main.ts`
- [API hosting](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/api-stack.ts): AWS API & Lambda · `back-end/deploy/api-stack.ts`
- [Cognito identity](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/cognito-stack.ts): AWS Cognito · `back-end/deploy/cognito-stack.ts`
- [SES email](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/ses-stack.ts): AWS SES · `back-end/deploy/ses-stack.ts`
- [Static frontend delivery](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/front-end-stack.ts): AWS hosting · `back-end/deploy/front-end-stack.ts`
- [Media & maps](https://github.com/uatisdeproblem/egm-app/blob/main/back-end/deploy/media-stack.ts): AWS infrastructure · Provides media storage/delivery and map-related services. · `back-end/deploy/media-stack.ts`

### Delivery & operations

Native packaging and standalone data processing.

- [Android & iOS hosts](https://github.com/uatisdeproblem/egm-app/blob/main/front-end/capacitor.config.ts): Capacitor native apps · Packages the shared web app for mobile distribution. · `front-end/capacitor.config.ts`
- [Session feedback script](https://github.com/uatisdeproblem/egm-app/blob/main/scripts/src/sessionFeedback.ts): Data operation · Standalone session-feedback processing. · `scripts/src/sessionFeedback.ts`

## Connections

- SPA entry → App shell & router: bootstraps
- App shell & router → Client auth & guards: applies guards
- App shell & router → Event feature services: activates features
- Management routes → Client auth & guards: requires privileged access
- Event feature services → Event API handlers: calls event API
- Payment UI → Event API handlers: uses payment flow
- Client auth & guards → Cognito identity: authenticates with
- Event API handlers → Event domain models: uses
- Event API handlers → Swagger contract: publishes
- Event API handlers → Email notifications: triggers registration updates
- Email notifications → SES email: sends through
- CDK deployment entry → API hosting: deploys
- CDK deployment entry → Cognito identity: deploys
- CDK deployment entry → SES email: deploys
- CDK deployment entry → Static frontend delivery: deploys
- CDK deployment entry → Media & maps: deploys
- API hosting → Event API handlers: runs
- Static frontend delivery → SPA entry: serves
- Android & iOS hosts → SPA entry: packages
- Session feedback script → Event API handlers: operates on event data
