A GPS-verified government infrastructure project monitoring platform built to prevent fraud and ensure transparency across Ghana.
Features โข Tech Stack โข Getting Started โข Screenshots โข Architecture โข Team
The Government Project Monitoring System (GMS) is a full-stack web application that enables GPS-verified photo submissions from contractors on government infrastructure projects. Officials can review submissions, verify location authenticity, and approve or flag reports โ all with a permanent audit trail.
Built for Group 12 as part of a university software engineering project.
- Contractors submit fake progress photos from locations other than the project site
- Government officials have no efficient digital tool to verify submissions
- Citizens have zero visibility into how public funds are being spent
- No audit trail exists for review decisions
- ๐ GPS verification โ EXIF data extracted from photos, distance calculated using Haversine formula
- ๐ Role-based access โ different interfaces for Admin, Official, Contractor, and Citizen
- ๐ Live dashboards โ real-time analytics with charts and fraud alerts
- ๐ Public transparency portal โ citizens can track projects on an interactive map
- ๐ฑ Offline PWA โ contractors can capture photos on-site without network connectivity
- Email + password authentication via Supabase Auth
- Force password change on first login
- Role-based route protection via Next.js middleware
- Row Level Security (RLS) on all database tables
- Admin-only user creation
- Create, edit, and manage infrastructure projects
- GPS coordinates required for every project
- 16 Ghana regions + 9 project type categories
- Budget tracking in Ghana Cedis (GHโต)
- Milestone management with deadlines and progress tracking
- Auto-generated project numbers (
PRJ-2026-001)
- Direct rear camera access on mobile (
capture="environment") - Drag & drop upload from gallery on desktop
- EXIF metadata extraction for GPS coordinates
- Haversine formula distance calculation
- Three-tier verification system:
- โ Verified โ photo taken within 100m of project site
โ ๏ธ Review โ photo taken 100โ500m from site- ๐ฉ Flagged โ photo taken more than 500m away
- Officials can: Approve, Flag as Fraud, Request Changes, Mark Under Review
- Contractors can resubmit on the same thread with new photos
- Old photos preserved for side-by-side comparison
- Permanent audit trail for every review action
- Real-time notifications via bell icon
- Role-specific dashboards (Admin / Official / Contractor)
force-dynamicrendering for always-fresh data- Submission trend line chart (6 months)
- Projects by region bar chart
- Submissions by status donut chart
- Auto-update project completion % on approval
/public/mapโ interactive project map (no login required)- Anonymous citizen tip submission with reference number tracking
- Google Maps integration for site location verification
- Installable as a Progressive Web App on Android and iOS
- Service Worker for offline page caching
- IndexedDB queue stores photos when offline
- Auto-uploads when network connectivity returns
- Floating queue manager with live status indicator
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 14 (App Router) | React framework with SSR/RSC |
| Language | TypeScript | Type safety across the codebase |
| Styling | Tailwind CSS | Utility-first CSS |
| Components | shadcn/ui | Accessible UI component library |
| Backend | Supabase | Database, Auth, Storage |
| Database | PostgreSQL | Relational data with RLS |
| Charts | Recharts | Analytics dashboards |
| Forms | React Hook Form + Zod | Form handling and validation |
| GPS | exif-parser | EXIF metadata extraction |
| Offline | IndexedDB + Service Worker | PWA offline support |
| Icons | Lucide React | Icon library |
- Node.js 18+
- npm or yarn
- Supabase account (free tier works)
# 1. Clone the repository
git clone https://github.com/your-username/govt-monitoring-system.git
cd govt-monitoring-system
# 2. Install dependencies
npm install
# 3. Set up environment variables
cp .env.local.example .env.local
# Fill in your Supabase credentials
# 4. Run the development server
npm run devOpen http://localhost:3000 in your browser.
Create a .env.local file in the root directory:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keyFind these in Supabase Dashboard โ Project Settings โ API.
Run the SQL setup files in your Supabase SQL Editor in order:
Week1-SETUP.sql โ Users, auth tables, RLS policies
Week2-SETUP.sql โ Projects, milestones
Week3-SETUP.sql โ Submissions, storage bucket
Week4-SETUP.sql โ Notifications, audit logs
| Role | Permissions |
|---|---|
| Admin | Full system access, user management, all reports |
| Official | Create/edit projects, review submissions, manage tips |
| Contractor | View assigned projects, upload progress photos, resubmit |
| Citizen | View public map, submit anonymous tips (no login needed) |
Admin: admin@gov.gh / admin123
Official: official@gov.gh / official123
Contractor: contractor@example.com / contractor123
โ ๏ธ Change these credentials before any production deployment.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Next.js 14 App Router โ
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ RSC Pages โ โServer Actionsโ โ Middleware โ โ
โ โ (dashboard, โ โ (auth, CRUD, โ โ (auth guard, โ โ
โ โ projects, โ โ reviews, โ โ role check) โ โ
โ โ submissionsโ โ analytics) โ โ โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Supabase โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โPostgreSQLโ โ Auth โ โ Storage โ โ
โ โ + RLS โ โ (JWT) โ โ (Photos) โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Contractor takes photo
โ
EXIF data extracted (client-side)
โ
GPS coordinates parsed
โ
Haversine distance calculated
โ
< 100m โ โ
Verified
100โ500m โ โ ๏ธ Needs Review
> 500m โ ๐ฉ Flagged
No GPS โ โ ๏ธ Manual Review Required
No network detected
โ
Amber banner shown to contractor
โ
Photo captured via camera
โ
GPS extracted + saved to IndexedDB
โ
"๐ถ QUEUED" badge shown
โ
Network returns
โ
Auto-upload triggers (< 2 seconds)
โ
Submission created + Official notified โ
govt-monitoring-system/
โโโ app/
โ โโโ (dashboard)/ # Protected authenticated routes
โ โ โโโ dashboard/ # Role-based live dashboards
โ โ โโโ projects/ # Project CRUD + details
โ โ โโโ submissions/ # Photo submissions + review
โ โ โโโ users/ # Admin user management
โ โ โโโ tips/ # Citizen tips management
โ โ โโโ reports/ # Analytics + print/PDF
โ โโโ public/
โ โ โโโ map/ # Public project map
โ โ โโโ tips/ # Anonymous tip submission
โ โโโ login/ # Authentication
โ
โโโ components/
โ โโโ dashboard/ # Charts, stats cards, activity feed
โ โโโ submissions/ # PhotoUpload, ReviewPanel, GPSVerification
โ โโโ projects/ # ProjectForm, MilestonesList
โ โโโ users/ # UserStatusButton
โ โโโ tips/ # TipActionButton
โ โโโ public/ # PublicMapClient, TipSubmissionForm
โ
โโโ lib/
โ โโโ actions/ # All server actions
โ โ โโโ auth.ts
โ โ โโโ projects.ts
โ โ โโโ submissions.ts
โ โ โโโ reviews.ts
โ โ โโโ notifications.ts
โ โ โโโ analytics.ts
โ โ โโโ users.ts
โ โ โโโ tips.ts
โ โโโ utils/
โ โ โโโ gps.ts # Haversine formula
โ โ โโโ exif.ts # EXIF GPS extraction
โ โ โโโ offline-queue.ts # IndexedDB offline queue
โ โโโ supabase/ # Client + server Supabase instances
โ
โโโ public/
โ โโโ sw.js # Service Worker
โ โโโ manifest.json # PWA manifest
โ
โโโ middleware.ts # Auth + role protection
| Week | Feature | Status |
|---|---|---|
| Week 1 | Authentication & Setup | โ Complete |
| Week 2 | Projects & Milestones | โ Complete |
| Week 3 | Photo Upload + GPS Verification | โ Complete |
| Week 4 | Review & Approval Workflow | โ Complete |
| Week 5 | Analytics & Live Dashboards | โ Complete |
| Week 6 | Maps, Reports, Tips, User Management | โ Complete |
| PWA | Offline Support & Camera Capture | โ Complete |
- Row Level Security โ Supabase RLS policies on all tables
- JWT Authentication โ Tokens managed by Supabase, never in localStorage
- Server-side role checks โ All sensitive actions verify role server-side
- GPS anti-fraud โ EXIF data cannot be spoofed through the UI
- Audit trail โ Every review action permanently logged
- Private storage โ Photos in private Supabase bucket, signed URLs required
- Open the app in Chrome
- Tap the โฎ menu โ Add to Home Screen
- App installs with offline support
- Open the app in Safari
- Tap the Share button โ Add to Home Screen
- App installs with offline support
# 1. Login as admin โ verify dashboard stats
# 2. Create a project with GPS coordinates
# 3. Login as contractor โ submit photos
# 4. Login as official โ review submission
# 5. Approve โ verify project completion % updates
# 6. Visit /public/map โ verify project is visible
# 7. Submit tip from /public/tips โ verify in /tipsTest offline:
- Chrome DevTools โ Network โ set Offline
- Upload a photo โ see ๐ถ QUEUED badge
- Switch back to No throttling
- Watch auto-upload within 2 seconds โ
Group 12 โ 10 members
| Area | Responsibility | Size |
|---|---|---|
| Frontend | React components, UI/UX, responsive layout | 4 members |
| Backend | Server actions, database, RLS policies | 3 members |
| Integration | GPS verification, testing, PWA | 2 members |
| Documentation | README, UML diagrams, presentation | 1 member |
This project was built for academic purposes by Group 12.
Built with โค๏ธ in Ghana ๐ฌ๐ญ
Next.js + Supabase + TypeScript โข Group 12 โข 2026