# SiteTrack — Construction Site Reporting App ### Product Scope Document (Makepad / Rust) A cross-platform (desktop + mobile, single Rust codebase via Makepad) app for construction site daily/monthly reporting, worker tracking, team chat, approvals, procurement, and site meetings. --- ## 0. Non-Functional Foundations (missing from original scope, needed for *any* of the phases to work) These aren't optional extras — without them, Phases 1–6 can't function reliably on a construction site. - **Offline-first architecture.** Site connectivity is often poor/absent. All data entry (photos, descriptions, worker scans) must save locally (SQLite/SLED embedded DB) and sync when connectivity returns. Conflict resolution needed for multi-supervisor edits. - **Authentication & Role-Based Access Control (RBAC).** Roles: Site Supervisor, Report Master/Approver, Overall/Regional Supervisor, Site Engineer, Foreman, Consultant (external, read/comment-only), Procurement Officer, Admin. Permissions gate who can submit, edit, approve, or view financials. - **Audit trail / version history.** Every report, approval, and edit timestamped and attributed — critical for dispute resolution and compliance (e.g., "who approved this and when"). - **Multi-project / multi-site switcher.** Persistent context switching for users managing several sites. - **Cloud sync & backup.** Encrypted backend storage (e.g., S3-compatible + Postgres) so device loss doesn't mean data loss. - **Digital signatures / approval stamps** on PDFs (supervisor + report master sign-off), not just a "status" field. - **Push/local notifications framework** underlying all the reminder features (Phase 1 items 6 & 8). - **Data export & interoperability** — CSV/Excel export of worker tables and procurement logs, not just PDF/Word. - **Localization/multi-language support** — many site crews are multilingual. - **Accessibility** — large touch targets, works with gloves, high-contrast mode for outdoor sunlight glare. --- ## Phase One — Daily & Monthly Reporting 1. **Capture media**: Photo or GIF/short video of task in progress, with **GPS geotag + timestamp auto-embedded** (proves the photo was taken on-site, on the date claimed — important for dispute/audit purposes). *(added)* 2. **Task description entry** with AI-assisted refinement (grammar/clarity), rich text (bold, underline, italic, bullet/numbered lists). - *Added:* voice-to-text dictation for supervisors typing one-handed on-site; predefined task templates/quick-tags (e.g., "Concreting," "Rebar fixing") to speed entry. 3. **Auto-generate PDF/Word report** from images + descriptions. - *Added:* branded report template (company logo, project name, weather conditions, site address auto-filled) and a **weather log** pulled from a weather API — standard on real daily site reports and useful for delay claims. 4. **Multi-user collaboration & approval workflow**: contributors submit entries → Report Master reviews/edits → approves/rejects with comments. - *Added:* rejection reason + resubmission loop; @mentions/comments per entry. 5. **Multi-site hierarchy & roll-up reporting**: individual site reports link to a regional/overall supervisor who gets an auto-compiled cross-site summary. - *Added:* dashboard comparing site progress side-by-side (% complete, incidents, manpower) for the overall supervisor. 6. **End-of-day reminder** (1 hr before knock-off) to capture photos/finish the report. 7. **Monthly report auto-rollup** from daily entries, for meeting presentation. - *Added:* auto-generated charts (progress trend, manpower trend, incident count) embedded in the monthly PDF. 8. **Monthly report reminder** 72 hrs before the site meeting. - *Added:* **Safety/Incident Reporting** — near-miss, injury, or non-compliance logging with photo evidence, tied into daily and monthly reports (this is normally a mandatory part of construction site reporting and was missing entirely). - *Added:* **Progress vs. Schedule tracking** — % completion per task logged daily, compared against the Phase Four baseline schedule, to flag delays early. --- ## Phase Two — Workers Report Table 9. **ID scanning** (OCR/QR/barcode) of casual workers, capturing name, ID number, and department/trade on arrival. - *Added:* **clock-in/clock-out scan** (not just a single scan) to compute actual hours worked, which feeds payroll and labor-cost reporting. - *Added:* photo capture at registration to prevent ID-sharing fraud (buddy punching). 10. **Daily worker table** by department/work station, with headcount. - *Added:* labor cost summary (headcount × day rate by trade) auto-computed for budget tracking. - *Added:* PPE compliance checklist per worker/crew at sign-in (helmet, boots, vest) — common site safety requirement. --- ## Phase Three — Chat App 11. Site communications, report sharing, approval documents, minutes. - *Added:* **channel structure** — per-site channels + cross-site/management channel, plus direct messages. - *Added:* file/document library within chat (pinned reports, drawings) so approvals aren't lost in scroll. - *Added:* read receipts on critical documents (e.g., confirm foreman has seen an approved drawing revision). - *Added:* offline message queueing (ties to the offline-first requirement above). --- ## Phase Four — Approval Documentation, Status & Schedule 12. Auto-generate task/subtask templates by site type (residential, warehouse, apartment estate, market, hospital, etc.). 13. Define all construction activities (from project start or mid-project) with task/subtask breakdown to project close. 14. Set timelines and material quantities per task. - *Added:* dependency links between tasks (predecessor/successor), enabling a basic **Gantt/critical-path view** — without this, "timelines" are just dates with no schedule logic. 15. Task ID/tracking for internal roles (Site Engineer, Site Agent, Foreman, Site Manager) and external (consultants), inspection & approval status. - *Added:* **status workflow** per task (Not Started → In Progress → Pending Inspection → Approved/Rejected → Closed) with required attachments (inspection request forms, approval certificates, NCRs — non-conformance reports). - *Added:* **document register / drawing revision control** — track latest approved drawing revision per task, since construction rework often stems from working off outdated drawings. --- ## Phase Five — Procurement Schedule & Approval 16. Material quantity planning and sourcing (hardware stores, agents, factories). 17. Hardware/Agent/Factory directory. - *Added:* **Bill of Quantities (BOQ) linkage** — tie material requirements directly to Phase Four tasks, so procurement timing is driven by schedule, not guesswork. - *Added:* **Purchase order & delivery tracking** — request → approval → PO issued → delivery confirmation (with photo of delivered materials), closing the loop procurement was missing. - *Added:* supplier rating/history (price, reliability) for future sourcing decisions. - *Added:* stock/inventory level tracking on-site to flag shortages before they stall work. --- ## Phase Six — Site Meetings 18. Schedule/reschedule site meetings. 19. Project directory/records list. 20. App listens to meeting audio. 21. Auto-generate minutes from the recording. 22. Share minutes with attendees and interested parties. - *Added:* **action-item extraction** from minutes (who/what/by-when), auto-carried into a tracked action log with due-date reminders — otherwise minutes are just a transcript with no accountability loop. - *Added:* agenda templates and pre-meeting circulation of the agenda + prior action-item status. - *Added:* attendance register (auto or manual) attached to minutes. - *Added:* consent/notice for recording (legal requirement in many jurisdictions) before Phase Six item 20 activates. --- ## Suggested Build Order (Rust/Makepad considerations) Given Makepad's strength in performant native UI but younger ecosystem (less mature audio/OCR/ML tooling than Flutter or native iOS/Android), a pragmatic sequencing: 1. Phase 1 + offline sync foundation (core value, proves the data model) 2. Phase 2 (ID scan — likely needs an external OCR crate or on-device ML model bridge) 3. Phase 4 (scheduling — mostly a data/UI problem, no exotic dependencies) 4. Phase 5 (procurement — extends Phase 4's data model) 5. Phase 3 (chat — needs a realtime backend: WebSocket service) 6. Phase 6 last, since **speech-to-text minute generation** is the highest technical risk (likely needs a cloud STT API rather than on-device, given Makepad's current ecosystem) and depends on Phase 3's infrastructure. --- *This document expands the original scope with items that are standard in commercial construction site-management software (e.g., Procore, Fieldwire, Buildertrend) but were absent from the initial brief — particularly safety/incident logging, schedule dependencies, document/drawing revision control, procurement-to-delivery tracking, and action-item accountability from meeting minutes.*