# aot-technologies/forms-flow-ai-micro-front-ends architecture

> Architecture diagram of the GitHub repository aot-technologies/forms-flow-ai-micro-front-ends, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aot-technologies/forms-flow-ai-micro-front-ends
- Repository: https://github.com/aot-technologies/forms-flow-ai-micro-front-ends

## Overview

1. This repository is a micro-frontend suite for formsflow.ai, not a single app. Each top-level package under `forms-flow-*` is a separately built and deployed frontend module, and the whole system is composed at runtime by a `single-spa` shell that lives in the separate `formsflow.ai` repo.

2. The composition boundary is the navbar and router shell. `forms-flow-nav` is the global chrome: it owns top-level navigation, route selection, language switching, and login/logout entry points. It also contains shared access helpers and user/tenant/permission services that shape what the user can see.

3. `forms-flow-service` is the shared runtime library used by the other MFEs. It centralizes authentication plumbing, Keycloak integration, request/storage helpers, router utilities, and shared i18n/resource bundles. In architecture terms, this is the common infrastructure layer rather than a user-facing app.

4. `forms-flow-theme` is the shared styling layer. It is a SCSS-based design system with variables, mixins, and component-specific style partials. All other frontends depend on it for consistent look-and-feel and theme customization via CSS variables.

5. `forms-flow-components` is the reusable UI toolkit. It contains a large catalog of generic controls, modals, tables, filters, uploaders, and utility hooks, plus Storybook and component tests. Other MFEs import from here instead of duplicating UI logic, so it sits between the theme/service layers and the app-specific screens.

6. `forms-flow-admin` is the administration workspace. Its feature boundary is role/user/dashboard management, with screens for organizations, plans, roles, users, and billing-related flows. It has its own service layer for dashboard/roles/users and is intended to be visible only to users with the `formsflow-admin` role.

7. `forms-flow-review` is the reviewer/work-queue application. It handles task listing, task details, filtering, assignment, history, and task-related modals. Its architecture is more stateful than the admin app: it includes Redux reducers, action creators, socket-based updates, and task-specific API services for BPM task interaction and filtering.

8. `forms-flow-submissions` is the submissions analysis workspace. It focuses on submission lists, submission views, bundle/analyze flows, filter management, and submission history. Like the review app, it uses reducers, actions, and query/service layers, but its domain is submission analytics rather than task execution.

9. `forms-flow-integration` is the integrations marketplace/admin area. Its screens are organized around connected apps, recipes, library, and premium subscription messaging, indicating a feature boundary for configuring and browsing third-party integrations rather than core workflow tasks.

10. `forms-flow-service` underpins the main data flow to external systems. From the file tree it explicitly integrates with Keycloak, Form.io role services, storage services, request handling, and router helpers. The other apps call into this shared module to authenticate, fetch data, persist artifacts, and localize UI strings.

11. The request/data path is generally: user interaction in a module-specific screen -> app-local service/action layer -> shared service helpers or direct API endpoint config -> external backend systems such as auth, storage, task, submission, or integration APIs. Review also has a realtime path via `SocketIOService`, which suggests push-based updates for task state.

12. Each app is independently packaged and containerized. The presence of per-module `package.json`, `webpack.config.js`, `Dockerfile`, `nginx.conf`, and `docker-compose.yaml` files shows that every micro frontend can be built, tested, and served separately, with CI/CD workflows per module in `.github/workflows`.

13. Tooling is consistent across the suite: React 17, TypeScript/JavaScript mixed by module, webpack bundling, Jest-based tests, ESLint/Prettier, and Storybook for the component library. The architecture diagram should reflect shared libraries at the center, domain MFEs around them, and the external shell/backend services at the edges.

Main entry points: [`forms-flow-theme/scss/index.scss`](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-theme/scss/index.scss) (Theme), [`forms-flow-service/src/formsflow-services.ts`](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-service/src/formsflow-services.ts) (Service layer), [`forms-flow-components/src/components/index.ts`](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-components/src/components/index.ts) (Components), [`forms-flow-admin/src/formsflow-admin.tsx`](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-admin/src/formsflow-admin.tsx) (Admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared layers"]
  node_nav["Navbar<br/>chrome MFE<br/>[Navbar.jsx]"]
  node_service["Service layer<br/>shared runtime"]
  node_theme["Theme<br/>SCSS system<br/>[index.scss]"]
  node_components["Components<br/>UI toolkit<br/>[index.ts]"]
end

subgraph group_apps["Domain apps"]
  node_admin["Admin<br/>workspace MFE"]
  node_adminsvc["Admin services<br/>domain services<br/>[index.ts]"]
  node_review["Review<br/>workspace MFE"]
  node_reviewstate["Review state<br/>redux/socket layer<br/>[index.ts]"]
  node_reviewsvc["Review services<br/>task APIs<br/>[bpmTaskServices.ts]"]
  node_subs["Submissions<br/>workspace MFE"]
  node_subsstate["Submissions state<br/>redux/query layer"]
  node_subssvc["Submission services<br/>analysis APIs"]
  node_integration["Integration<br/>workspace MFE"]
  node_intsvc["Integration services<br/>integration APIs<br/>[index.ts]"]
end

subgraph group_external["External systems"]
  node_shell["single-spa shell<br/>external composer"]
  node_keycloak["Keycloak<br/>auth backend"]
  node_backends["Workflow APIs<br/>backend systems"]
  node_storage[("Storage<br/>artifact backend")]
end

node_shell -->|"mounts"| node_nav
node_shell -->|"mounts"| node_admin
node_shell -->|"mounts"| node_review
node_shell -->|"mounts"| node_subs
node_shell -->|"mounts"| node_integration
node_nav -->|"uses"| node_service
node_nav -->|"auth"| node_keycloak
node_nav -->|"profile/perm"| node_backends
node_admin -->|"calls"| node_adminsvc
node_admin -->|"renders"| node_components
node_admin -->|"styles"| node_theme
node_review -->|"coordinates"| node_reviewstate
node_review -->|"calls"| node_reviewsvc
node_review -->|"renders"| node_components
node_reviewstate -->|"task data"| node_backends
node_reviewstate -->|"uses"| node_service
node_subs -->|"coordinates"| node_subsstate
node_subs -->|"calls"| node_subssvc
node_subs -->|"renders"| node_components
node_integration -->|"calls"| node_intsvc
node_integration -->|"renders"| node_components
node_service -->|"integrates"| node_keycloak
node_service -->|"persists"| node_storage
node_service -->|"requests"| node_backends
node_components -->|"depends on"| node_service
node_theme -->|"skins"| node_components
node_theme -->|"skins"| node_admin
node_theme -->|"skins"| node_review
node_theme -->|"skins"| node_subs
node_theme -->|"skins"| node_integration

click node_nav "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-nav/src/Navbar.jsx"
click node_service "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-service/src/formsflow-services.ts"
click node_theme "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-theme/scss/index.scss"
click node_components "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-components/src/components/index.ts"
click node_admin "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-admin/src/formsflow-admin.tsx"
click node_adminsvc "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-admin/src/services/dashboard/index.ts"
click node_review "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-review/src/formsflow-review.tsx"
click node_reviewstate "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-review/src/reducers/index.ts"
click node_reviewsvc "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-review/src/api/services/bpmTaskServices.ts"
click node_subs "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-submissions/src/formsflow-submissions.tsx"
click node_subsstate "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-submissions/src/react-query-client.ts"
click node_subssvc "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-submissions/src/services/applicationServices.ts"
click node_integration "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-integration/src/formsflow-integration.tsx"
click node_intsvc "https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-integration/src/services/integration/index.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_nav,node_service,node_theme,node_components toneBlue
class node_admin,node_adminsvc,node_review,node_reviewstate,node_reviewsvc,node_subs,node_subsstate,node_subssvc,node_integration,node_intsvc toneAmber
class node_shell,node_keycloak,node_backends,node_storage toneMint
```

## Components

### Shared layers

Common runtime, UI, and styling libraries used across MFEs

- [Navbar](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-nav/src/Navbar.jsx): chrome MFE · Global navigation, route selection, language switching, and login/logout entry points · `forms-flow-nav/src/Navbar.jsx`
- [Service layer](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-service/src/formsflow-services.ts): shared runtime · Common authentication, Keycloak, request/storage, router, and i18n helpers · `forms-flow-service/src/formsflow-services.ts`
- [Theme](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-theme/scss/index.scss): SCSS system · Shared styling layer with variables, mixins, and component/theme partials · `forms-flow-theme/scss/index.scss`
- [Components](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-components/src/components/index.ts): UI toolkit · Reusable controls, modals, tables, filters, uploaders, hooks, and Storybook catalog · `forms-flow-components/src/components/index.ts`

### Domain apps

Independently built micro-frontends for specific formflow workspaces

- [Admin](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-admin/src/formsflow-admin.tsx): workspace MFE · Administration screens for organizations, plans, roles, users, and billing flows · `forms-flow-admin/src/formsflow-admin.tsx`
- [Admin services](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-admin/src/services/dashboard/index.ts): domain services · Admin-specific dashboard, roles, and users service layer · `forms-flow-admin/src/services/dashboard/index.ts`
- [Review](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-review/src/formsflow-review.tsx): workspace MFE · Reviewer work-queue app for task listing, details, filtering, assignment, and history · `forms-flow-review/src/formsflow-review.tsx`
- [Review state](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-review/src/reducers/index.ts): redux/socket layer · Task reducers, actions, store services, and realtime SocketIO updates · `forms-flow-review/src/reducers/index.ts`
- [Review services](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-review/src/api/services/bpmTaskServices.ts): task APIs · BPM task, filter, formatter, and user service adapters · `forms-flow-review/src/api/services/bpmTaskServices.ts`
- [Submissions](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-submissions/src/formsflow-submissions.tsx): workspace MFE · Submission analysis app for lists, views, bundle/analyze flows, filters, and history · `forms-flow-submissions/src/formsflow-submissions.tsx`
- [Submissions state](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-submissions/src/react-query-client.ts): redux/query layer · Reducers, actions, and React Query client for submission workflows · `forms-flow-submissions/src/react-query-client.ts`
- [Submission services](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-submissions/src/services/applicationServices.ts): analysis APIs · Application, process, and submission query/service adapters · `forms-flow-submissions/src/services/applicationServices.ts`
- [Integration](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-integration/src/formsflow-integration.tsx): workspace MFE · Marketplace/admin area for connected apps, recipes, library, and premium messaging · `forms-flow-integration/src/formsflow-integration.tsx`
- [Integration services](https://github.com/aot-technologies/forms-flow-ai-micro-front-ends/blob/develop/forms-flow-integration/src/services/integration/index.ts): integration APIs · Connected apps, recipes, library, and integration service adapters · `forms-flow-integration/src/services/integration/index.ts`

### External systems

Runtime shell and backend services outside this repository

- **single-spa shell**: external composer · Runtime composition boundary that mounts the MFEs in the separate formsflow.ai repo
- **Keycloak**: auth backend · Identity provider used for authentication and session plumbing
- **Workflow APIs**: backend systems · Task, submission, integration, Form.io, tenant, and role backends consumed by the MFEs
- **Storage**: artifact backend · Persisted file and asset storage used by shared services and upload flows

## Connections

- single-spa shell → Navbar: mounts · Shell composes the global navigation chrome
- single-spa shell → Admin: mounts · Shell loads the admin MFE at runtime
- single-spa shell → Review: mounts · Shell loads the reviewer MFE at runtime
- single-spa shell → Submissions: mounts · Shell loads the submissions MFE at runtime
- single-spa shell → Integration: mounts · Shell loads the integrations MFE at runtime
- Navbar → Service layer: uses · Navigation reuses shared auth, routing, and localization helpers
- Navbar → Keycloak: auth · Login and session handling are mediated through shared identity plumbing
- Navbar → Workflow APIs: profile/perm · Navigation fetches user, tenant, permission, and integration state
- Admin → Admin services: calls · Admin screens delegate to domain service adapters
- Admin → Components: renders · Admin UI reuses shared controls and modal patterns
- Admin → Theme: styles · Admin consumes shared SCSS theme and variables
- Review → Review state: coordinates · Review screens are driven by reducers, actions, and realtime state
- Review → Review services: calls · Task listing and task detail flows use BPM/filter services
- Review → Components: renders · Review uses reusable table, modal, and selection components
- Review state → Workflow APIs: task data · Review state syncs with task and tenant backend APIs
- Review state → Service layer: uses · State layer depends on shared request and router utilities
- Submissions → Submissions state: coordinates · Submission screens are driven by reducers, actions, and query client
- Submissions → Submission services: calls · Submission analysis flows use application and process services
- Submissions → Components: renders · Submission UI reuses shared table, modal, and filter components
- Integration → Integration services: calls · Integration screens delegate to domain service adapters
- Integration → Components: renders · Integration UI reuses shared controls and layouts
- Service layer → Keycloak: integrates · Shared service layer centralizes authentication with Keycloak
- Service layer → Storage: persists · Shared helpers abstract artifact storage and download/upload flows
- Service layer → Workflow APIs: requests · Shared request and API helpers speak to core backend services
- Components → Service layer: depends on · Reusable components import shared runtime helpers and API mocks
- Theme → Components: skins · Theme provides styling primitives for the UI toolkit
- Theme → Admin: skins · Admin screens inherit the shared design system
- Theme → Review: skins · Review screens inherit the shared design system
- Theme → Submissions: skins · Submission screens inherit the shared design system
- Theme → Integration: skins · Integration screens inherit the shared design system
