Skip to content

Lochit-Vinay/CivicTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

99 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ™οΈ CivicTrack

Intelligent Civic Issue Management Platform

Bridging the gap between citizens and local government through transparent, real-time issue tracking.

Go Next.js TypeScript PostgreSQL TailwindCSS

License: MIT Made with Go Auth

🌐 Live Demo


CivicTrack Landing Page


πŸ“– Table of Contents


πŸ’‘ About The Project

CivicTrack is a modern, full-stack civic issue management platform that empowers citizens to report public infrastructure problems β€” potholes, garbage overflow, water leakage, broken streetlights, and more β€” while giving government authorities dedicated tools to review, prioritize, assign, and resolve those issues efficiently.

Unlike traditional complaint portals that disappear into paperwork, CivicTrack is built around:

Pillar Description
πŸ“ Live Issue Tracking Every report is trackable from submission to resolution
πŸ›οΈ Role-Based Dashboards Tailored experiences for citizens, authorities, and admins
πŸ—ΊοΈ Geographic Reporting Automatic GPS capture for accurate issue location
πŸ”„ Real-Time Status Updates Citizens stay informed at every stage
🎨 Modern UI/UX A responsive, dark-themed, animation-rich interface

❗ The Problem

Citizens routinely report civic issues like potholes, garbage overflow, water leakage, and broken streetlights β€” but these complaints typically:

  • ❌ Disappear into paperwork
  • ❌ Lack transparency
  • ❌ Have no tracking mechanism
  • ❌ Provide zero status updates
  • ❌ Result in no accountability

CivicTrack digitizes the complete issue lifecycle, replacing opacity with a transparent, end-to-end tracking system.


✨ Key Features

πŸ” Authentication & Security

  • Google OAuth 2.0 sign-in
  • JWT-based session management
  • Role-based authorization (Citizen / Authority / Admin)
  • Protected routes and secure middleware validation

πŸ“ Issue Reporting

  • Report categories: potholes, garbage, water leakage, street lights, roads, drainage, and more
  • Image upload support
  • Automatic GPS coordinate capture via the Browser Geolocation API
  • Priority tagging and rich descriptions

πŸ—ΊοΈ Interactive Maps

  • Location-based issue visualization
  • Simplified, map-driven issue identification

πŸ“Š Issue Tracking & Lifecycle

  • Live status: Pending β†’ In Progress β†’ Resolved
  • Full timeline with authority assignment history
  • Detailed issue pages with images, GPS data, and reporter info

πŸ›οΈ Authority Dashboard

  • State-scoped issue visibility
  • Filter, assign, and manage issue tokens
  • Approve or reject submissions
  • Update status in real time

πŸ–₯️ Responsive, Modern UI

  • Dark theme with glassmorphism accents
  • Smooth Framer Motion animations
  • Fully responsive across devices

πŸ‘₯ User Roles

CivicTrack is built on a three-tier role system, ensuring accountability at every level.

πŸ™‹ Citizen

  • Sign in with Google
  • Report new civic issues
  • Upload photos & set priority
  • Auto-capture GPS location
  • Track submitted issues
  • View authority responses

🏒 State Authority

  • Secure authenticated login
  • View issues within their state only
  • Review & validate reports
  • Assign issue tokens
  • Update issue status
  • Reject invalid reports

πŸ›‘οΈ Super Admin

  • Full platform oversight
  • Manage all state authorities
  • View nationwide issue data
  • Create authority accounts
  • Monitor platform activity

This decentralized structure means every state manages its own issue queue, while the Super Admin retains complete national oversight.


πŸ› οΈ Tech Stack

Frontend

Technology Purpose
Next.js React framework & routing
React UI library
TypeScript Type-safe development
Tailwind CSS Utility-first styling
Framer Motion Animations
Lucide / React Icons Iconography

Backend

Technology Purpose
Go (Golang) Core backend language
Gin Framework REST API framework
PostgreSQL Relational database
Google OAuth Identity provider
JWT Session & auth tokens

πŸ—οΈ System Architecture

flowchart TD
    A[πŸ‘€ Client Browser] --> B[Next.js Frontend]
    B --> C[Gin REST API]
    C --> D[Authentication Middleware]
    D --> E[Handlers]
    E --> F[Services]
    F --> G[Models]
    G --> H[(PostgreSQL Database)]

    style A fill:#58a6ff,color:#fff
    style B fill:#000,color:#fff
    style C fill:#00ADD8,color:#fff
    style D fill:#f0883e,color:#fff
    style H fill:#4169E1,color:#fff
Loading

πŸ”„ Application Workflow

Issue Lifecycle

sequenceDiagram
    participant C as Citizen
    participant S as Backend
    participant A as State Authority

    C->>S: Submit issue (title, category, GPS, image)
    S->>S: Store issue & auto-assign to state
    S->>A: Notify authority of new issue
    A->>S: Review report & assign token
    A->>S: Update status (Pending β†’ In Progress β†’ Resolved)
    S->>C: Push status update
    Note over C,A: Full transparency at every step
Loading

Authentication Flow

flowchart LR
    A[Citizen clicks Google Login] --> B[Google OAuth]
    B --> C[Backend Verification]
    C --> D[JWT Generated]
    D --> E[JWT Stored Client-Side]
    E --> F[Protected Routes]
    F --> G[Role-Based Dashboard]
Loading

πŸ“ Project Structure

Backend

backend/
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ handlers/     # Request handlers
β”‚   β”œβ”€β”€ middleware/   # Auth & validation
β”‚   β”œβ”€β”€ models/       # Data models
β”‚   └── services/     # Business logic
└── main.go           # Entry point

Frontend

frontend/
β”œβ”€β”€ app/               # Next.js app router
β”œβ”€β”€ components/        # Reusable UI components
β”œβ”€β”€ hooks/             # Custom React hooks
β”œβ”€β”€ public/            # Static assets
└── styles/            # Global styling

πŸš€ Getting Started

Prerequisites

Make sure you have the following installed:

Installation

  1. Clone the repository

    git clone https://github.com/your-username/civictrack.git
    cd civictrack
  2. Backend setup

    cd backend
    cp .env.example .env   # Configure DB, JWT secret, OAuth keys
    go mod tidy
    go run main.go
  3. Frontend setup

    cd frontend
    cp .env.example .env.local   # Configure API URL & Google client ID
    npm install
    npm run dev
  4. Access the app

    Open civic-track in your browser. πŸŽ‰

Environment Variables

Variable Description Location
DATABASE_URL PostgreSQL connection string Backend
JWT_SECRET Secret key for signing JWTs Backend
GOOGLE_CLIENT_ID Google OAuth client ID Backend & Frontend
GOOGLE_CLIENT_SECRET Google OAuth client secret Backend
NEXT_PUBLIC_API_URL Base URL of the backend API Frontend

πŸ”‘ Demo Credentials

Use the following credentials to explore the different dashboards.

Citizen Login

  • Authentication: Google OAuth
  • Simply click Continue with Google on the login page.

🏒 State Authority

Field Value
Email statename_auth@civictrack.com
Password statename@123

πŸ›‘οΈ Super Admin

Field Value
Email admin_auth@civictrack.com
Password admin@123

⚠️ These are demo credentials intended for testing and showcasing the application.


πŸ“‘ API Overview

CivicTrack exposes a REST API built with Gin, secured via JWT and role-based middleware.

Category Description
Authentication Google OAuth login, JWT issuance & refresh
Issue Management Create, list, update, and view civic issues
Status Updates Transition issues through their lifecycle
Authority Dashboard State-scoped issue queries and assignment
User Management Profile and account operations
Role Verification Middleware-enforced access control

Security measures include:

  • JWT-based authentication on all protected routes
  • Role-based authorization middleware
  • Server-side request validation
  • Secure Google OAuth verification flow

πŸ–ΌοΈ Screenshots

Landing Page Login Page
Citizen Dashboard Authority Dashboard
Admin Dashboard Issue Details
Report Issue Map View

🎯 Why This Project

CivicTrack was built to demonstrate production-grade, full-stack engineering across the entire application lifecycle:

  • βœ… Scalable backend architecture in Go
  • βœ… Secure authentication & role-based access control
  • βœ… RESTful API design
  • βœ… Relational database design in PostgreSQL
  • βœ… Modern, responsive frontend engineering
  • βœ… Real-world problem solving with measurable civic impact

Skills demonstrated: Next.js Β· React Β· TypeScript Β· Tailwind CSS Β· Go Β· Gin Β· PostgreSQL Β· JWT Β· Google OAuth Β· REST APIs Β· RBAC Β· Geolocation APIs Β· Full-Stack System Design


πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


πŸš€ Crafted with ❀️ by Lochit Vinay

Building technology that creates real-world impact.

⭐ If you found CivicTrack useful, consider giving this repository a star!

About

Full-stack civic issue management platform built with Go, Next.js & PostgreSQL. Features Google OAuth, JWT authentication, role-based dashboards, geolocation-based issue reporting, and real-time issue tracking to improve civic transparency.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors