City Services Directory - MaVilleEnPoche.fr
Overview
Development of a complete web platform for local services and businesses directory for all French municipalities. The site allows users to search and view practical information (opening hours, contacts, addresses) for all available businesses and services in their town.
Technical Architecture
Backend
- Main Framework: Django with MVT (Model-View-Template) architecture
- Database: PostgreSQL in production, SQLite in development
- REST API: Django REST Framework for search and geolocation endpoints
- Cache: Redis to optimize performance
- Asynchronous tasks: Celery with Redis as broker
- Storage: MinIO (S3-compatible) for static files
Frontend
- CSS Framework: Tailwind CSS with custom compilation
- JavaScript: Vanilla JS for dynamic interactions
- Responsive Design: Mobile-first with adaptive breakpoints
- Geolocation: HTML5 Geolocation API for automatic location
Main Features
Search and Navigation
- Real-time search of municipalities by name, postal code, or INSEE code
- Automatic geolocation to find the nearest municipality
- Navigation by alphabetical letters and filters by region/department
- Optimized pagination to handle large data volumes
Data Management
- Automatic data import from data.gouv.fr via Celery tasks
- Daily synchronization of business information
- Automatic categorization of businesses with translation system
- Management of relationships between municipalities and businesses
API and Integrations
- REST API for municipality search
- Geolocation API to find the nearest municipality
- Integration with OpenStreetMap for geographical data
- Automatic publication on social networks (Facebook, Twitter, Bluesky)
Data Models
Commune
- Administrative information (INSEE code, name, postal codes)
- Geographical data (GPS coordinates, area, population)
- Geographic outline in GeoJSON format
- Relationships with businesses in the municipality
Business
- Basic information (name, brand, type, address)
- Precise geographic coordinates
- Opening hours and contact details
- Accessibility (wheelchair accessible)
- Automatic categorization with translation system
CommerceCategory
- Hierarchical category system
- Automatic French translations
- Visual customization (colors, icons)
- Configurable display order
Technical Optimizations
Performance
- Redis cache for frequent queries
- Optimized pagination for large lists
- Indexed search fields
- Static file compression
Security
- HTTPS required in production
- Configured security headers (HSTS, X-Frame-Options)
- Input data validation
- CSRF protection on all forms
Maintenance
- Scheduled Celery tasks for automatic data import
- Structured logging system with verbosity levels
- Error handling and monitoring
- Automatic database backup
Deployment
- Containerization with Docker and Docker Compose
- WSGI Gunicorn server for production
- Reverse proxy with SSL configuration
- Automated monitoring and alerts
Technologies Used
- Django, PostgreSQL, Redis, Celery
- Django REST Framework, Django Tailwind
- MinIO, Boto3 for storage
- Docker, Gunicorn for deployment
- HTML5 Geolocation, Vanilla JavaScript
- Tailwind CSS, Responsive Design
Results
The site currently lists more than 35,000 French municipalities and several hundred thousand businesses and services, with an intuitive user interface and optimized performance for a smooth experience on all devices.