# Project plan — findndrive_webportal

Evidence date: 2026-10-15. Source repository: `git@bitbucket.org:overdrive/findndrive_webportal.git`.

Inspected revision: `master` at `54b9de7` (2023-10-12 14:57:16 +0200, author Jaco Brits, subject "database settings"). `origin/HEAD` points at `master`. The scan-host path recorded on the onboarding issue was not on this machine. The tree was read from a shallow clone of that revision. Secret values found in source are named by file and are not repeated here.

There is no prior Silicon Ark directory for this project.

## What this repository is

`composer.json` describes the package as **Find And Drive** (`codeigniter4/adminstarter`). `README.md` titles the same tree **Admin Overdrive Starter**.

Implemented behaviour is a CodeIgniter 4 browser admin plus a JSON API. Staff manage users, menus, a vehicle catalogue, and uploaded spreadsheets. A client (not in this repository) walks a multi-step session that stores price range, model, kilometres, loan inputs, salary and expenses, an apply flag, and a fix-my-credit flag. The server stores those values and returns catalogue rows. It does not calculate the instalment.

Provenance: **Implemented**. A written product goal beyond the README feature list was not found.

## Objectives visible in the repository

| Objective | Evidence | Provenance |
|---|---|---|
| Staff can sign in, and public registration creates a user | `Welcome`, `users` seed | Implemented |
| Staff can maintain roles and menu permissions | `Users`, `user_role`, `user_access` | Implemented |
| Staff can load a vehicle spreadsheet into `car` and three cost tables | `Car::importSm` | Implemented |
| A client can open a session and post each simulator step | `CarApi` step methods, `app_session` | Implemented |
| Staff can see session volume, applications, and fix-my-credit share | `Home` | Implemented |
| An organisation can obtain a JWT and call organisation CRUD | `Organisations` | Implemented |
| Production deploys from `master` through AWS CodeDeploy | `bitbucket-pipelines.yml`, `appspec.yml` | Implemented |

## Scope

In this repository:

- PHP admin UI under `app/Views` (login, dashboard, users, car catalogue, file and media lists, developer tools).
- JSON resources `carapi` and `organisations`.
- MySQL schema in `app/Database/Migrations` (June–August 2023).
- Bitbucket Pipelines deployment to `/var/www/html` and a SonarQube scan step.

Not in this repository:

- The client that calls `CarApi`. Its screens are described only by method comments ("your price range", "select a model", and so on).
- A loan, interest, or affordability formula. Those numbers arrive already calculated.
- A scheduler that reads `cronjob_actions` or `cronjob_log`. The tables are migrated. No `app/Commands` directory exists.

## Architecture

```text
Browser staff UI                External client (unknown)
        |                                |
        v                                v
CodeIgniter 4 (public/, auto-route on)
        |
        +-- session auth + menu grant (staff)
        +-- CarApi session steps (JWT check forced true)
        +-- Organisations CRUD (JWT)
        |
        v
MySQL (database name in the sample env: adminoverdrive)
        |
        +-- car, car_cost_category_a|b|c, car_type, car_tier, car_service
        +-- app_session, app_session_log
        +-- users, user_role, user_menu*, user_access
        +-- organisations, uploaded_file, media_file
        +-- master file / site health / test / chatgpt_log / cron tables
```

Deployment path: push to `master` → Bitbucket Pipelines zips the tree → `codedeploy_deploy.py` → CodeDeploy hooks → `composer update --no-dev` and `php spark migrate` on the instance.

## Major components

| Component | Role |
|---|---|
| `Welcome`, `Users`, filters | Staff identity and menu grants |
| `Car`, `CarModel`, cost-category models | Catalogue maintenance and spreadsheet import |
| `CarApi`, `AppSessionModel` | Simulator session API |
| `Organisations`, `JwtLibrary` | Organisation login and CRUD |
| `Home` | Session dashboard |
| `UploadedFile`, `MediaFile` | File registry used by import |
| `MasterFile`, `ChatGPT`, `SiteHealth`, `Test`, `DbAdmin` | Screens carried from the admin starter. Several are outside the vehicle flow |
| `bitbucket-pipelines.yml`, `appspec.yml`, `scripts/` | Production deploy |

## Milestones recovered from the tree

These are migration and commit dates, not an approved plan.

| When | What landed |
|---|---|
| 2022-11-20 | Users, roles, menus, organisations, sessions |
| 2023-06-02 to 2023-06-04 | Media, cron tables, settings, language, app session log |
| 2023-06-18 | Car, cost categories A/B/C, tier, service, app session |
| 2023-06-27 to 2023-07-05 | Uploaded file, master-file tables |
| 2023-07-15 to 2023-07-28 | Tiers, session columns for the simulator, user address fields |
| 2023-08-02 to 2023-08-08 | Test tables, expense split, location, tier on the session |
| 2023-10-12 | Last commit, "database settings". Committed `Database.php` credentials are empty strings. Secrets Manager lookups are commented out |

No commit after 2023-10-12 was on `master` at inspection. Whether other branches exist was not established: the clone was shallow and only `master` was present.

## Current status

| Item | State |
|---|---|
| `master` | Stopped at `54b9de7` (2023-10-12) |
| Silicon Ark docs | Created by this onboarding. None existed before |
| README external trackers | Jira board `SI` and Confluence space `AO` are linked. Their contents were not read |
| Production host, URL, and whether CodeDeploy still runs | Unknown / Requires Confirmation |
| Sample `env` | `CI_ENVIRONMENT = development`, database `adminoverdrive`, user `root`, empty password |

## Known dependencies

- PHP `^8.0` (README). Locked framework: CodeIgniter 4.3.3.
- MySQL via MySQLi. PHPUnit group uses SQLite memory.
- Composer packages: `aws/aws-sdk-php`, `mpdf/mpdf`, `phpoffice/phpspreadsheet`, `orhanerday/open-ai`, `smtp2go-oss/smtp2go-php`.
- Transitive SDKs present under `vendor`: Africa's Talking, Salesforce Marketing Cloud Fuel SDK.
- AWS CodeDeploy, S3, and Bitbucket pipeline variables for the deploy step. Variable values are not in the repo.
- SonarQube project key `overdrive_findndrive_webportal_AYlFfmWqp5diRRkAyQho`.

`mpdf` is required in Composer. No application PHP file references it. Provenance: **Unknown** whether PDF output was planned or leftover.

## Implementation plan

No forward plan is written in the repository. `README.md` points at a Jira board and a Confluence space and stops at an empty "CRUD automation scrips" heading.

Anything after 2023-10-12 — live traffic, a replacement client, credential rotation, or retirement — is **Unknown / Requires Confirmation**.
