Overview
OpenCouncil’s consultation module provides a comprehensive tool for local governments to conduct public consultations on regulatory texts. Citizens can view regulations, explore geographic areas on interactive maps, and provide feedback on specific articles and locations.Core concepts
The consultation system is built around JSON-based regulation documents that combine textual content with geographic data.Regulation
Structured document with chapters, articles, and references
Geographic areas
Points, circles, and polygons organized in geosets
References
Cross-links between text and locations using
{REF:id} syntaxRegulation structure
Regulations follow a hierarchical structure defined by a JSON schema:Chapters
Top-level sections with introductory text and articlesExample: “General Provisions”, “Traffic Rules”, “Parking Regulations”
Articles
Individual regulation items with markdown contentExample: “Article 5: Speed Limits in Pedestrian Zones”
Geographic areas
Organized in geosets (groups of related areas)Example: “prohibited_areas” geoset containing archaeological sites and hills
User experience
Citizens interact with consultations through a clean, mobile-first interface.View modes
- Map view
- Document view
Features:
- Full-screen interactive map
- Overlay UI for layer control
- Hierarchical geoset selection
- Toggle controls for areas
- Detail panel for selected areas
- Mobile-optimized with collapsible UI
Navigation
A floating action button in the bottom right allows users to toggle between views with a single tap.Reference system
Text can reference other parts of the regulation:Clicking a reference navigates users to the appropriate view (text or map) and highlights the referenced element.
Data model
Consultation model
prisma/schema.prisma
Comment model
prisma/schema.prisma
Permalinks
Every important element has a shareable permalink:Consultation
Consultation
/[cityId]/consultations/[consultationId]Defaults to showing the map viewMap view
Map view
/[cityId]/consultations/[consultationId]/mapDirect link to interactive mapChapter
Chapter
/[cityId]/consultations/[consultationId]#chapter-[chapterId]Scrolls to specific chapter in document viewArticle
Article
/[cityId]/consultations/[consultationId]#article-[articleId]Highlights specific articleGeoset
Geoset
/[cityId]/consultations/[consultationId]/map#geoset-[geosetId]Shows specific geographic area groupGeometry
Geometry
/[cityId]/consultations/[consultationId]/map#geometry-[geometryId]Focuses on specific polygon or pointCopy link UI
Elements with permalinks display a clickable icon:- Hover: Shows “Copy link” tooltip
- Click: Copies link to clipboard
- Feedback: “Ο σύνδεσμος αντιγράφηκε” confirmation message
Public feedback system
Citizens can comment on specific elements:Text comments
- Regulation chapters
- Individual articles
Geographic comments
- Geosets (area groups)
- Specific locations/boundaries
Comment features
Map interface
The map view provides powerful visualization and interaction:Layer control
Geoset hierarchy
Geoset hierarchy
- Top level: Geoset groups (e.g., “Prohibited Areas”)
- Second level: Individual areas within each geoset
- Toggle controls for visibility
- Visual distinction between types
Mobile optimization
Mobile optimization
- Collapsible UI behind a button
- Touch-friendly controls
- Responsive layout
- Maximizes map visibility
Detail panel
Sliding panel interface for viewing area details:- Displays geoset/area information
- Shows related regulation text
- Integrated commenting system
- Smooth transitions
Example: Athens scooter regulation
The initial implementation demonstrates the system with Athens’ electric scooter regulation:Content structure
- General provisions
- Traffic rules
- Parking regulations
- Penalties
- Purpose and scope
- Definitions (e-scooter, user, parking zone)
- Age and licensing requirements
Geographic elements
Administrator tools
Super administrators have access to specialized tools for consultation management.Map-based geolocation editor
A comprehensive editing interface for converting textual location descriptions into GeoJSON:Problem: Many regulations define boundaries textually (e.g., “the area enclosed by streets A, B, and C”) rather than with coordinates.Solution: In-map drawing tools with real-time preview.
Editor features
Access control
- Only visible to super administrators
- Toggle button in layer controls panel
- “Λειτουργία Επεξεργασίας” (Editing Mode)
Visual status system
- ✓ Original data exists
- 💾 Locally saved edits
- ⚠️ Missing geometry
- 🎯 Selected for editing
Contextual help
- Textual definitions displayed during editing
- Auto-zoom to geometry location
- Street labels for orientation
Drawing tools
- Point mode: Single-click location markers
- Polygon mode: Multi-click boundary drawing
- Visual feedback during drawing
- Powered by Mapbox GL Draw
Local persistence
- Changes saved to browser localStorage
- Real-time preview on map
- Blue styling for edited geometries
- No server changes until export
Editing workflow
1. Enable editing mode
1. Enable editing mode
Click the editing toggle to activate:
- Street name labels appear
- Edit buttons show next to geometries
- Drawing tools become available
2. Select geometry
2. Select geometry
Click edit button (✏️) next to any geometry:
- Map auto-zooms to location (if coordinates exist)
- Geometry entry highlighted in blue
- Textual definition displayed
- Drawing mode activated
3. Draw geometry
3. Draw geometry
Choose drawing mode and create shape:
- Points: Single click
- Polygons: Multiple clicks, auto-close
- Visual feedback during drawing
4. Automatic saving
4. Automatic saving
Geometry immediately:
- Saved to localStorage
- Displayed on map (blue styling)
- Marked with save icon (💾)
5. Export complete data
5. Export complete data
Click export button to:
- Merge all edits with original
- Download regulation.json
- Use in production
Implementation notes
JSON schema
Regulations must follow the defined schema:City feature flag
Regulation storage
Regulation JSON files are stored externally (e.g., S3, CDN) and referenced by URL in theConsultation.jsonUrl field.
Future features
Multi-regulation support
Support multiple active consultations per city for different policies
Version comparison
Tools to compare different versions of regulations and track changes
Analytics dashboard
Track citizen engagement, popular sections, and comment patterns
Export capabilities
Generate reports of public feedback for municipal review
Best practices
Start with clear structure
Start with clear structure
Organize regulations into logical chapters and articles before defining geographic areas.
Use descriptive IDs
Use descriptive IDs
Choose meaningful IDs for references:
prohibited_areas not area1.Provide textual definitions
Provide textual definitions
Always include textual boundary descriptions even when GeoJSON exists.
Test on mobile
Test on mobile
Ensure map controls and navigation work well on mobile devices.
Review comments regularly
Review comments regularly
Establish a process for reviewing and responding to citizen feedback.
File reference
Key implementation files
prisma/schema.prisma- Consultation models (lines 856-918)docs/consultations.prd.md- Detailed PRDjson-schemas/regulation.schema.json- Regulation JSON schema- Map editor implementation (to be created)