CivicConnect is a full-stack smart city services portal for residents, staff, department administrators, and super admins.
The app includes:
- Resident civic request submission and tracking
- Staff request queues with status updates and internal notes
- Permit applications, review queues, fee receipts, and certificates
- City announcements, emergency broadcasts, and event registration
- Analytics dashboards for department and city leadership
- Role-aware navigation and protected frontend routes
Frontend:
- Next.js 16 App Router
- React 18
- TypeScript
- Tailwind CSS
- TanStack Query
- Zustand
- Radix UI primitives
- Recharts
Backend:
- Node.js
- Express 5
- MongoDB with Mongoose
- JWT authentication
- bcrypt password hashing
- Token blacklist logout support
.
├── backend/ # Express API
├── frontend/ # Next.js app
└── README.mdInstall dependencies:
cd backend
npm ci
cd ../frontend
npm ciCreate local env files:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env.localStart the backend:
cd backend
npm run devStart the frontend in another terminal:
cd frontend
npm run devOpen:
http://localhost:3000Backend health check:
http://localhost:5004/api/healthBackend backend/.env:
PORT=5004
NODE_ENV=development
MONGO_URI=mongodb://localhost:27017/aurex
JWT_SECRET_KEY=replace-with-a-secure-random-secret
FRONTEND_URL=http://localhost:3000
# CORS_ORIGINS=http://localhost:3000,https://your-frontend.vercel.appFrontend frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:5004For production, set NEXT_PUBLIC_API_URL to the deployed backend origin, for example:
NEXT_PUBLIC_API_URL=https://your-api.onrender.comBackend:
npm run dev # nodemon development server
npm start # production serverFrontend:
npm run dev # development server
npm run build # production build
npm start # run production build
npm run lint # ESLintPublic:
GET /api/healthPOST /api/auth/registerPOST /api/auth/login
Authenticated:
GET /api/auth/profilePOST /api/auth/logoutGET /api/requestsPOST /api/requestsPATCH /api/requests/:idGET /api/permitsPOST /api/permitsPATCH /api/permits/:idGET /api/announcementsPOST /api/announcementsPATCH /api/announcements/:id/readGET /api/eventsPOST /api/events/:id/registerGET /api/analytics/overview
Public:
//login/register
Resident:
/resident/resident/requests/resident/permits/resident/announcements
Staff:
/staff/staff/requests/staff/permits/staff/announcements
Department Admin:
/dept-admin/dept-admin/requests/dept-admin/permits/dept-admin/announcements/dept-admin/analytics/dept-admin/staff-mgmt
Super Admin:
/super-admin/super-admin/requests/super-admin/permits/super-admin/announcements/super-admin/analytics/super-admin/staff-mgmt
The frontend and backend are designed to deploy as separate services.
Deploy backend/ to any Node hosting provider.
Build command:
npm ciStart command:
npm startSet environment variables:
NODE_ENV=productionPORTif your host does not inject it automaticallyMONGO_URIJWT_SECRET_KEYFRONTEND_URLorCORS_ORIGINS
Use MongoDB Atlas or another managed MongoDB instance for production.
Deploy frontend/ to a Next.js host such as Vercel.
Build command:
npm run buildOutput:
.nextSet environment variables:
NEXT_PUBLIC_API_URL=https://your-backend-domain
The frontend rewrites /api/* requests to NEXT_PUBLIC_API_URL/api/*, so the browser can keep using same-origin /api paths.
Before deploying:
cd frontend
npm run lint
npx tsc --noEmit
npm run build
cd ../backend
node --check index.js
node --check routes/platform.routes.js
node --check controllers/platform.controllers.jsAfter deploying:
- Visit the frontend landing page
- Register a user for each role
- Confirm each role lands on the correct dashboard
- Confirm
/api/healthreturns200 - Confirm
NEXT_PUBLIC_API_URLpoints to the backend origin - Confirm backend
CORS_ORIGINSincludes the deployed frontend origin
Authentication users and token blacklisting use MongoDB.
The current non-auth module APIs for requests, permits, announcements, events, and analytics use seeded in-memory data so the full product demo works immediately. For a production launch, replace those seeded stores in backend/controllers/platform.controllers.js with MongoDB models and persistence.