Documentation

TankCheck docs

Everything you need to use, operate, and remix this project. Written for three audiences: end users, the person setting it up, and anyone remixing it as a template.

1. How it works

TankCheck is a multi-tenant water tank inspection tool. Each account belongs to one or more Organizations (workspaces). Tanks, inspections, defects and photos are scoped to an organization and isolated from every other organization via database row-level security.

Tank register

Every tank is registered once with an ID that matches the barcode, QR code or serial number physically on the tank, plus its type (GS or GRP), village/location, capacity and dimensions.

Scan & inspect

A technician opens Scan & inspect, scans the label with the device camera or types the ID, and lands directly on the 6-monthly maintenance checklist for that tank. Ratings are entered by tapping buttons, so on-site typing is limited to optional short notes.

Checklist sections

Identification, external condition, pipework and fittings, access and safety, and — only when the tank was safely isolated and drained — the internal inspection. Then cleaning and maintenance activities, defects, general observations, overall condition, recommended action and sign-off.

Defects & management view

Every item rated 1 or above raises a tracked defect automatically against the tank and inspection. The dashboard shows escalated defects, a tank priority list and recent inspections; the Defects page is the worklist where items move from open to in progress to closed.

2. Getting started

Sign up

From the landing page click Sign up. You can use email + password or "Continue with Google". Provide your name and an organization name; you become that organization's first admin.

Complete onboarding

You'll land on /app/onboarding. Fill in workspace basics, register your first tank, then optionally invite teammates. When you finish, the workspace is marked as onboarded and you land on the dashboard.

Register your tanks

Open Tanks in the sidebar and add each tank. The tank ID must match the label on site — if a scan finds no match, the app offers to register that code as a new tank.

Run an inspection

Scan or pick a tank, rate each item, attach photos to anything flagged, and submit. The inspection record, its ratings and its defects are stored against the tank and visible from History.

3. Roles & permissions

Three roles, enforced at the database level:

  • Admin — full access, can invite/remove members, change roles, edit organization settings, manage the tank register, and edit or delete any inspection. The last admin cannot be demoted or removed.
  • Member — can read every tank and inspection in their organization, carry out inspections, and edit the records they created; cannot delete tanks or manage teammates and settings.
  • Viewer — read-only. Can view the dashboard, defect worklist and inspection history, but cannot inspect or change any data.

Members and viewers do not see the Team or Settings pages, and viewers do not see Scan & inspect. Server-side row-level security is the source of truth — the UI is filtered, but even a crafted request cannot escalate a member into admin-only tables or let a viewer write.

4. Rating scales & escalation

General defect severity (0–4)

0 = no defect, 1 = minor / cosmetic, 2 = moderate, monitor, 3 = significant, action required, 4 = severe, immediate attention. Operators record what they can see, hear or observe — they are not asked to diagnose the engineering cause.

Leakage rating (L0–L5)

L0 = no leak, L1 = damp/seepage, L2 = slow drip, L3 = steady drip, L4 = running leak, L5 = major loss of water. Any L4 or L5 is escalated immediately.

Automatic flagging

A rating of 1 or above creates a defect record with the item, section, rating, note and photo attached. Severity 3–4 or leakage L4–L5 marks the inspection as high or critical priority and pushes the tank to the top of the management list.

5. Remixing this template

If you're remixing TankCheck as a starting point for your own project, the short version:

  1. Rebrand. Rename the app in the landing page (src/routes/index.tsx), the sidebar logo in src/routes/app.tsx, and the head metadata in each route.
  2. Backend. A remix creates a fresh Lovable Cloud backend for the new project — the original project's data, users, and secrets do not carry over. Migrations under supabase/migrations/ re-run automatically against the new backend, which recreates the schema, RLS policies, and functions.
  3. Google OAuth. The managed Google provider works out of the box in preview. If you configure your own Google Cloud OAuth credentials, they are per-project and must be redone for the remixed project's URL. See the README for the exact steps.
  4. Verify. Sign up as a new user in the remixed project, confirm the onboarding flow gates correctly, and double-check RLS by trying to read another org's data from a second account.

Full technical detail — schema, RLS, OAuth setup — lives in the README.md at the project root.

6. Known gaps

Things to be aware of before running this in production:

  • Email verification is disabled for faster testing (auto-confirm on). Turn it back on before production.
  • Password reset flow is not built. Only the signup / login forms exist.
  • Team invites don't send email. Creating an invite generates a single-use link (/accept-invite?token=…) that you copy and send to the invitee yourself. It expires after 7 days, only works for the address it was issued to, and is redeemed after that person signs in with a confirmed email.
  • No audit log of edits, deletes, or member changes.
  • No legal pages — Terms and Privacy Policy are not included.