Internal · Pilot & Development Notes
The pilot plan and where the build actually stands.
One source of truth for what we're testing in the field and what's left to build before Litter Watchdog can go live. Updates as we go.
Last updated May 14, 2026
Pilot Test Plan — Tactacam Reveal X Pro
Order the Tactacam Reveal X Pro
Camera ($130) + Energizer Ultimate Lithium AA 24-pack (~$45) + SanDisk 32GB High Endurance microSD (~$12). Total: ~$190.
Create the central inbox
Decision pending: free Gmail (litterwatchdog.cameras@gmail.com) OR custom address through Ionos (cameras@litterwatchdog.org) forwarded into a Gmail. Leaning toward Option 3 — custom domain forwarded into Gmail.
Blocker: Awaiting your decision on inbox approach + domain availability
Send a test photo from the Tactacam to the inbox Critical
Before any code is written: point Tactacam Reveal app email notifications at the new inbox. Send 3–5 test photos (day + night). Forward one raw email to me so we can see the exact subject format, sender address, attachment encoding.
Mount at test location
30–45° angle facing oncoming traffic, 15–25ft from road edge, ~8ft high. Tactacam settings: video 15s, sensitivity High, trigger interval 5s, video+photo mode on.
Run for 7 days, log every detection manually
Before automation is built — manually review every email that arrives. Track: total events, false positives, actual vehicle captures, plate readability (day vs night), throw motion captured (Y/N).
Validate the pilot results
Decision gate: if Tactacam delivers at least one usable litter capture in 7 days, proceed to build the email-bridge automation. If not, pivot to Reolink Go PT Plus and the native webhook path instead.
Development Roadmap
Core app
6/6 · 100%- Camera entity + CRUD
- Detection entity + review workflow
- Report entity (sheriff submission)
- AI rejection-feedback loop (analyzeRejection)
- Recommended Cameras catalog with ongoing-cost breakdown
- Public marketing site (Home, FAQ, Impact, Plans)
Reolink native webhook path (built but untested)
1/3 · 33%- cameraWebhook backend function exists
- End-to-end test with a physical Reolink camera
- Webhook URL display in Add Camera flow
Tactacam / SpyPoint email-bridge path (NOT BUILT YET)
0/7 · 0%- Create shared inbox (Gmail or domain → Gmail forward)Blocker
- Authorize Gmail connector in Base44 with that inbox account
- Add email_token field to Camera entity (auto-generated, e.g. LW-A7K9X2)
- Build pollCameraInbox backend function (reads unread emails → parses token → uploads attachment → creates Detection)
- Scheduled automation to run pollCameraInbox every 2 minutes
- Update Add Camera page to show user's unique token + forwarding address + setup instructions
- Field-test with the physical Tactacam to confirm the email format parsing actually worksCritical
AI scanning pipeline
0/3 · 0%- InvokeLLM-based litter detection on incoming photos/videos
- Confidence scoring + auto-pending-review status
- Vehicle description + partial plate extraction
Polish & launch readiness
0/4 · 0%- Recommended camera-settings guide (video length, sensitivity, mount angle)
- "Catching moving vehicles" expectations section on Recommended Cameras page
- Email notification to user when a new Detection lands in their inbox
- Charles City County Sheriff submission format finalized
Open Decisions
Which inbox approach for email-bridge cameras?
Pending. Leaning Option 3: cameras@litterwatchdog.org (Ionos) forwarded into a free Gmail. Uses already-registered Gmail connector, branded address, easy migration later.
Decision neededToken format for routing emails to the right camera?
Option B confirmed: camera name = token (e.g. LW-A7K9X2). User names their camera that exact value in the Tactacam app; subject line of every email contains it; we parse and match.
Which camera for the pilot field test?
Tactacam Reveal X Pro. Highest Amazon reviews, no-glow IR, dual-SIM (Verizon + AT&T), $130. Will validate the email-bridge pipeline end-to-end.
Should we keep SpyPoint Flex M as Top Pick on the Recommended Cameras page?
Open question. Currently labeled Top Pick (cheapest + free data plan), but the email bridge isn't built yet. Reasonable to leave alone until pilot validates the bridge — then either promote or demote based on results.
Decision neededApp Capabilities Reference (AI-readable)
Complete inventory of Litter Watchdog features, Base44 platform capabilities the app depends on, and key files in the codebase. Public & intentionally machine-parseable so a second AI can read this page without authentication and understand the whole system.
1. Application Features
Camera Fleet Management
Register cellular trail cameras with full chain-of-custody metadata: serial history, firmware, mount GPS, installer name, property-owner attestation, and service log (install / battery swap / SD swap / firmware update / relocation). Each event timestamps and signs who performed it — designed for courtroom admissibility.
pages/Cameras · pages/AddCamera · pages/Fleet · entities/Camera.json
Detection Pipeline
Cameras POST to cameraWebhook → Detection record created in pending_review. Owner approves/rejects each capture. Approved detections trigger onDetectionApproved automation (stitches multi-camera timelines + generates AI legal summary).
entities/Detection.json · functions/cameraWebhook · pages/Detections · pages/DetectionDetail · components/detections/DetectionCard
AI Legal Summary
On approval, InvokeLLM generates a structured legal summary: prosecutorial headline, factual narrative, key evidence bullets, applicable VA statute (e.g. § 33.2-802), recommended charge, and deputy confidence notes. Stored on Detection.legal_summary and surfaced in both PDFs and the Sheriff Portal.
functions/generateLegalSummary · components/detections/LegalSummaryCard
Multi-Camera Incident Timeline
AI-powered timeline assembly: when an approved detection has a partial plate, the system scans other cameras for the same vehicle within a short time window and stitches a chronological cross-camera timeline. Rendered in both PDFs and the Sheriff UI.
entities/IncidentTimeline.json · functions/stitchIncidentTimeline · components/detections/IncidentTimelineCard · components/sheriff/SheriffIncidentTimeline
Sheriff Submission (Evidence Packet)
Owner selects approved detections → server generates court-ready PDF via jsPDF: incident metadata, AI legal summary, multi-camera timeline, repeat-offender block (cross-references plate against prior reports), evidence photo, and video URL. PDF uploaded via Core.UploadFile, Report record created, email sent to Sheriff + confirmation to submitter.
functions/submitDetectionsToSheriff · entities/Report.json
Official Complaint (One-Click Draft)
Single-detection sworn-complaint PDF: complainant statement, camera chain-of-custody section pulled from Camera entity, AI legal analysis, repeat-offender history, timeline, license-plate zoom crop, certification block. Saves as Report with is_official_complaint=true.
functions/generateOfficialComplaint · components/detections/OfficialComplaintCard
Sheriff Portal
Role-gated portal for deputies (User.role === 'sheriff'). Read-only access to submitted reports with status workflow: sent_to_sheriff → deputy_reviewed → investigating → citation_issued → closed_resolved/closed_no_action. Deputies log case number, badge, notes. Geographic heatmap of incidents.
pages/SheriffPortal · pages/SheriffReportDetail · components/sheriff/SheriffStatusEditor · components/sheriff/IncidentDeepDive · components/sheriff/ReportsHeatmap · lib/reportStatus.js
AI Training & Retraining Loop
When owners reject AI detections with a category + reason, analyzeRejection generates an error-type analysis. Admins curate rejections (admin_corrected_error_type + admin_feedback_notes). triggerRetraining bundles curated rejections into a RetrainingBatch with AI-generated retraining summary for model improvement.
pages/AITraining · functions/analyzeRejection · functions/triggerRetraining · entities/RetrainingBatch.json · components/ai-training/RejectionQueue · components/ai-training/FeedbackEditor
Reimbursement & County Revenue
CSV ingestion of court-collected fines (processTreasuryPayments matches LW-YYYY-XXXX report numbers). Tracks total fines collected, county share, citizen 3% reimbursement, and ties payments back to Reports. Public dashboard shows program ROI.
pages/CountyRevenue · pages/CountyFinances · entities/FinePayment.json · entities/ProgramStats.json · functions/processTreasuryPayments · components/finances/TreasurySync
Community Forum
Three post types: problem_area (residents flag dumping hotspots), operator_offer (camera operators offer installs with revenue split), general. Replies can be 'offers' with proposed_split_pct of the 3% reimbursement.
pages/Forum · entities/ForumPost.json · entities/ForumReply.json · components/forum/PostCard · components/forum/NewPostForm
Citizen Litter Alerts
Anyone can pin a dump site with photos, GPS, and severity. Used to prioritize camera placement and drive cleanup events. Upvotes show community agreement.
entities/LitterAlert.json · components/dashboard/LitterAlertMap
Cleanup Events
Residents organize community cleanups; others sign up with guest count. Tied to Sponsors for resources (bags, gloves, water).
entities/CleanupEvent.json · entities/CleanupSignup.json · components/forum/CleanupSection
Sponsors & Organizations
Businesses sponsor events (bronze/silver/gold/platinum tiers) with monetary, volunteer, or supply pledges. Organizations (schools, HOAs, businesses) auto-include members by email domain and track collective reports filed + cleanup hours against annual goals.
entities/Sponsor.json · entities/Organization.json · pages/Sponsors · pages/Organizations · pages/OrganizationDashboard
Advertisements
Paid placements across dashboard banner, forum sidebar, gallery inline, and footer. Tiered (standard/featured/premium) with impression + click tracking.
entities/Advertisement.json · components/ads/AdBanner
Public 'Caught in the Act' Gallery
Owners opt detections into the public gallery (public_gallery_opt_in flag on Detection). Plates and identifying details are blurred. Drives community engagement without compromising active investigations.
pages/Gallery · components/gallery/AnonymizedDetectionCard
Petition System
Verified CCC-resident petition for the 3% citizen reimbursement program. Captures address, property-owner status, and optional public-consent flag for the petition tally shown to the Board of Supervisors.
entities/PetitionSignature.json · components/revenue/PetitionForm
Pending-Detection Reminder Automation
Scheduled function emails owners with detections sitting in pending_review > 24h. Per-user opt-in controls in Profile. Last reminder timestamp stored on Detection.last_reminder_sent_at.
functions/sendPendingReminders · components/profile/ReminderSettings
2. Base44 Platform Capabilities Used
Entities (Database)
Schema-defined JSON entities stored in entities/*.json. Accessed via base44.entities.<Name>.list/filter/create/update/delete/get. Built-in fields on every record: id, created_date, updated_date, created_by (email). User entity is built-in. Real-time subscriptions via base44.entities.<Name>.subscribe(cb).
- base44.entities.Detection.filter({ status: 'pending_review' }, '-captured_at', 50)
- base44.entities.Report.update(id, { status: 'deputy_reviewed' })
- base44.asServiceRole.entities.User.list() // admin-scoped
Backend Functions (Deno)
Server-side functions in functions/*.js using Deno.serve. Auth via createClientFromRequest(req). Invoke from frontend with base44.functions.invoke('name', payload). All listed functions reuse the existing SDK — no local imports allowed (each function deploys independently).
- createClientFromRequest(req) → user-scoped
- base44.asServiceRole.entities → admin-scoped (use sparingly)
- base44.functions.invoke('generateLegalSummary', { detection_id })
Integrations (Core)
Built-in integrations via base44.integrations.Core: InvokeLLM (with optional model + response_json_schema + add_context_from_internet + file_urls), GenerateImage, TranscribeAudio, SendEmail, UploadFile / UploadPrivateFile, ExtractDataFromUploadedFile, CreateFileSignedUrl.
- InvokeLLM({ prompt, response_json_schema, model: 'claude_sonnet_4_6' })
- UploadFile({ file }) → { file_url }
- SendEmail({ to, subject, body, from_name })
Authentication
Built-in OAuth login handled by Base44. Frontend: base44.auth.me(), isAuthenticated(), redirectToLogin(), logout(), updateMe(data). Backend: createClientFromRequest(req) extracts the user from the request token. Custom user fields supported via entities/User.json (role enum customizable).
- const user = await base44.auth.me()
- base44.auth.updateMe({ display_name, avatar_url })
- base44.auth.redirectToLogin('/dashboard')
Automations
Three types: scheduled (cron/interval), entity (on create/update/delete with optional trigger_conditions), connector (webhook-driven from OAuth services). Currently active: onDetectionApproved (entity automation on Detection update → stitches timeline when status flips to approved).
- Entity automation watches Detection.status changes
- Scheduled automation could run sendPendingReminders daily
- Connector automation could subscribe to Gmail mailbox events
App Connectors (OAuth)
Per-app-user OAuth credentials registered: Gmail + Outlook. Used via base44.asServiceRole.connectors.getCurrentAppUserConnection(connectorId) to call third-party APIs as the app user. Currently registered but unused — reserved for future email-bridge camera ingestion.
- Gmail connector id: 69f94b13dd593deec3c021fc
- Outlook connector id: 69cbf8271b99257b0febaa4a
- Both available for backend use (not yet wired)
Analytics
Custom event tracking via base44.analytics.track({ eventName, properties }). Indicative event names, no PII.
- base44.analytics.track({ eventName: 'detection_approved' })
3. Active Backend Functions
- cameraWebhook — public endpoint cameras POST detection events to. Creates Detection record.
- generateLegalSummary — InvokeLLM produces structured legal narrative for a Detection.
- stitchIncidentTimeline — finds matching plates across cameras within a time window; creates IncidentTimeline.
- onDetectionApproved — entity automation; runs stitchIncidentTimeline + generateLegalSummary when Detection.status → approved.
- submitDetectionsToSheriff — multi-detection PDF evidence packet; emails Sheriff + submitter.
- generateOfficialComplaint — single-detection sworn-complaint PDF with chain-of-custody section.
- analyzeRejection — InvokeLLM categorizes why an owner rejected a Detection (AI-learning signal).
- triggerRetraining — admin-only; bundles curated rejections into a RetrainingBatch.
- processTreasuryPayments — CSV ingestion of court fine payments; matches by report_number.
- sendPendingReminders — emails owners with stale pending_review detections.
4. Entities (Database Schema)
- Camera · Detection · Report · IncidentTimeline
- FinePayment · RetrainingBatch · ProgramStats
- LitterAlert · CleanupEvent · CleanupSignup
- ForumPost · ForumReply
- Organization · Sponsor · Advertisement
- PetitionSignature
- User (built-in, extended with role: admin | user | sheriff)
Full JSON schemas live in entities/<Name>.json. Every record auto-gets id, created_date, updated_date, created_by.
5. Frontend Stack
- ›React 18 + Vite
- ›Tailwind CSS + shadcn/ui (all primitives in components/ui/)
- ›react-router-dom v6 (App.jsx is the single source of truth for routes)
- ›@tanstack/react-query for data fetching + cache invalidation
- ›framer-motion for animations
- ›recharts for charts (county finances, AI training)
- ›react-leaflet for map views (litter alert map, sheriff heatmap)
- ›jspdf for PDF generation in backend functions
- ›lucide-react icons only
- ›Design tokens in index.css (HSL CSS vars) mapped through tailwind.config.js
6. Key Files for Orientation
7. Critical Conventions
- Auth: Never build a custom login. base44.auth.redirectToLogin() handles it.
- Routes: Add new pages by editing App.jsx — there is no file-based routing.
- Roles: "sheriff" is a custom role added on User entity. isSheriff() in lib/reportStatus.js gates UI.
- Backend imports: Each function is deployed independently — no cross-file imports inside functions/.
- Service role: Use base44.asServiceRole only after verifying base44.auth.me() and authorising the action server-side.
- Files: Never store base64 or binary on entity fields. Always UploadFile → store file_url.
- Color tokens: Forest green primary, signal amber accent, warm cream background. Defined in index.css.
8. AI Integration Notes
- Detection scanning: Camera bursts (3 photos at 1-sec intervals) are the primary AI input. Cellular trail cams (Reveal/SpyPoint/Tactacam) auto-transmit only photos — video stays on SD card.
- Legal summary model: generateLegalSummary uses InvokeLLM with response_json_schema for structured output (headline, narrative, key_evidence[], applicable_statute, recommended_charge, confidence_notes).
- Retraining loop: Owner rejections + admin curation feed RetrainingBatch entities. analyzeRejection categorizes the error_type per rejection.
- Multi-camera correlation: stitchIncidentTimeline uses normalized partial plate overlap (min 3 chars) within a time window to assemble cross-camera incidents.
Next action
Order the Tactacam, pick the inbox approach, send a test email.
Once we have a sample email from the actual Tactacam in hand, the email-bridge backend (poller + parser + automation) is a 1–2 hour build. Don't build it before — we'd be guessing at the format.
