# Project plan — coreUnit

Evidence date: 2026-10-18.

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

Inspected revision: `master` at `e424b25` (2019-08-05, Jaco Brits, "README.md edited online with Bitbucket"). `origin/HEAD` points at `master`. The scan-host path `~/projects/sonar_scan/repos/coreUnit` was not on this machine. The tree below was read from that git revision. OVER-75's recorded tip matches this commit.

`sonar-project.properties` and `sonarqube_scan.bat` were listed in the issue's scan inventory. Neither file is in `git ls-files` at `e424b25`.

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

## Product

The root `README.md` is titled **Unity**. The Fuse login screens say "Welcome to the UNITY!" and "This is a all in one business software . For Startup to SME and beyond." The Bitbucket slug and the WAMP URL in the README use **coreUnit**.

There is no separate plan, ticket export, or Silicon Ark set before this one. The README is a tools-and-structure note. It does not name a customer, a problem, or a release.

Whether this repository belongs to the other Unity projects already stored in Silicon Ark is **Unknown / Requires Confirmation**. No source file imports those projects.

## Branch reality

| Line | Tip | Date | What it is |
|---|---|---|---|
| `master` (default; `origin/HEAD`) | `e424b25` | 2019-08-05 | Six commits, 2019-06-17 to 2019-08-05 |
| `origin/trev` | `5f44176` | 2019-09-02 | Three commits by Trevor Mararike. Not merged |

`trev` moves the small Create React App from `public/` to the repository root (`package.json`, `src/`), adds a root `.gitignore`, and adds `package-lock.json`. The commit message on `bdd1846` says a cloned app still needs cleanup before it runs smoothly. The diff does not change the Laravel API or the Fuse app under `frontend/`.

Nothing on `master` is dated after 2019-08-05. Whether anyone still runs this application is **Unknown / Requires Confirmation**.

Authors on `master`:

- Jaco Brits — initial README (2019-06-17), Laravel API setup (2019-07-09), README edit (2019-08-05).
- `siliconoverdrive` — JWT Composer change (2019-07-10), product API and the first public React app (2019-07-14), Passport plus the Fuse frontend (2019-08-05).

## Objectives (from the README, not from a later decision)

`README.md` lists tools and a short structure. It does not list phases or acceptance tests.

Documented tools:

1. WAMP for PHP Laravel, and browser JavaScript.
2. Visual Studio Code, including the terminal.
3. HeidiSQL or phpMyAdmin.
4. Postman for API testing.
5. Chrome React tools.

Documented API notes:

1. "all laravel apis are setup".
2. "Auth uses Passport".
3. Run `artisan` from the `api` directory. The README spells the command `artasan` and the word controller as `cotroller`.
4. Example controller command: `php artisan make:controller Api\AuthController`.
5. Login URL: `http://localhost/coreUnit/api/public/api/v1/login`.

Documented frontend notes:

1. "Use Reactjs".
2. "If branch is in development mode" — the sentence stops there.
3. `yarn build` from a command prompt.

The login-screen sentence about business software for startups and SMEs is **Implemented** copy in `frontend/src/app/main/login/Login.js` and `frontend/src/app/main/pages/auth/login-2/Login2Page.js`. It is not in the README.

## Scope

### In scope of `master`

1. A Laravel 5.8 application under `api/`, with Passport on the `api` guard, a user model, a product model, and the routes in `api/routes/api.php`.
2. A Fuse React 3.0.0 admin theme under `frontend/` (Create React App, React 16.8.6, Material UI 4). Two login pages post to a Laravel URL. The theme's own JWT, Auth0, and Firebase checks are commented out.
3. A second, smaller Create React App under `public/` (React 16.8.6, Formik, Yup). It has a login form, a dashboard, and a not-found page. A Smart Admin asset tree sits under `public/src/components/assets/` and is not mounted by `public/src/index.js`.
4. Root, `api/`, and `frontend/` `.htaccess` files that set `Access-Control-Allow-Origin: *` when `mod_headers` is available.
5. `README.md` as the only project note.

### Out of scope / not in this repository

1. Passport's OAuth tables and a personal-access client. `php artisan passport:install` is not documented and its migrations are not committed.
2. A running WAMP vhost, a MySQL database, or a committed `api/.env`. `api/.env.example` is the Laravel Homestead sample.
3. SonarQube project files. They are absent from git at `e424b25`.
4. Queues, scheduled jobs, mailables, file uploads, and a product UI that calls `ProductController`.
5. The `trev` relocation, until someone merges it.

## System architecture

```text
Browser
  frontend/   Fuse React (yarn start → port 3000, per the Fuse README)
  public/     small CRA (react-scripts start → port 3000)
        |
        |  HTTP JSON, hardcoded WAMP URLs
        v
api/public/index.php
  Laravel 5.8
    routes/api.php          prefix /api, throttle 60/minute
    AuthController          Passport personal access token
    RegisterController      second register action
    ProductController       products table
    Spatie CORS + App\Http\Middleware\Cors
        |
        v
MySQL (default connection). .env.example names database homestead.
```

The two React apps are separate package trees. They do not share a workspace file. Both default to port 3000 if started together. **Unknown / Requires Confirmation** which one was meant to be the product UI. The README names one frontend and `yarn build`, which matches `frontend/package.json` (`yarn`) more than `public/package.json` (`npm` scripts only).

WAMP is the only documented host. The README URL places Laravel's `public` directory at `http://localhost/coreUnit/api/public/`. `Login.js` posts to a different host, `http://local.unity/api/public/api/v1/`.

## Major components

| Component | Path | Role at `e424b25` |
|---|---|---|
| Root note | `README.md` | Tools, Passport, login URL, `yarn build` |
| HTTP entry | `api/public/index.php` | Laravel front controller |
| API routes | `api/routes/api.php` | Register, login, current user, products |
| Passport | `api/app/Providers/AuthServiceProvider.php`, `api/config/auth.php` | `Passport::routes()`, guard driver `passport` |
| Users | `api/app/User.php`, users migration | Name, unique email, bcrypt password |
| Products | `api/app/Product.php`, products migration | Name and detail, behind `auth:api` |
| Fuse UI | `frontend/` | Theme plus two customised login pages |
| Small UI | `public/src/` | Local login form and a client table |
| Theme assets | `public/src/components/assets/` | Smart Admin files, including `._` AppleDouble copies |

## Milestones already in git

1. **2019-06-17** `5702b68` — README only (2 insertions).
2. **2019-07-09** `33c4548` — Laravel 5.8 skeleton under `api/`, including `config/jwt.php`. 91 files.
3. **2019-07-10** `ab83b3c` — `tymon/jwt-auth` `dev-develop`, `xethron/migrations-generator`, and `api/app/Http/Middleware/jwtMiddleware.php`.
4. **2019-07-14** `5cf8a13` — `Product`, `ProductController`, `API\RegisterController`, `BaseController`, products migration, and the first `public/` Create React App (`App.js`, `App.test.js`, `serviceWorker.js`). Commit subject: "Update styles".
5. **2019-08-05** `afd65d0` — Passport and `spatie/laravel-cors` replace the JWT stack. Adds `AuthController`, `Cors` middleware, `config/cors.php`, the Fuse tree under `frontend/`, and the `public/` login, dashboard, and Smart Admin assets. Commit subject: "Setup and Intial link between API -laravel and Frontend React". 2959 files.
6. **2019-08-05** `e424b25` — README rewritten to the Unity / Passport / WAMP note. 1 file.
7. **2019-09-02** on `trev` only — Trevor Mararike moves `public/`'s app to the repo root and commits a lockfile.

## Implementation plan visible in the repo

There is no forward plan. The README's unfinished line "If branch is in development mode" is the only hint of an environment split, and it names no branch. `master` is the only integrated line.

What the code still leaves unfinished is recorded in `prd.md` and `features.md`. It includes two register actions, two login URLs, a login page that does not store the Passport token, a product API with no product screen, and Passport tables that are not in the migrations folder.

## Known dependencies

Runtime and libraries are listed in `technical-documentation.md`. External systems named by the repo:

- MySQL, via Laravel's `mysql` connection.
- WAMP, HeidiSQL or phpMyAdmin, Postman, Chrome.
- Mailtrap host in `api/.env.example` (`smtp.mailtrap.io`). No mailable class exists.
- Redis, AWS, and Pusher keys are empty placeholders in `api/.env.example`. No application code reads them.
- A Google Maps browser key is committed in `frontend/.env`. The only reader found is a Fuse documentation example, `frontend/src/app/main/documentation/third-party-components/google-map-react/examples/simple.js`. The key value is omitted from these documents.
- Fuse theme licence: `frontend/LICENSE` is the ThemeForest regular-licence URL.

## Current project status

**Implemented, and stopped.** The last integrated commit is 2019-08-05. The API can register a user, issue a Passport personal access token, return the authenticated user, and store products, once MySQL and Passport's OAuth tables exist. The Fuse shell opens on `/login` and posts credentials to a hardcoded host. The small app under `public/` validates a login form in the browser and does not call the API.

No CI configuration, deployment script, or Sonar project file is in git. PHPUnit contains the two Laravel example tests. No `*.test.js` or `*.spec.js` file is tracked.

## Human confirmation

1. Is coreUnit the start of the Unity product, a spike, or an abandoned copy of the Fuse theme?
2. Which UI is the product: `frontend/`, `public/`, or the `trev` relocation of `public/`?
3. Should the login host be `localhost/coreUnit` or `local.unity`?
4. Was Passport installed on a database that is not in git?
5. Are the Sonar files from the 2026-09-28 scan still on the scan host, or were they never committed?
6. Is `trev` still wanted?
