A smart city intelligence platform that bridges fragmented urban data sources into a unified NGSI-LD ecosystem, empowering communities and city managers with real-time infrastructure insights and open data access
Explore the platform Β»
π Report Bug
|
β¨ Request Feature
|
π¬ Join Discussion
|
π Documentation
- π Real-time air quality and environmental monitoring (NGSI-LD aligned)
- π Citizen-Powered Infrastructure Reporting with photo uploads & geolocation
- π€ Automated classification and prioritization for city operations & RAG system
- ποΈ NGSI-LD Compliant Smart City Data Models (ETSI standard)
- π Open Data Access via public API & standard exports: GeoJSON, NDJSON, CSV
- β‘ One-Command Setup with Just task runner & UV package manager
- π Access control for citizens, city staff, and admins
Expand contents
UrbanReflex is an open-source smart city platform designed to address critical urban challenges through integrated data-driven solutions, combining real-time environmental monitoring with citizen engagement tools for transparent, efficient urban governance.
Built on NGSI-LD standards, the platform unifies infrastructure data, air quality monitoring, and citizen reports into actionable intelligence. Through open data access, AI-powered analytics, and real-time insights, it enables communities and city managers to make informed decisions that drive sustainable urban development and transparent governance.
This release focuses on developer experience improvements, automation, and production readiness.
- Just Task Runner: 16+ pre-configured recipes for all development tasks
- UV Auto-Installation:
just installautomatically installs UV + all dependencies - Dual Environment Setup: Separate configuration for backend (
.env) and frontend (.env.local) - Zero Configuration: No manual dependency installation required
- 12 Languages: English, Vietnamese, Spanish, French, German, Chinese, Japanese, Korean, Arabic, Russian, Portuguese, Hindi
- Google Translate Integration: Real-time UI translation without page reload
- Language Persistence: Selected preference stored in browser
- Updated Dependencies: Next.js 16.0.7, Prettier 3.2.5
- Code Quality Tools: Black, Flake8, isort, ESLint, Prettier pre-configured
- Pre-commit Hooks: Automatic code quality checks with Husky
- Comprehensive Documentation: Complete setup guide with troubleshooting
- Fixed
ModuleNotFoundErrorfor backend models package - Fixed Just command PowerShell syntax errors on Windows
- Fixed frontend environment file location
See CHANGELOG.md for full release notes.
β
Just task runner # https://just.systems/
β
Docker Desktop # https://www.docker.com/
β
8GB RAM minimum# 1. Clone repository
git clone https://github.com/minhe51805/UrbanReflex.git
cd UrbanReflex
# 2. Install Just (if not already installed)
winget install Casey.Just # Windows
brew install just # macOS
cargo install just # Linux
# 3. Install all dependencies (one command!)
just install
# β
Auto-installs UV, Python packages, npm packages
# 4. Setup environment files
just setup-env
# β
Creates .env and src/frontend/.env.local from examples
# 5. Start all services (one command!)
just dev
# β
Starts MongoDB, Orion-LD, and Scheduler with Docker ComposeDone! π
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/docs
- Orion-LD: http://localhost:1026
Note: To run backend/frontend locally (without Docker), use separate terminals:
just backend-dev # Terminal 2: Backend dev server just frontend-dev # Terminal 3: Frontend dev server
β UV installation error on Windows
If just install fails with UV path errors:
# Option 1: Restart terminal and try again
just install
# Option 2: Install backend separately
just backend-install
# Option 3: Manual UV installation
irm https://astral.sh/uv/install.ps1 | iex
# Restart terminal, then: uv sync --all-extrasβ Database connection error
Make sure databases are running:
just db-start
just db-logs # Check for errorsClick to expand configuration
Edit .env for backend:
GEMINI_API_KEY=your-key # For AI chatbot
PINECONE_API_KEY=your-key # For vector search
OPENAQ_API_KEY=your-key # For real air quality dataEdit src/frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000App works without API keys (uses mock data)
| Technology | Purpose |
|---|---|
| FastAPI | High-performance async API framework |
| Python 3.10+ | Backend runtime |
| MongoDB | Document database for users and reports |
| Orion-LD | NGSI-LD compliant context broker |
| Redis | In-memory caching and sessions |
| Gemini AI | Natural language understanding |
| Pinecone | Vector search for semantic similarity |
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router |
| TypeScript | Type-safe development |
| Tailwind CSS | Utility-first styling |
| MapLibre GL | Interactive WebGL mapping |
| Chart.js | Data visualization |
| Framer Motion | Smooth UI animations |
| Technology | Purpose |
|---|---|
| Docker Compose | Multi-service orchestration |
| Just | Task automation |
| UV | Fast Python package manager |
| Husky | Git hooks for code quality |
UrbanReflex/
βββ src/
β βββ backend/ # FastAPI Backend
β β βββ app.py # Main application entry
β β βββ routers/ # API endpoint definitions
β β βββ models/ # Database models
β β βββ schemas/ # Pydantic validation schemas
β β βββ ai_service/ # Gemini AI & Pinecone integration
β β βββ utils/ # Utility functions
β βββ frontend/ # Next.js 16 Frontend
β βββ app/ # App Router pages
β βββ components/ # React components
β βββ contexts/ # State management
β βββ lib/ # API clients & utilities
β βββ types/ # TypeScript definitions
βββ scripts/ # Data fetching & processing scripts
βββ docs/ # Project documentation
βββ open_data/ # Open datasets (GeoJSON, NDJSON)
βββ schemas/ # JSON schemas for data validation
βββ .justfile # Just task automation recipes
βββ pyproject.toml # Python dependencies (PEP 518)
βββ docker-compose.yml # Container orchestration
βββ LICENSE # GPL-3.0 license
just install # Install UV + backend deps + frontend deps (one command!)
just setup-env # Create .env and src/frontend/.env.local from examplesjust dev # Start databases + show instructions for backend/frontend
just backend-install # Install backend dependencies only
just backend-dev # Start backend API (port 8000)
just frontend-install # Install frontend dependencies only
just frontend-dev # Start frontend app (port 3000)just db-start # Start MongoDB + Orion-LD
just db-stop # Stop databases
just db-restart # Restart databases
just db-logs # View database logs
just db-clean # Remove all database data (with confirmation)just format # Format all code (Black + Prettier)
just lint # Run linters (Flake8 + ESLint)
just test # Run backend testsjust info # Show project info, ports, and quick start guide
just health # Check backend health endpoint
just clean # Clean build artifacts and cache
just stop-all # Stop all running services
just code # Open project in VS Code| Document | Description |
|---|---|
| API Reference | Complete REST API documentation |
| Architecture | System design and components |
| Development Setup | Local development guide |
| Data Model | NGSI-LD entity definitions |
| User Guide | End-user manual |
| Code Style Guide | Coding conventions |
- Click any road segment on the map to view complete infrastructure information: weather conditions, air quality, streetlights, and nearby public facilities
- Report infrastructure issues (broken streetlights, potholes, waste dumping, flooding) with automatic GPS location and photo documentation
- Track real-time resolution status of submitted reports with automatic updates and notifications
- Explore open data to gain deeper insights about your neighborhood and make informed decisions
- Real-time dashboard displaying all citizen reports on an interactive map with powerful filtering capabilities
- AI-powered automatic issue classification and priority adjustment based on proximity to schools, hospitals, and sensitive areas
- Data-driven task management and maintenance assignment, optimizing resource allocation and response times
- Export open data in multiple formats (NDJSON, CSV, GeoJSON) for deep analysis and urban planning
- Access complete NGSI-LD entities (RoadSegment, WeatherObserved, AirQualityObserved, Streetlight, PointOfInterest, CitizenReport) via standard REST API
- Build custom applications leveraging Linked Open Data (LOD) relationships between entities
- Integrate with other smart city systems through FiWARE Smart Data Models and SOSA/SSN ontology compliance
- Contribute to open-source smart city platform with comprehensive, ready-to-use open datasets
We are excited that you are interested in contributing to this project! Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
Read through our contributing guidelines to learn about our submission process, coding rules, and more.
Want to report a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
| Metric | Badge |
|---|---|
| π Stars | |
| π΄ Forks | |
| ποΈ Watchers | |
| π₯ Contributors | |
| π Commits | |
| π Issues | |
| π― Pull Requests | |
| π Last Commit | |
| π¦ Code Size | |
| π License |
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Key Points:
- β Free to use, modify, and distribute
- β Source code must be made available
- β Modifications must use same GPL-3.0 license
- π Full license: https://www.gnu.org/licenses/gpl-3.0.html
UrbanReflex v0.2.0 β Smart City Intelligence Platform
π Homepage β’ π Documentation β’ π Report Bug β’ π¬ Discussions