# Project plan — unity-framework

Evidence date: 2026-09-30.

Source repository: `https://bitbucket.org/overdrive/unity-framework.git`.

Inspected revision: `master` at `c72613bec19c4f413bca5d2f4018799b24cc85dc` (2021-02-13 20:01:11 +0200, Jaco Brits, "Update amplified and helper functions"). The scan-host path `~/projects/sonar_scan/repos/unity-framework` was not on this machine. The tree was read from that git revision.

Identifier values in `src/config.js` (Cognito user pool id, app client id, identity pool id, API Gateway host) are omitted. The login form in `src/app/main/login/tabs/JWTLoginTab.js` ships with a prefilled username and password; those literals are omitted.

This plan describes what the repository contains. It does not decide what the product should become.

This repository is not the Unity game engine. It is also not `unity-skeleton`, `unity-frontend`, `unityFrontend`, `unity-lambda-api`, or `unity-lite` (separate Silicon Ark projects). This app and `unity-skeleton` both configure an Amplify API named `unity` in `eu-west-1` and an S3 bucket named `unity-app-files`. Whether they share a backend is **Unknown / Requires Confirmation**.

## Product

The browser title is **Unity - Custom , Secure framework** (`public/index.html`). The login panel brands itself **UNITY** / **REACTJS** and the heading **Welcome to Unity Framework** (`src/app/main/login/Login.js`). The shell logo text is **UNITY** (`src/app/fuse-layouts/shared-components/Logo.js`). The npm package name is `unity-react-app` at version `1.0.0`, private (`package.json`). `public/manifest.json` still says **React App** / **Create React App Sample**.

It is a Create React App single-page application built on the Fuse React admin template (`LICENSE` is the ThemeForest regular-license URL; image credits in `CREDITS`). Sign-in uses Amazon Cognito through AWS Amplify, then loads one user row from an HTTP API named `unity` and stores the role string `superuser`. The user list calls that API. Creating, updating, and deleting users, plus session restore after a refresh, still go through the Fuse axios mock in `src/@fake-db`. The rest of the Fuse demo apps (dashboards, mail, calendar, e-commerce, and others) remain registered and read that mock.

Provenance: **Implemented** in the files named above. **Documented** in `README.md` only as stock Create React App script help. The README does not mention Unity, Cognito, or user management. No formal project plan existed in the repository or in `silicon_ark/unity-framework/` before this file.

## Branch reality

| Line | Tip | Date | What it is |
|---|---|---|---|
| `master` (default; `origin/HEAD`) | `c72613b` | 2021-02-13 | The only branch. Fuse React shell, Cognito sign-in, user-management screens, local mock database |

There are no other remote branches. History is 24 commits, all by Jaco Brits, from `df832d5` (2021-01-08, "Initial commit") to `c72613b`. Whether any deployed site still serves this tree is **Unknown / Requires Confirmation**.

## Objectives (inferred from the screens and commit subjects, not from a written plan)

No project plan or requirements document exists in the repository. The following objectives are **Inferred** from routes, the login copy, and commit subjects between 2021-01-08 and 2021-02-13:

- Provide a branded admin shell called Unity Framework that can host modules.
- Sign a person in through Cognito, then load their row from the `unity` API.
- List users from that API and open a profile with details, access-control checkboxes, and theme controls.
- Keep the Fuse demo applications in the navigation while user management was being built.

The `README.md` still describes only `yarn start`, `yarn test`, `yarn run build`, and `yarn run eject`. It is **stale relative to the implementation**.

## Scope

### In the committed tree

- React 17 SPA, Create React App `react-scripts` 3.4.4, started with `yarn start` (Tailwind build, then the dev server on port 3000 per the README).
- Fuse layouts, navigation, theme settings, and the stock demo apps under `src/app/main/apps` and `src/app/main/pages`.
- Cognito Auth, S3 storage, and an API endpoint named `unity`, configured in `src/index.js` from `src/config.js`. Region in that file is `eu-west-1`. S3 bucket name is `unity-app-files`.
- User Management at `/apps/users`, profile at `/apps/users/profile/:id`.
- Axios mock database imported from `src/app/App.js` (`@fake-db`), with `mock.onAny().passThrough()`.

### Not in the committed tree

- No `Dockerfile`, `bitbucket-pipelines.yml`, serverless template, or hosting config.
- No `*.test.js` / `*.spec.js` files. `package.json` still has `"test": "react-scripts test --env=node"`.
- `nav.json` at the repository root is an empty file (0 bytes).
- `sonar-project.properties` and `sonarqube_scan.bat` were listed in the task's scan-host snapshot (2026-09-28). They are not in `c72613b`. Whether they exist only as untracked files on the scan host is **Unknown / Requires Confirmation**.
- No Redux saga layer and no redux-persist. State is in-memory Redux Toolkit slices.

## System architecture

```text
Browser (CRA + Fuse React)
  ├─ Amplify Auth  → Cognito user pool (eu-west-1)     sign-in only
  ├─ Amplify API   → API named "unity" (eu-west-1)     user list, uuid lookup, get user
  ├─ Amplify Storage → S3 bucket unity-app-files       configured, no Storage calls in src
  └─ axios + @fake-db mock
        ├─ session restore  GET /api/auth/access-token
        ├─ register         POST /api/auth/register
        ├─ user CRUD        POST /api/users-app/*
        └─ demo apps        their /api/* handlers
```

The shell navigation is `src/app/fuse-configs/navigationConfig.js` (loaded by `src/app/store/fuse/navigationSlice.js`). A second, shorter tree in `src/app/fuse-configs/appConfig.js` is used only by the access-control UI. It is not the live menu.

Default route auth is `null`, which `FuseUtils.hasPermission` treats as allow-everyone. `/` redirects to `/login`. Unmatched paths redirect to `/pages/errors/error-404`. After a successful Cognito sign-in, `setUserData` writes `history.location.state.redirectUrl` to `/apps/dashboards/analytics`.

## Major components

| Component | Location | Role |
|---|---|---|
| Amplify bootstrap | `src/index.js`, `src/config.js` | Cognito, S3, API named `unity` |
| Auth gate | `src/app/auth/Auth.js`, `src/app/services/jwtService/jwtService.js` | Splash, token in `localStorage`, Cognito sign-in, mock token refresh |
| Route table | `src/app/fuse-configs/routesConfig.js` | Demo apps plus login, register, logout |
| User list | `src/app/main/apps/users/` | List, search, new-user dialog, profile |
| Unity HTTP helper | `src/app/helper/unityRequests.js` | POST helper used by the user list |
| Mock database | `src/@fake-db/` | Fuse demo data and user/auth mutations |
| Access-control UI | `tabs/AccessControlTab.js`, `SecurityDialog.js` | View/Add/Edit/Delete checkboxes over nav items |

## Milestones visible in git (historical, not a forward plan)

| When | Commit | What landed |
|---|---|---|
| 2021-01-08 | `df832d5`, `8064741` | Initial Fuse tree and first user-management screens |
| 2021-01-09 to 2021-01-22 | `f7f5889` … `37f09d9` | User dialogs, security dialog, profile page, auth cleanup |
| 2021-01-25 to 2021-01-29 | `299236c` … `2c376ea` | Profile tabs, Cognito config, `src/config.js` |
| 2021-01-31 to 2021-02-01 | `e50c0b8`, `c6bad31` | Amplify sign-in path, extra login files under `users/login` |
| 2021-02-03 to 2021-02-13 | `29b16f9` … `c72613b` | Helper `unityRequests`, list wired to `/unity/getusers/1` |

No commit after 2021-02-13 is on `master`. A forward roadmap is **Unknown / Requires Confirmation**.

## Known dependencies

- Node toolchain implied by Yarn (`yarn.lock` and `package-lock.json` are both committed) and `react-scripts` 3.4.4.
- Runtime libraries that the custom path actually calls: `aws-amplify` ^3.3.16, `react` 17.0.1, `@reduxjs/toolkit` 1.5.0, `axios` 0.21.0, `axios-mock-adapter` 1.19.0, `@material-ui/core` 4.11.1, `react-router-dom` 5.2.0.
- Also declared, and present as Fuse demo code: Auth0 Lock, Firebase 8, chart.js, form libraries. Firebase and Auth0 config objects are commented placeholders (`firebaseServiceConfig.js`, `auth0ServiceConfig.js`). Their startup checks in `Auth.js` are commented out.
- External systems: Cognito, API Gateway (host omitted), S3 bucket `unity-app-files`. No queue, worker, or database client is in this repository. The API's datastore is **Unknown / Requires Confirmation**.

## Current project status

**Dormant source tree.** Last change 2021-02-13. User list and sign-in reach the `unity` API. User create/update/delete, register, and token refresh still use the in-browser mock. Access-control checkboxes do not persist. There is no deployment description in git.

The task snapshot's Sonar files are absent from this revision. Treat any Sonar project key or scan script as **Unknown** until someone confirms the scan-host working tree.
