Skip to content

Implement Speed Camera MVP - Real-time driver alert system - #1

Draft
blurdyblur with Copilot wants to merge 6 commits into
releasefrom
copilot/build-mvp-speed-camera-app
Draft

Implement Speed Camera MVP - Real-time driver alert system#1
blurdyblur with Copilot wants to merge 6 commits into
releasefrom
copilot/build-mvp-speed-camera-app

Conversation

Copilot AI commented Jan 11, 2026

Copy link
Copy Markdown

Description

Built a mobile-first web application for real-time speed camera alerts with GPS tracking, map visualization, and subscription-based monetization. Implements dark mode driving UI, proximity-based notifications, and mandatory legal disclaimers.

Implementation

Full-Stack Architecture

  • Frontend: React + TypeScript + Vite, Mapbox GL JS for mapping, Tailwind CSS v4
  • Backend: Node.js + Express, PostgreSQL + Prisma ORM v7, JWT authentication
  • Payments: Stripe integration with webhooks for subscription management
  • Security: Rate limiting (5-200 req/window by route type), bcryptjs hashing, CORS

Core Features

  • Live Map: Dark mode map with GPS tracking, displays 3 camera types (fixed speed, red light, average speed)
  • Proximity Alerts: Haversine distance calculation, visual + optional audio alerts, configurable presets (300m-1000m)
  • Tiered Access: Free (300m limit) vs Premium ($9.99/mo, unlimited, extended range)
  • User Settings: Alert distance presets, sound toggle, speed units (MPH/KMH)
  • Analytics: Event tracking for app opens, sessions, alerts, subscription events

Data Model (Prisma)

model SpeedCamera {
  id          String     @id @default(cuid())
  latitude    Float
  longitude   Float
  type        CameraType // FIXED_SPEED | RED_LIGHT | AVERAGE_SPEED
  speedLimit  Int?
  verifiedAt  DateTime
  @@index([latitude, longitude])
}

model Subscription {
  stripeCustomerId  String @unique
  stripeSubId       String @unique
  status            SubscriptionStatus
  currentPeriodEnd  DateTime
}

API Endpoints

  • POST /api/auth/{register,login,guest} - Authentication with rate limiting (5/15min)
  • GET /api/cameras?minLat&maxLat&minLng&maxLng - Bounding box camera query
  • POST /api/subscriptions/create-checkout - Stripe checkout session
  • POST /api/subscriptions/webhook - Webhook handler with signature validation
  • GET /api/subscriptions/status - Premium access check
  • PUT /api/settings - User preferences persistence

Security Measures

  • Rate limiting: Auth (5/15min), Payment (10/hr), General (100/15min), Analytics (200/15min)
  • JWT tokens with 30d expiry (7d for guests)
  • Stripe webhook signature verification
  • SQL injection prevention via Prisma
  • Password hashing with bcryptjs (10 rounds)

Legal Compliance

Full-screen mandatory disclaimer on first launch with checkbox acceptance:

  • Informational tool only, no accuracy guarantee
  • Driver responsibility for traffic law compliance
  • No interaction while driving warning
  • Liability waiver

Deployment Ready

  • Vercel (frontend) + Railway/Fly.io (backend) configuration documented
  • Environment variable examples for both apps
  • Database seed script with 20+ sample cameras across major cities
  • Estimated deployment: 2-3 hours

Documentation

  • README.md: Setup and installation
  • DEPLOYMENT.md: Production deployment guide
  • IMPLEMENTATION.md: Feature breakdown and architecture
  • SECURITY_SUMMARY.md: Security analysis and compliance notes
  • PROJECT_SUMMARY.md: Complete requirements checklist

Trade-offs

Aggressive MVP choices (as specified):

  • Static camera dataset (manual DB updates)
  • No offline mode or native background tracking
  • No admin UI (Prisma Studio for DB management)
  • Preset-only alert distances (no custom input)

All align with rapid launch requirements while maintaining safety rails (webhook validation, GPS error handling, feature gating).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/copilot.vim/copilot.vim/speed-camera/backend/node_modules/prisma/build/child {"product":"prisma","version":"7.2.0","cli_install_type":"local","information":"","local_timestamp":"2026-01-11T05:21:15Z","project_hash":"a1d6c339","cli_path":"/home/REDACTED/work/copilot.vim/copilot.vim/speed-camera/backend/node_modules/.bin/prisma","cli_ (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/copilot.vim/copilot.vim/speed-camera/backend/node_modules/prisma/build/child {"product":"prisma","version":"7.2.0","cli_install_type":"local","information":"","local_timestamp":"2026-01-11T05:22:21Z","project_hash":"a1d6c339","cli_path":"/home/REDACTED/work/copilot.vim/copilot.vim/speed-camera/backend/node_modules/.bin/prisma","cli_ pilot.vim (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt
  1. Base44-Optimized Build Prompt (Tight + Opinionated)

App Name

Speed Camera

Objective

Build and deploy the first live, billable MVP of a mobile-first web app that alerts drivers to nearby speed cameras in real time.

This version must prioritize reliability, billing, and speed to launch over feature depth.

Preferred Stack (Explicit)

Frontend

React + TypeScript

Vite or Next.js (App Router)

Tailwind CSS

Mapbox GL JS (or Google Maps if simpler)

Backend

Node.js

REST API (no GraphQL for v1)

PostgreSQL

Prisma ORM

Auth

Email/password

JWT or session-based auth

Guest mode with feature limits

Billing

Stripe subscriptions

Monthly plan only (no annual yet)

Webhooks for payment status

Lock premium features behind active subscription

Hosting

Vercel (frontend)

Railway / Fly.io / Supabase (backend + DB)

Core Features (Hard Scope)

  1. Live Map
    Display speed cameras on map

Camera types:

Fixed speed

Red light

Average speed zone

Show user’s current GPS position

Dark mode default

  1. Real-Time Alerts
    Trigger alert when user is within configurable distance

Distance presets only (no custom slider yet)

Visual alert required

Audio alert optional toggle

No background execution beyond browser limits

  1. Camera Dataset
    Seed with static dataset

Store in database (not hardcoded)

Schema:

id

latitude

longitude

type

speed_limit (nullable)

verified_at (date)

  1. Settings
    Alert distance

Alert sound on/off

Speed units (mph / kmh)

Monetization (Mandatory)

Free
View map

Limited alerts per day

Premium
Unlimited alerts

Earlier alert distance

Access controlled by Stripe subscription status

UX Rules
One-tap “Start Driving”

Large touch targets

Minimal text while driving

No popups during active driving session

Analytics (Minimal)
App opened

Driving session started

Alert triggered

Subscription started / canceled

Deployment
Live production URL

Environment variables configured

Ready for real users immediately

  1. “Build Aggressively, Cut Corners Safely” Version

Guiding Principle:

Ship something people will pay for before optimizing correctness, scale, or completeness.

Aggressive Choices (Intentional)
Static camera dataset (manual updates later)

No offline mode

No background alerts outside browser limits

No advanced routing or ETA logic

No admin panel (manage DB directly)

Safety Rails (Do NOT Skip)
Stripe webhook validation

GPS permission handling

Graceful GPS failure states

Clear legal disclaimer

Feature flags for premium logic

Engineering Bias
Prefer readable code over clever code

Avoid abstractions until needed

Optimize for debugging, not elegance

Every feature must support billing or retention

  1. Legal & Safety Disclaimer Block (Launch-Ready)

Use this exactly or slightly modified:

Safety & Legal Notice

Speed Camera is an informational assistance tool only.
It does not guarantee the accuracy, completeness, or timeliness of speed camera data.

Drivers are solely responsible for complying with traffic laws, speed limits, and road conditions at all times.

Do not interact with the app while driving. Configure alerts before starting your journey.

Speed Camera assumes no liability for fines, penalties, accidents, or damages resulting from the use of this app.

By using Speed Camera, you agree to these terms.

(Require acceptance on first launch.)

  1. v1 → v2 Roadmap (Reality-Based)

v1 (Now — Monetize)
Live map

Alerts

Stripe billing

Static data

Single region launch

v1.5 (Retention)
Background alerts (where OS allows)

Smarter alert timing

Usage-based free limits

Camera confidence score

v2 (Growth)
Crowdsourced camera reporting

Camera verification voting

Regional expansion

Native mobile wrapper

Annual subscriptions

Fleet / rideshare mode

Final Recommendation

Ship v1 fast. Charge early. Learn from real driving sessions.

This prompt is optimized for launch velocity, not theoretical perfection.

If you want next:

A Stripe product + price structure

A Base44 checklist to avoid rebuilds

A one-screen driving UI wireframe

A terms + privacy policy draft


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 11, 2026 05:20
Co-authored-by: blurdyblur <202377368+blurdyblur@users.noreply.github.com>
Co-authored-by: blurdyblur <202377368+blurdyblur@users.noreply.github.com>
Co-authored-by: blurdyblur <202377368+blurdyblur@users.noreply.github.com>
Co-authored-by: blurdyblur <202377368+blurdyblur@users.noreply.github.com>
Co-authored-by: blurdyblur <202377368+blurdyblur@users.noreply.github.com>
Copilot AI changed the title [WIP] Build and deploy MVP for speed camera alert app Implement Speed Camera MVP - Real-time driver alert system Jan 11, 2026
Copilot AI requested a review from blurdyblur January 11, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants