# Features — formulys-mobile-app

Evidence date: 2026-10-14. Source revision: `main` at `8fef7bc` (2024-01-30).

Status words:

- **Current** — on the route tree at `8fef7bc`.
- **Present, not routed** — file exists and no `app/` screen imports it.
- **Not in this repo** — a behaviour that a sibling Pest Elite client has, and this app does not.
- **External** — lives on Form.io or FormView, not in git.

The app was not run. "Current" means the source wires the feature, not that a device build was executed for this document.

## Current

| Feature | What the person gets | Where |
|---|---|---|
| Token gate | Missing `token` sends non-auth routes to `/login` | `app/_layout.js` |
| Login | Email, password, JWT stored, then `/dashboard` | `app/login/index.js` |
| Sign-up | Email, password, JWT stored, then `/dashboard` | `app/sign-up/index.js` |
| Logout | Removes `token`, opens `/login`. No server logout | `app/_layout.js` |
| Home | "Pest Elite", slogan, Site Forms, Clients | `app/index.js` |
| Drawer | Site Inspections, Clients, Pesticides | `app/dashboard/_layout.js` |
| Site list | Cards from `digimonkv1` submissions, `+` to create | `app/dashboard/sites/index.js` |
| Site detail | FormView WebView, Edit link, injected DOM script | `app/dashboard/sites/[id]/index.js` |
| Site edit | FormView edit WebView | `app/dashboard/sites/[id]/edit/index.js` |
| Client list | Cards from `clientregister`, `+` to create | `app/dashboard/clients/index.js` |
| Client detail | FormView WebView, Edit link | `app/dashboard/clients/[id]/index.js` |
| Client edit | FormView edit WebView | `app/dashboard/clients/[id]/edit/index.js` |
| Pesticide list | Cards from `pesticidesregister`, `+` to create | `app/dashboard/pesticides/index.js` |
| Pesticide detail | FormView WebView, Edit link, same injected script as sites | `app/dashboard/pesticides/[id]/index.js` |
| Pesticide edit | FormView edit WebView | `app/dashboard/pesticides/[id]/edit/index.js` |
| Create forms | Maps `digimonk`, `register-client`, and `pesticidesregister` to FormView URLs | `app/forms/[id].js` |
| Loading spinner | Replaces the login/register button and the lists while a request is in flight | `components/common/Spinner.js` |
| Android application | Package `com.siliconoverdrive.pestelite`, versionName `1.0.0`, versionCode `1`, launcher icon and splash resources | `android/` |
| EAS profiles | `preview` (APK), `preview2` (`assembleRelease`), `preview3` (dev client), `preview4` (internal), `production` (empty object) | `eas.json` |

Card fields that are actually read:

| Register | Fields shown on the card |
|---|---|
| Site | `clientName`, `selectClient.data.accountNumber`, `contractNumber`, `techName`, `nextVisit` (or `TBD`) |
| Client | `clientName`, `accountNumber`, `contractNumber`, `contractExpiry`, `siteContact`, `telephone`, `email` |
| Pesticide | `pesticide`, `type` |

Colours used on cards: `#354785` and `#bbbbbb` (`lib/constants.js`). Header background `#ebebeb`. Primary buttons `#007BFF`. The `+` control is `#3eaafa`.

## Present, not routed

Nothing in `app/` imports these modules. They are not Expo routes, because they sit outside `app/` (except where noted).

| File | What it contains | Why it is not current behaviour |
|---|---|---|
| `components/home/Home.jsx` | WebView of FormView path `digimonk` (no `v1`) | `app/index.js` defines its own `Home` and does not import this file |
| `components/login/Login.jsx` | A web `<div>Login</div>` stub | Login UI is `app/login/index.js` |
| `components/forms/digimonk/index.js` | WebView of `digimonk` (no `v1`) | Create route uses `digimonkv1` |
| `components/forms/register-client/index.js` | WebView of `clientregister` | Create route has its own URL |
| `components/forms/index.js` | A list of "Digimonk" and "Register Client" cards. Pesticides are commented as a future item (`// Add more items as needed`) and are not in the array | No importer |
| `components/forms/_layout.js` | A stack titled "Forms" and a commented drawer | Not under `app/` |
| `components/common/WebForm.js` | Thin WebView wrapper | No importer |
| `stores/userStore.js` | Zustand `login` / `register` via `formioAPI` | Screens call `axios` directly |
| `stores/siteInspectionStore.js` | Empty file | No importer |
| `hooks/useAxios.js` | Fetch hook. Does not await the token, and lists `response` in the effect dependencies | No importer |
| `hooks/useFetch.js` | `fetch` hook with no auth header | No importer |
| `lib/helpers.js` `formioAPI` | Shared GET/POST helper. Uses `axios` without importing it, and does not await the token | Only referenced by `userStore.js`, which is itself unreferenced. `logger` is used by sign-up |

`babel.config.js` enables `react-native-dotenv`. The only `@env` imports are comments in `components/forms/digimonk/index.js` and `components/forms/register-client/index.js`. Routed screens use the hardcoded host in `lib/constants.js` and in the screen files.

## Completed, as far as git records it

These are the behaviours the commit messages added, all of which are still in the tip:

| Date | Commit | Feature |
|---|---|---|
| 2024-01-23 | `a0bc3ea` | First commit |
| 2024-01-23 | `b10fb04` | Header menu button |
| 2024-01-23 | `ffe491f` | Navigation update |
| 2024-01-23 | `de93ec6` | Register, login, store JWT |
| 2024-01-24 | `8c01a68` | Styling and AsyncStorage |
| 2024-01-25 | `d4d3cf9` | Styles, storage, routing |
| 2024-01-26 | `93cf32a` | APK build updates |
| 2024-01-29 | `dfbeb51`, `b5e75b4` | UI, functionality, tidy-up |
| 2024-01-30 | `8fef7bc` | Pesticide create/read/update and styling |

No commit message describes a shipped release, a store submission, or a rollback.

## Changed recently

Nothing has changed in git since 2024-01-30. The last functional change is pesticide CRU (`8fef7bc`).

Silicon Ark `pestelite_html` records Form.io form `modified` dates after that commit (`digimonkv1` 2024-02-23, `pesticidesregister` 2024-04-15, `clientregister` 2024-07-12). Those dates were fetched for the HTML client, not again for this inspection. If the forms changed, this app's WebViews would show the new forms and the native cards would still read the old field names. Provenance of the dates: the `pestelite_html` technical document. Provenance of a later mobile change: none in this repo.

## Planned

No roadmap, TODO issue list, or unmerged branch exists. The only written "later" note is the comment in `components/forms/index.js` ("Add more items as needed"). That file is not routed.

`eas.json` `production` is an empty profile. That is a placeholder, not a stated release plan.

`package.json` has `"ios": "expo run:ios"` and `"web": "expo start --web"`. There is no `ios/` tree and no web-only route. Treating iOS or web as a planned target would be an inference. **Unknown / Requires Confirmation.**

## Not in this repo

Compared with `pestelite_html`, which uses the same Form.io paths for the three registers:

| Behaviour in the HTML client | In this app |
|---|---|
| Login form `pestelitelogin` | Not called. This app uses `user/login` |
| User register `pesteliteusers` and a users screen | No screen and no request |
| Role-based navbar (`admin`) | No role check |
| Pesticide card dosage (`dosageDilution`) | Not read |
| Client list sorted by `clientName` | No sort |
| Delete | No delete control and no DELETE request |
| Service-report field set (infestation, equipment, signatures) | Not rendered natively. A FormView WebView might still show those fields if they are on `digimonkv1`. The field list is not in this repo |

## Deprecated or removed

No removal commit is in the history. Older WebView URLs (`digimonk` without `v1`) remain in `components/` and are unused. They were not deleted.

The Android manifest still registers the scheme `com.jasonoverdrive.formulysmobile` next to `acme` and `com.siliconoverdrive.pestelite`. Provenance: **Implemented**. Whether the Jason scheme is obsolete is **Unknown / Requires Confirmation**.

## External behaviour this app depends on

Form definitions, required fields, and submission validation are on Form.io. This repository does not vendor them. Create, detail, and edit will show whatever FormView serves for those paths on the day the WebView opens.

A tracked `.env` holds:

- `FORMIO_BASE_URL=https://pro.formview.io/#/rzkiqpzlxxtfqjl`
- `FORMIO_API_BASE_URL=https://rzkiqpzlxxtfqjl.form.io/`

Those are the same public hosts the screens hardcode. The file is not a secret store. It is also not what the routed screens read.
