# hericoelho/stack-project architecture

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

- Interactive diagram: https://gitdiagram.com/hericoelho/stack-project
- Repository: https://github.com/hericoelho/stack-project

## Overview

mySystem is an activity-management product: browser users create and list activities, while status changes can reach clients as live notifications. The documented primary stack is React host/remote → NestJS BFF → Spring API → MongoDB; the tree also contains an Angular host/remote implementation. The graph captures those frontends, request handling, persistence, and event delivery. Several Spring use-case and event-wiring details are unsampled, so uncertain links are omitted or marked unverified rather than inferred as confirmed calls.

Main entry points: [`backSpring/src/main/java/com/coelho/back/infrastructure/adapters/in/web/controller/ActivityController.java`](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/infrastructure/adapters/in/web/controller/ActivityController.java) (Activity REST API), [`backSpring/src/main/java/com/coelho/back/infrastructure/adapters/out/database/ActivityRepositoryAdapter.java`](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/infrastructure/adapters/out/database/ActivityRepositoryAdapter.java) (Activity repository adapter), [`bff-nest-js/src/activities/activities.controller.ts`](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities.controller.ts) (Activity HTTP routes), [`backSpring/src/main/java/com/coelho/back/application/usecase/UpdateActivityStatusUseCaseImpl.java`](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/UpdateActivityStatusUseCaseImpl.java) (Status transition use case)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web frontends"]
  node_react_host["React host<br/>[App.tsx]"]
  node_react_remote["React activity remote<br/>[RemoteAppEntry.tsx]"]
  node_react_hooks["Activity hooks"]
  node_react_sse["SSE notifications"]
  node_angular_host["Angular host<br/>[app.routes.ts]"]
  node_angular_remote["Angular activity remote<br/>[app.routes.ts]"]
  node_angular_services["Angular activity services"]
end

subgraph group_bff["BFF and events"]
  node_bff_controller["Activity HTTP routes"]
  node_bff_service["Activity service"]
  node_spring_client["Spring HTTP client"]
  node_rabbit_consumer["RabbitMQ consumer"]
  node_event_service["Activity event stream"]
  node_sse_route["SSE route"]
  node_rabbit["RabbitMQ"]
end

subgraph group_backend["Activity API"]
  node_spring_controller["Activity REST API"]
  node_activity_domain["Activity model<br/>[Activity.java]"]
  node_create_usecase["Create activity use case"]
  node_list_usecase["List activities use case"]
  node_status_usecase["Status transition use case"]
end

subgraph group_storage["Persistence"]
  node_repository_adapter["Activity repository adapter"]
  node_mongo[("MongoDB")]
end

node_user(("Browser user"))

node_user -->|"opens app"| node_react_host
node_react_host -->|"loads remote"| node_react_remote
node_user -.->|"opens app"| node_angular_host
node_angular_host -->|"loads remote"| node_angular_remote
node_react_remote -.->|"uses activity hooks"| node_react_hooks
node_react_hooks -.->|"HTTP requests"| node_bff_controller
node_angular_remote -.->|"uses services"| node_angular_services
node_angular_services -.->|"HTTP requests"| node_bff_controller
node_bff_controller -->|"delegates"| node_bff_service
node_bff_service -->|"calls backend client"| node_spring_client
node_spring_client -->|"HTTP create/list"| node_spring_controller
node_spring_controller -.->|"executes create"| node_create_usecase
node_spring_controller -.->|"executes list"| node_list_usecase
node_create_usecase -.->|"saves activity"| node_repository_adapter
node_list_usecase -.->|"reads activities"| node_repository_adapter
node_status_usecase -.->|"updates activity"| node_repository_adapter
node_repository_adapter -.->|"persists documents"| node_mongo
node_spring_controller -->|"maps activity"| node_activity_domain
node_rabbit -.->|"delivers status messages"| node_rabbit_consumer
node_rabbit_consumer -->|"emits events"| node_event_service
node_sse_route -->|"streams events"| node_event_service
node_react_sse -.->|"subscribes SSE"| node_sse_route
node_status_usecase -.->|"publishes status change"| node_rabbit

click node_react_host "https://github.com/hericoelho/stack-project/blob/main/frontReact/core-app/src/App.tsx"
click node_react_remote "https://github.com/hericoelho/stack-project/blob/main/frontReact/remote-app/src/RemoteAppEntry.tsx"
click node_react_hooks "https://github.com/hericoelho/stack-project/blob/main/frontReact/remote-app/src/pages/activities/hooks/useCreateActivity.hook.ts"
click node_react_sse "https://github.com/hericoelho/stack-project/blob/main/frontReact/remote-app/src/pages/activities/hooks/useSseNotifications.hook.ts"
click node_angular_host "https://github.com/hericoelho/stack-project/blob/main/frontAngular/core-app/src/app/app.routes.ts"
click node_angular_remote "https://github.com/hericoelho/stack-project/blob/main/frontAngular/remote-app/src/app/app.routes.ts"
click node_angular_services "https://github.com/hericoelho/stack-project/blob/main/frontAngular/remote-app/src/app/core/services/activities.service.ts"
click node_bff_controller "https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities.controller.ts"
click node_bff_service "https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities.service.ts"
click node_spring_client "https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/client/back-spring-microservice.client.ts"
click node_rabbit_consumer "https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/rabbitmq/rabbitmq.service.ts"
click node_event_service "https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/events/activity-event.service.ts"
click node_sse_route "https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities-sse.controller.ts"
click node_spring_controller "https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/infrastructure/adapters/in/web/controller/ActivityController.java"
click node_activity_domain "https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/domain/model/Activity.java"
click node_create_usecase "https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/CreateActivityUseCaseImpl.java"
click node_list_usecase "https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/ListActivitiesUseCaseImpl.java"
click node_status_usecase "https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/UpdateActivityStatusUseCaseImpl.java"
click node_repository_adapter "https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/infrastructure/adapters/out/database/ActivityRepositoryAdapter.java"

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_react_host,node_react_remote,node_react_hooks,node_react_sse,node_angular_host,node_angular_remote,node_angular_services,node_user toneBlue
class node_bff_controller,node_bff_service,node_spring_client,node_rabbit_consumer,node_event_service,node_sse_route,node_rabbit toneAmber
class node_spring_controller,node_activity_domain,node_create_usecase,node_list_usecase,node_status_usecase toneMint
class node_repository_adapter,node_mongo toneRose
```

## Components

### Web frontends

- [React host](https://github.com/hericoelho/stack-project/blob/main/frontReact/core-app/src/App.tsx): `frontReact/core-app/src/App.tsx`
- [React activity remote](https://github.com/hericoelho/stack-project/blob/main/frontReact/remote-app/src/RemoteAppEntry.tsx): `frontReact/remote-app/src/RemoteAppEntry.tsx`
- [Activity hooks](https://github.com/hericoelho/stack-project/blob/main/frontReact/remote-app/src/pages/activities/hooks/useCreateActivity.hook.ts): `frontReact/remote-app/src/pages/activities/hooks/useCreateActivity.hook.ts`
- [SSE notifications](https://github.com/hericoelho/stack-project/blob/main/frontReact/remote-app/src/pages/activities/hooks/useSseNotifications.hook.ts): `frontReact/remote-app/src/pages/activities/hooks/useSseNotifications.hook.ts`
- [Angular host](https://github.com/hericoelho/stack-project/blob/main/frontAngular/core-app/src/app/app.routes.ts): `frontAngular/core-app/src/app/app.routes.ts`
- [Angular activity remote](https://github.com/hericoelho/stack-project/blob/main/frontAngular/remote-app/src/app/app.routes.ts): `frontAngular/remote-app/src/app/app.routes.ts`
- [Angular activity services](https://github.com/hericoelho/stack-project/blob/main/frontAngular/remote-app/src/app/core/services/activities.service.ts): `frontAngular/remote-app/src/app/core/services/activities.service.ts`

### BFF and events

- [Activity HTTP routes](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities.controller.ts): `bff-nest-js/src/activities/activities.controller.ts`
- [Activity service](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities.service.ts): `bff-nest-js/src/activities/activities.service.ts`
- [Spring HTTP client](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/client/back-spring-microservice.client.ts): `bff-nest-js/src/activities/client/back-spring-microservice.client.ts`
- [RabbitMQ consumer](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/rabbitmq/rabbitmq.service.ts): `bff-nest-js/src/activities/rabbitmq/rabbitmq.service.ts`
- [Activity event stream](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/events/activity-event.service.ts): `bff-nest-js/src/activities/events/activity-event.service.ts`
- [SSE route](https://github.com/hericoelho/stack-project/blob/main/bff-nest-js/src/activities/activities-sse.controller.ts): `bff-nest-js/src/activities/activities-sse.controller.ts`
- **RabbitMQ**

### Activity API

- [Activity REST API](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/infrastructure/adapters/in/web/controller/ActivityController.java): `backSpring/src/main/java/com/coelho/back/infrastructure/adapters/in/web/controller/ActivityController.java`
- [Activity model](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/domain/model/Activity.java): `backSpring/src/main/java/com/coelho/back/domain/model/Activity.java`
- [Create activity use case](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/CreateActivityUseCaseImpl.java): `backSpring/src/main/java/com/coelho/back/application/usecase/CreateActivityUseCaseImpl.java`
- [List activities use case](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/ListActivitiesUseCaseImpl.java): `backSpring/src/main/java/com/coelho/back/application/usecase/ListActivitiesUseCaseImpl.java`
- [Status transition use case](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/application/usecase/UpdateActivityStatusUseCaseImpl.java): `backSpring/src/main/java/com/coelho/back/application/usecase/UpdateActivityStatusUseCaseImpl.java`

### Persistence

- [Activity repository adapter](https://github.com/hericoelho/stack-project/blob/main/backSpring/src/main/java/com/coelho/back/infrastructure/adapters/out/database/ActivityRepositoryAdapter.java): `backSpring/src/main/java/com/coelho/back/infrastructure/adapters/out/database/ActivityRepositoryAdapter.java`
- **MongoDB**

### Other components

- **Browser user**

## Connections

- Browser user → React host: opens app (evidence: `frontReact/core-app/src/App.tsx`)
- React host → React activity remote: loads remote (evidence: `frontReact/core-app/src/App.tsx`)
- Browser user → Angular host: opens app
- Angular host → Angular activity remote: loads remote (evidence: `frontAngular/core-app/src/app/app.routes.ts`)
- React activity remote → Activity hooks: uses activity hooks
- Activity hooks → Activity HTTP routes: HTTP requests
- Angular activity remote → Angular activity services: uses services
- Angular activity services → Activity HTTP routes: HTTP requests
- Activity HTTP routes → Activity service: delegates (evidence: `bff-nest-js/src/activities/activities.controller.ts`)
- Activity service → Spring HTTP client: calls backend client (evidence: `bff-nest-js/src/activities/activities.service.ts`)
- Spring HTTP client → Activity REST API: HTTP create/list (evidence: `bff-nest-js/src/activities/client/back-spring-microservice.client.ts`)
- Activity REST API → Create activity use case: executes create
- Activity REST API → List activities use case: executes list
- Create activity use case → Activity repository adapter: saves activity
- List activities use case → Activity repository adapter: reads activities
- Status transition use case → Activity repository adapter: updates activity
- Activity repository adapter → MongoDB: persists documents
- Activity REST API → Activity model: maps activity (evidence: `backSpring/src/main/java/com/coelho/back/infrastructure/adapters/in/web/controller/ActivityController.java`)
- RabbitMQ → RabbitMQ consumer: delivers status messages
- RabbitMQ consumer → Activity event stream: emits events (evidence: `bff-nest-js/src/activities/rabbitmq/rabbitmq.service.ts`)
- SSE route → Activity event stream: streams events (evidence: `bff-nest-js/src/activities/activities-sse.controller.ts`)
- SSE notifications → SSE route: subscribes SSE
- Status transition use case → RabbitMQ: publishes status change
