CivicConnect is a web-based platform that allows citizens to report city issues such as potholes, trash, broken streetlights, and other public concerns. The system provides a geo-tagging map interface, upvoting features to prioritize reports, and an audit trail to ensure transparency when staff update issue statuses.
- Vue.js (^3.5.25) — progressive UI framework
- Vite (^7.2.4) — fast build tool and dev server
- Tailwind CSS (^4.1.18) — utility-first CSS framework
- Axios (^1.13.2) — HTTP client
- Pinia (^3.0.4) — state management
- Vue Router (^4.6.3) — client-side routing
- Vue Toastification — toast notifications
- Heroicons/vue — icons
- ESLint + Prettier — linting and formatting
- Leaflet.js
- OpenStreetMap
- PHP (vanilla)
- PHPMailer — email, OTP, verification
- Dotenv (phpdotenv) — environment variables
- Composer — PHP dependency manager
- MySQL (local development)
- PostgreSQL / Supabase (cloud deployment)
- Local storage (
/backend/uploads) for issue images
- Submit Issues: Report problems with description, category, location (map pin), and photo.
- My Issues: View and track status of issues you have reported.
- Upvote: Upvote existing issues to increase priority.
- Track Status: Receive updates when issue status changes.
- Security:
-
Email verification on signup.
-
OTP verification for login (optional/conditional).
-
Captcha protection.
-
- Notifications:
- In-app notification center for status updates.
- Email alerts for issue status changes.
- AI Chatbot Assistance:
- Interactive chatbot powered by Google Gemini AI.
- Provides help with reporting issues and navigating the platform.
- Context-aware responses and guidance.
- Dashboard: View assigned or relevant issues.
- Issue Management: Update status (Pending → In Progress → Resolved).
- Audit Trail: All actions are automatically logged.
- Filtering: Sort/filter issues by status or upvotes.
- Reports & Analytics: Access analytics dashboard with issue statistics and trends.
- Admin Dashboard: Overview of system activity.
- User Management: Manage users, assign roles (Citizen / Staff).
- Staff Management: Create and manage staff accounts.
- Audit Logs: Full transparency with efficient audit log viewing.
- System Stats: View key metrics.
id, email, password_hash, first_name, last_name, phone, location, email_verified, otp_code, role, last_login, created_at
id, user_id, title, description, category, location, latitude, longitude, status, priority, image_path, upvote_count, is_anonymous, created_at, resolved_at
id, issue_id, user_id, created_at
id, user_id, issue_id, type, title, message, old_status, new_status, is_read, created_at
id, user_id, action, entity_type, entity_id, old_values, new_values, ip_address, user_agent, created_at
- Node.js: ^20.19.0 or >=22.12.0
- npm: ^11.7.0
- PHP: 7.4+ (recommended 8.0+)
- MySQL: 5.7+
- Vue (official)
- Todo+
- Eslint
- Prettier
- Tailwind CSS Intellisense
# Clone your fork
git clone https://github.com/YOUR_USERNAME/civic-connect.git
cd civic-connect
# Add upstream (if working in a team)
git remote add upstream https://github.com/EbadShelby/civic-connect.git- Create a MySQL database named
civic_connectfor local setup. - Import the local schema:
source database.sql;
- For Supabase/PostgreSQL cloud setup, use:
source database_postgres.sql;
- Create Admin Account:
Register a new user via the frontend (register page), then run the migration script to promote them to admin:
php migrate_admin.php
cd backend
cp .env.example .env
composer installUpdate .env with your credentials:
- Database host, user, password, name
- SMTP settings for email (Gmail/Mailtrap)
Run Backend:
Ensure your web server (Apache/Nginx via XAMPP/MAMP) points to the project root or backend folder.
Base URL in frontend config is set to: http://localhost/civic-connect/backend/api (Adjust in frontend/src/stores/ if different).
cd frontend
npm install
npm run devcivic-connect/
├─ frontend/ # Vue 3 + Vite App
│ ├─ src/
│ │ ├─ views/ # Page components (Citizen, Staff, Admin)
│ │ ├─ stores/ # Pinia state stores
│ │ └─ router/ # Vue router config
│ └─ package.json
│
├─ backend/ # PHP API
│ ├─ api/
│ │ └─ controllers/ # Logic for Issues, Users, Staff
│ ├─ config/ # DB & Mailer config
│ ├─ uploads/ # Stored images
│ └─ composer.json
│
├─ database.sql # MySQL schema (local)
├─ database_postgres.sql # PostgreSQL schema (Supabase)
├─ migrate_admin.php # Utility to create admin
└─ README.md
MIT License — free to use, modify, and distribute for academic or personal projects.
For full cloud deployment without local server dependencies, follow:
DEPLOYMENT_VERCEL_RENDER_SUPABASE.md
POST /api/auth/register- Register new user with email verification.POST /api/auth/login- Login user.POST /api/auth/verify-email- Verify email with OTP code.POST /api/auth/resend-verification- Resend verification OTP.POST /api/auth/logout- Logout current user.POST /api/auth/forgot-password- Request password reset.POST /api/auth/verify-reset-code- Verify password reset code.POST /api/auth/reset-password- Reset password with code.
Legacy compatibility routes are also supported under /api/users/* for auth actions.
GET /api/issues- Fetch all issues (supports filtering by status, category, user).GET /api/issues/{id}- Get specific issue details.POST /api/issues- Create new issue (with image upload).PUT /api/issues/{id}- Update issue details.PUT /api/issues/{id}/status- Update issue status (Staff/Admin only).DELETE /api/issues/{id}- Delete issue (Admin only).GET /api/issues/my-issues- Get issues reported by current user.
POST /api/upvotes- Upvote an issue.DELETE /api/upvotes/{id}- Remove upvote.GET /api/upvotes/check- Check if user has upvoted an issue.
GET /api/users- Get all users (Admin only).GET /api/users/{id}- Get specific user details.PUT /api/users/{id}- Update user profile.DELETE /api/users/{id}- Delete user (Admin only).GET /api/users/profile- Get current user's profile.PUT /api/users/profile- Update current user's profile.
GET /api/staff- Get all staff members (Admin only).POST /api/staff- Create new staff account (Admin only).PUT /api/staff/{id}- Update staff account (Admin only).DELETE /api/staff/{id}- Delete staff account (Admin only).
GET /api/stats- Get system statistics (issues, users, resolution rate).GET /api/analytics- Get detailed analytics (Admin/Staff only).GET /api/audit- Get audit trail logs (Admin only).
GET /api/notifications- Fetch list of notifications (Supports pagination).GET /api/notifications/unread-count- Get count of unread notifications.PUT /api/notifications/{id}/read- Mark a specific notification as read.PUT /api/notifications/mark-all-read- Mark all notifications as read.
POST /api/chatbot- Send message to AI chatbot and get response.
Frontend uses /api/auth/* and automatically falls back to /api/users/* if a local route returns 404.
If SMTP env variables are missing, registration still completes, but email sending fails gracefully.
Set these in backend .env to enable email sending:
SMTP_HOSTSMTP_USERSMTP_PASSSMTP_PORTSMTP_FROMSMTP_FROM_NAME
Note: POST /api/auth/resend-verification requires SMTP to be configured. Without SMTP, this endpoint will return an error by design.
To unblock local login without verifying OTP, set in backend .env:
BYPASS_EMAIL_VERIFICATION_LOCAL=true(default behavior for localhost)- Optional global override:
BYPASS_EMAIL_VERIFICATION=true
Do not enable these bypass flags in production.