# Project plan — DoctorX_Josh

Evidence date: 2026-10-16.

Source repository: `git@bitbucket.org:overdrive/doctorx_josh.git`.

Inspected revision: `master` at `01973b1` (2021-05-04, Joshua Gatley-Dewing, "lambda issues"). The scan-host path `~/projects/sonar_scan/repos/DoctorX_Josh` was not on this machine. The tree below was read from that git revision.

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

There is no product requirements document in the source repository and no prior Silicon Ark set for this directory. `README.md` titles the app "Unity - Lite Demo" and says "Doctor X is a demo xray evaluation application". `public/index.html` sets the title "Doctor X". `public/manifest.json` sets `name` to "Doctor X by Josh". `package.json` name is `doctorx_josh`, version `0.1.0`, `private: true`.

## Product

**Documented** in `README.md`: a demo X-ray evaluation application that uses Amplify and Lambda. The same file lists the TODO "just about everything".

**Inferred** from the screens that remain on `master`: a signed-in doctor can open a diagnosis form, edit their own profile, and — when the stored role intersects `SUPER_ADMIN` — list and edit doctor rows. Registration, login, and password reset go through Amazon Cognito. Doctor rows are read and written through an API Gateway endpoint named `unity`.

**Implemented.** Create React App UI under `src/`. Calendar Lambda handlers that arrived in `77de4c8` were deleted in `b0527bc` the same day and are not on the tip.

No written statement of product owner, audience, success criteria, or a release plan was found beyond the README TODO.

## Branch reality

| Line | Tip | Date | What it is |
|---|---|---|---|
| `master` (default; `origin/HEAD`) | `01973b1` | 2021-05-04 | Only branch. 32 commits from 2021-03-16 to 2021-05-04 |

No other local or remote branches were present at inspection. Nothing in git is dated after 2021-05-04. Whether the UI is still deployed is **Unknown / Requires Confirmation**.

The only author on that history is Joshua Gatley-Dewing (`joshua@overdrive.co.za` on `01973b1`).

| Commit | Date | Subject | What it changed for this plan |
|---|---|---|---|
| `e275c96` | 2021-03-16 | Initial commit | Bitbucket README template and `.gitignore` only |
| `77de4c8` | 2021-03-17 | Initial Commit | React app, Amplify config, calendar Lambda files under `lambda/` |
| `b0527bc` | 2021-03-17 | Removes Lambdas | Deletes the four calendar Lambda files |
| `c60d54b` | 2021-03-18 | Login, forgotPassword and register changes | Auth screens start to replace the starter |
| `1970331` | 2021-03-24 | Warning fixes, Users changes, and Diagnosis page | Diagnosis and users work lands |
| `01973b1` | 2021-05-04 | lambda issues | API Gateway host changes. Register lookup path becomes `/josh/getuuid/` |

## Objectives

No objectives file exists. The behaviour the tip leaves in place:

1. Show a public landing page with Login and Register links.
2. Register a Cognito user, confirm an emailed code, then create or update a doctor row.
3. Sign in with email and password, refuse an unverified email, and store role plus doctor details in `localStorage`.
4. After a verified sign-in, stamp `dtLastLoggedIn` through `/josh/update/`.
5. Gate `/app/*` on the presence of `localStorage.roles`.
6. Show Home, Diagnosis, and My Profile to a signed-in user. Show Users only when the stored role intersects `SUPER_ADMIN`.
7. Post a diagnosis form to `/josh/diagnose`.
8. Let a super admin list doctors and open an add/edit dialog.

The README TODO says the rest is unfinished. That matches the diagnosis selects, which contain only placeholder options.

## Scope

### In scope of `master` at `01973b1`

- Create React App (`react-scripts` 3.0.1) with `react-router-dom` 5.
- Public routes: `/` (landing), `/login`, `/register`, `/forgot-password`.
- Private routes under `/app`: `/home`, `/diagnosis`, `/users`, `/profile`.
- Amplify Auth (Cognito), Storage config (S3), and one API endpoint named `unity`.
- Client calls listed in `features.md` and `technical-documentation.md`.
- Role names `SUPER_ADMIN` and `DOCTOR` in `src/config/Roles.js`.
- One Jest smoke test, `src/App.test.js`.
- Storybook npm scripts and two `*.stories.js` files. No `.storybook` directory is in git.

### Out of scope / not in this repository

- The API implementation. This tree only calls it. Silicon Ark directory `DoctorX_lambda_api_Josh` documents a Serverless service whose route strings match these calls. Whether the deployed API `nhyfbveswk` is that service is **Unknown / Requires Confirmation**.
- The MySQL database, Cognito user pool configuration (password policy, MFA, hosted UI), and the S3 bucket contents.
- A pipeline, Dockerfile, hosting target, or custom domain. None are in git.
- Real environment files. AWS ids are hard-coded in `src/aws-config.js`. No `.env` is tracked.
- `sonar-project.properties` and `sonarqube_scan.bat`. The onboarding issue listed both in the scan-host working tree on 2026-09-28. Neither file is in `git ls-files` at `01973b1`. They were not read.

## Architecture

```text
Browser
  └─ Doctor X (Create React App)
       ├─ Public routes (landing, login, register, forgot password)
       ├─ Private /app routes, filtered by localStorage roles
       ├─ Amplify Auth → Cognito user pool in eu-west-1
       ├─ Amplify API name "unity"
       │    └─ https://nhyfbveswk.execute-api.eu-west-1.amazonaws.com/prod
       │         └─ POST /josh/getuuid, /josh/create, /josh/update,
       │            /josh/get, /josh/getusers, /josh/diagnose
       └─ Amplify Storage config → S3 bucket unity-lite-files
            (no Storage.get / Storage.put call in src/)
```

`src/components/unityRequests.js` is the only HTTP helper. It posts a JSON body unless `action` is `"get"`. Every call site uses the default, so every doctor and diagnosis call is `API.post`.

## Milestones

No milestone document exists. The git history is the only sequence:

1. **2021-03-16** — empty Bitbucket README.
2. **2021-03-17** — Unity-lite-shaped React app plus four calendar Lambdas, then those Lambdas removed.
3. **2021-03-18 to 2021-03-26** — login, registration, password reset, users, diagnosis.
4. **2021-03-29 to 2021-04-14** — request methods, column names, and Lambda-facing fixes (subjects only; this plan does not restate every diff).
5. **2021-05-04** — API host changed from `2dg2tax5pg` to `nhyfbveswk`. Register confirmation calls `/josh/getuuid/` instead of `/josh/uuid`.

Nothing after that date is in this repository.

## Dependencies

Runtime libraries are declared in `package.json`. The ones the tip actually imports are React 16, React Router 5, React Bootstrap, Bootstrap, AWS Amplify 3, lodash (route filtering), `particles-bg`, `react-table` 7, `react-multiselect-dropdown-bootstrap`, `react-newline-to-break`, and `@strongdm/glyphicon`.

Declared and not imported by any file under `src/` (except where noted):

| Package | Evidence |
|---|---|
| `@fullcalendar/daygrid`, `interaction`, `react`, `timegrid` | No import under `src/`. Calendar Lambdas were deleted in `b0527bc` |
| `chartist`, `react-chartist` | No import under `src/` |
| `react-trello` | No import under `src/` |
| `namor` | Imported only by `src/components/makeData.js`, which nothing else imports |

Dev dependencies: Storybook 5.2, Babel, Prettier. The `pretty` script runs Prettier over `src/**/*.js`. No Prettier config file is in git.

`yarn.lock` is tracked. There is no `package-lock.json`.

## Current status

The tip builds a client that can be started with `yarn install` and `yarn start`, as `README.md` states. Product behaviour is the set of screens above. The README still says the TODO is "just about everything".

Diagnosis type and model dropdowns have a single placeholder option each. The X-ray control stores the file input's string value and does not upload to S3. Several call-site defects are recorded in `business-rules.md` and `features.md`. They are implemented behaviour, not a decision that the defects are acceptable.

## Related Silicon Ark projects

| Directory | What overlaps | What this plan does not claim |
|---|---|---|
| `DoctorX_lambda_api_Josh` | Route strings `josh/create`, `josh/getusers`, `josh/update`, `josh/get`, `josh/getuuid`, `josh/diagnose`. Same author. Lambda tip `40da799` is four days before this UI tip | That API Gateway `nhyfbveswk` is that service. The gateway id is not in the lambda repository |
| `unity-lite`, `unity-soft-ui` | Bucket name string `unity-lite-files`. README heading "Unity - Lite Demo". This repo's first app commit included calendar Lambdas | That they share a user pool, an API host, or a database |

## Human confirmation

- Is Doctor X still a product, and is this UI still deployed?
- Is `https://nhyfbveswk.execute-api.eu-west-1.amazonaws.com/prod` the deployed `josh-lambda-api` from `DoctorX_lambda_api_Josh`?
- Are the Cognito pool, identity pool, and bucket `unity-lite-files` shared with Unity Lite?
- Who owns the product now? Git shows one author and no owner field.
- Should the README TODO still be read as the product plan?
- Were `sonar-project.properties` and `sonarqube_scan.bat` ever meant to be committed?
