A Full-Stack GIS-Based Infrastructure Management System built using React, TypeScript, Node.js, PostgreSQL, Prisma, and PostGIS.
SmartInfra helps government agencies, municipalities, and organizations manage infrastructure assets, maintenance operations, complaints, and service workflows through an interactive GIS dashboard.
Live demo: smartinfra-gis-client.onrender.com
- JWT Authentication
- Secure Login/Register
- Role-Based Access Control
- Admin
- Engineer
- Citizen
- Create Assets
- Update Assets
- Delete Assets
- View Asset Details
- Real PostGIS spatial location (
geometry(Point, 4326)), auto-synced from lat/lng on create & update - Proximity search β find assets within a radius using
ST_DWithin+ST_Distance(accurate, Earth-curvature-aware, viageographycast) - GeoJSON export of assets
- Asset Categorization
- Asset Status Monitoring
- Health Score Tracking
- Health History Timeline
- Maintenance History
- Asset Activity Timeline
- Create Maintenance Tickets
- Assign Engineers
- Update Ticket Status
- Ticket Tracking
- Maintenance Logs
- Create Complaints
- Complaint Tracking
- Assign Complaint to Engineer
- Resolve Complaints
- Complaint Timeline
- Real-Time Notification System
- Complaint Updates
- Ticket Updates
- Asset Updates
- Asset Overview
- Complaint Overview
- Maintenance Overview
- System Statistics
- Assigned Complaints
- Assigned Tickets
- Asset Monitoring
- Complaint Tracking
- Complaint Status Monitoring
This is the part that makes SmartInfra a GIS platform rather than just a dashboard with coordinates attached:
Assetcarries a real PostGISgeometry(Point, 4326)column (location), alongside the originallatitude/longitudefields.locationis kept in sync automatically whenever an asset is created or updated β no manual step required.GET /api/assets/nearbyruns a real spatial query (ST_DWithin) directly in Postgres, filtering by radius efficiently instead of loading every row and comparing coordinates in JavaScript.- Distance is computed with
ST_Distanceon ageographycast, so it reflects real-world distance on a curved Earth rather than flat-plane approximation. - A GiST spatial index on
locationkeeps proximity queries fast as the dataset grows. - Since Prisma has no native geometry support, spatial columns are marked
Unsupported(...)in the schema and queried via$queryRaw/$executeRaw.
Next up: the same pattern for Complaint, and an interactive map (Leaflet/MapLibre) rendering these spatial queries visually instead of raw JSON.
- React
- TypeScript
- Tailwind CSS
- React Router DOM
- Axios
- Node.js
- Express.js
- TypeScript
- PostgreSQL
- Prisma ORM
- PostGIS (real spatial queries β see section above)
- JWT
- bcrypt
smartinfra-gis/
β
βββ client/
β βββ src/
β β βββ pages/
β β βββ components/
β β βββ routes/
β β βββ api/
β β βββ context/
β
βββ server/
β βββ src/
β β βββ controllers/
β β βββ services/
β β βββ repositories/
β β βββ routes/
β β βββ middleware/
β β βββ utils/
β β βββ prisma/
β
βββ README.md- Authentication
- Roles
- Profile Management
- Infrastructure Assets
- Health Monitoring
- Real PostGIS spatial location (
geometry(Point, 4326))
- Maintenance Workflow
- Engineer Assignment
- Complaint Lifecycle
- Engineer Assignment
- Resolution Tracking
- Maintenance Records
- Audit History
- Complaint Activity Tracking
- User Notifications
git clone https://github.com/withaman69/SmartInfra-GIS.gitcd SmartInfra-GIScd serverInstall dependencies
npm installCreate .env file
DATABASE_URL="postgresql://username:password@localhost:5432/smartinfra_gis"
JWT_SECRET="your_secret_key"
PORT=5000Enable PostGIS on your database (one-time, per database):
CREATE EXTENSION IF NOT EXISTS postgis;Run Prisma
npx prisma generatenpx prisma migrate devStart Server
npm run devcd clientInstall dependencies
npm installStart frontend
npm run devDATABASE_URL=
JWT_SECRET=
PORT=POST /api/auth/register
POST /api/auth/login
GET /api/auth/meGET /api/assets
GET /api/assets/:id
POST /api/assets
PUT /api/assets/:id
DELETE /api/assets/:id
GET /api/assets/nearby?latitude=&longitude=&radius= # PostGIS ST_DWithin proximity search
GET /api/assets/geojson # GeoJSON export of all assetsGET /api/tickets
POST /api/tickets
PATCH /api/tickets/:idGET /api/complaints
POST /api/complaints
PATCH /api/complaints/:id/assign
PATCH /api/complaints/:id/resolveGET /api/maintenance-logs
POST /api/maintenance-logs- GIS-Based Infrastructure Monitoring with real PostGIS spatial queries
- Role-Based Access Control
- Complaint Lifecycle Management
- Maintenance Workflow Automation
- Infrastructure Health Tracking
- PostgreSQL + PostGIS Integration (spatial columns, GiST index,
ST_DWithin/ST_Distanceproximity search) - Full TypeScript Stack
- Actively developed β see PostGIS / Spatial Layer section for what's built vs. planned
Aman Kumar Singh Civil Engineering Student, NIT Goa Contributing to OSGeo's PostGIS/pgRouting projects as part of open-source work leading up to Google Summer of Code 2027.
This project is for educational, research, and portfolio purposes.