project-57ad200a

bySebastien Drure

Construit moi une application "France Activités Enfants" : VPS + Node.js + PostgreSQL/PostGIS + PWA (Vue.js/Leaflet) + modèle collaboratif + emails + géocodage local. 📌 Spécifications Techniques Finales Objectif : Cartographier les activités extra-scolaires en France avec : Carte interactive (Leaflet + OpenStreetMap). Filtres (type, âge, rayon autour d’un code postal/géolocalisation). Modèle collaboratif : Ajout par les utilisateurs + validation manuelle. Signalements : Possibilité de signaler une activité obsolète. Partage par lien pour chaque activité. Emails : Notifications aux admins pour les ajouts/signalements. Géocodage local : Table codes_postaux pour éviter les APIs externes. 🏗️ Architecture Composant Technologie Rôle Frontend Vue.js 3 + Vite + Pinia PWA avec carte Leaflet, filtres, formulaires. Backend Node.js + Express API REST pour gérer les activités, utilisateurs, signalements. Base de données PostgreSQL + PostGIS Stockage des activités, codes postaux, utilisateurs, signalements. Carte Leaflet + OpenStreetMap Affichage interactif avec marqueurs personnalisés. Emails Nodemailer + Mailgun Notifications aux admins (ajouts/signalements). Hébergement Ton VPS Backend (Node.js) + Frontend (fichiers statiques) + Base de données. Reverse Proxy Nginx Routing des requêtes API (/api) et frontend. HTTPS Certbot (Let’s Encrypt) Sécurisation du site. 🗃️ Base de Données (PostgreSQL + PostGIS) Tables Principales 1. codes_postaux (Géocodage local) Champ Type Description code_postal VARCHAR(10) Clé primaire (ex: "75001"). ville VARCHAR(100) Nom de la ville. latitude FLOAT Coordonnée GPS. longitude FLOAT Coordonnée GPS. geom GEOMETRY Point géospatial (PostGIS). 2. types_activites (Catégories) Champ Type Description id SERIAL Clé primaire. nom VARCHAR(50) Nom du type (ex: "Sport"). icone VARCHAR(50) Nom du fichier SVG (ex: "sport.svg"). 3. utilisateurs (Comptes utilisateurs) Champ Type Description id SERIAL Clé primaire. email VARCHAR(255) Email unique. mot_de_passe VARCHAR(255) Mot de passe haché (bcrypt). role VARCHAR(20) utilisateur ou admin. date_inscription TIMESTAMP Date de création. 4. activites (Activités extra-scolaires) Champ Type Description id SERIAL Clé primaire. nom VARCHAR(100) Nom de l’activité. description TEXT Description détaillée. id_type INTEGER Clé étrangère → types_activites.id. age_min INTEGER Âge minimum. age_max INTEGER Âge maximum. adresse VARCHAR(255) Adresse postale. code_postal VARCHAR(10) Clé étrangère → codes_postaux.code_postal. ville VARCHAR(100) Ville. latitude FLOAT Coordonnée GPS. longitude FLOAT Coordonnée GPS. horaires VARCHAR(255) Horaires d’ouverture. telephone VARCHAR(20) Numéro de téléphone. email VARCHAR(255) Email de contact. site_web VARCHAR(255) URL du site web. validee BOOLEAN TRUE si validée par un admin. id_utilisateur INTEGER Clé étrangère → utilisateurs.id. date_ajout TIMESTAMP Date de création. geom GEOMETRY Point géospatial (PostGIS). 5. signalements (Signalements d’activités obsolètes) Champ Type Description id SERIAL Clé primaire. id_activite INTEGER Clé étrangère → activites.id. id_utilisateur INTEGER Clé étrangère → utilisateurs.id. raison VARCHAR(100) Raison du signalement. message TEXT Message de l’utilisateur. statut VARCHAR(20) en_attente ou resolu. date_signalement TIMESTAMP Date du signalement. Index et Extensions sql Copier -- Activer PostGIS CREATE EXTENSION postgis; -- Index géospatiaux pour les requêtes de proximité CREATE INDEX idx_activites_geom ON activites USING GIST(geom); CREATE INDEX idx_codes_postaux_geom ON codes_postaux USING GIST(geom); -- Mettre à jour les colonnes geom UPDATE codes_postaux SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326); UPDATE activites SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326); 🔌 Backend (Node.js + Express) Fonctionnalités Endpoint Méthode Description Authentification /api/activites GET Liste toutes les activités validées. Non /api/activites/proches GET Liste les activités dans un rayon autour d’un point (lat/long). Non /api/activites POST Ajouter une activité (en attente de validation). Oui (utilisateur) /api/activites/:id/valider PATCH Valider une activité (admin seulement). Oui (admin) /api/activites/:id DELETE Supprimer une activité (admin seulement). Oui (admin) /api/signalements POST Signaler une activité. Oui (utilisateur) /api/signalements/en-attente GET Liste les signalements en attente (admin seulement). Oui (admin) /api/signalements/:id/resoudre PATCH Marquer un signalement comme résolu (admin seulement). Oui (admin) /api/utilisateurs/login POST Connexion (retourne un token JWT). Non /api/utilisateurs POST Inscription (créer un compte utilisateur). Non /api/codes-postaux/:code GET Récupérer les coordonnées GPS d’un code postal. Non Exemple de Requêtes SQL Utilisées 1. Récupérer les activités dans un rayon de X km sql Copier SELECT a.*, t.nom as type_nom, t.icone as type_icone FROM activites a JOIN types_activites t ON a.id_type = t.id WHERE ST_DWithin( a.geom, ST_SetSRID(ST_MakePoint(:longitude, :latitude), 4326), :rayon * 1000 -- Convertir km en mètres ) AND a.validee = TRUE; 2. Récupérer les coordonnées d’un code postal sql Copier SELECT latitude, longitude, ville FROM codes_postaux WHERE code_postal = :code_postal; 🖥️ Frontend (PWA avec Vue.js + Leaflet) Pages/Composants Composant Description Home.vue Page principale : carte + barre de filtres + fiche détaillée des activités. Map.vue Carte Leaflet avec marqueurs (icônes personnalisées). FilterBar.vue Filtres : type, âge, rayon, code postal. ActivityCard.vue Fiche détaillée d’une activité (affichée dans une modale). AddActivityForm.vue Formulaire pour ajouter une activité (utilisateurs connectés). AdminDashboard.vue Tableau de bord admin : validation des activités + gestion des signalements. LoginForm.vue Formulaire de connexion/inscription. Fonctionnalités Clés Carte interactive : Centrage par géolocalisation ou code postal. Marqueurs avec icônes personnalisées (ex: ⚽ pour le sport). Cliquer sur un marqueur → affiche la fiche détaillée. Filtres : Type d’activité (liste déroulante). Âge (plages : 0-3 ans, 3-6 ans, etc.). Rayon (curseur de 0 à 50 km). Code postal (recherche + centrage automatique). Partage : Bouton "Partager" → copie le lien de l’activité (ex: ton-domaine.fr/activite/123). Ajout d’activité : Formulaire avec géocodage automatique (via code postal). Validation manuelle par un admin. Signalement : Bouton "Signaler un problème" → formulaire avec raison + message. 📂 Structure des Fichiers Backend (/backend) text Copier backend/ ├── config/ │ ├── db.js # Configuration PostgreSQL │ └── email.js # Configuration Nodemailer ├── controllers/ │ ├── activites.js │ ├── utilisateurs.js │ └── signalements.js ├── models/ │ ├── Activite.js │ ├── Utilisateur.js │ └── Signalement.js ├── routes/ │ ├── activites.js │ ├── utilisateurs.js │ └── signalements.js ├── middlewares/ │ └── auth.js # Middleware JWT ├── .env # Variables d'environnement ├── app.js # Configuration Express └── server.js # Lancement du serveur Frontend (/frontend) text Copier frontend/ ├── public/ │ └── index.html ├── src/ │ ├── assets/ │ │ └── icons/ # Icônes SVG (sport.svg, music.svg, etc.) │ ├── components/ │ │ ├── Map.vue │ │ ├── FilterBar.vue │ │ ├── ActivityCard.vue │ │ ├── AddActivityForm.vue │ │ └── AdminDashboard.vue │ ├── stores/ │ │ └── activites.js # Gestion des données (Pinia) │ ├── views/ │ │ ├── Home.vue │ │ └── Admin.vue │ ├── App.vue │ └── main.js ├── package.json └── vite.config.js

HomeLoginSignup
Home

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 6

project-57ad200a System Requirements Document

Introduction

The purpose of this document is to outline the system requirements for "project-57ad200a," a platform designed to map extracurricular activities for children in France. The application will feature an interactive map, user-generated content, and local geocoding to avoid reliance on external APIs.

System Overview

The "project-57ad200a" platform aims to provide a comprehensive mapping of extracurricular activities across France. It will include features such as an interactive map, user-generated content, and local geocoding. The system will be built using a combination of Vue.js for the frontend, Node.js for the backend, and PostgreSQL/PostGIS for the database.

Page 2 of 6

Source Content Inventory

  • Database Tables:

    • codes_postaux: Stores postal codes and their corresponding geospatial data.
    • types_activites: Contains categories of activities.
    • utilisateurs: Manages user accounts.
    • activites: Records details of extracurricular activities.
    • signalements: Logs reports of outdated activities.
  • Backend Endpoints:

    • /api/activites: Manage activities.
    • /api/signalements: Handle activity reports.
    • /api/utilisateurs: User authentication and management.
    • /api/codes-postaux: Retrieve geospatial data for postal codes.

Functional Requirements as Story Points

  • As a user, I should be able to view an interactive map displaying extracurricular activities.
  • As a user, I should be able to filter activities by type, age, and proximity to a postal code or geolocation.
  • As a user, I should be able to add new activities, which will require admin validation.
  • As an admin, I should be able to validate or delete activities.
  • As a user, I should be able to report outdated activities.
  • As an admin, I should be able to view and resolve reports of outdated activities.
  • As a user, I should be able to share activity details via a link.
  • As a user, I should receive email notifications for activity submissions and reports.
  • As an admin, I should receive email notifications for new activity submissions and reports.
  • As a user, I should be able to log in and manage my account.
  • As a user, I should be able to retrieve geospatial data for a postal code without using external APIs.
Page 3 of 6

User Personas

  • Regular User: Can browse activities, submit new activities, and report outdated ones.
  • Admin: Can validate and manage activities, resolve reports, and receive notifications.

Core User Flows

  • User logs in -> browses map -> filters activities -> views detailed activity info.
  • User submits new activity -> admin receives notification -> admin validates activity.
  • User reports outdated activity -> admin receives notification -> admin resolves report.
  • User shares activity link -> recipient views activity details.

Visuals Colors and Theme

  • primary: #1E3A8A (Deep Blue)
  • primary_light: #3B82F6 (Light Blue)
  • secondary: #F97316 (Orange)
  • accent: #10B981 (Green)
  • highlight: #F59E0B (Amber)
  • bg: #F3F4F6 (Light Gray)
  • surface: rgba(255, 255, 255, 0.8) (White)
  • text: #111827 (Dark Gray)
  • text_muted: #6B7280 (Muted Gray)
  • border: rgba(209, 213, 219, 0.2) (Light Gray)
Page 4 of 6

Signature Design Concept

Interactive Activity Map

The homepage will feature an interactive map that serves as the focal point of the application. Users can click on various markers representing different activities, which will animate and expand to show detailed information. The map will have a dynamic filter bar that slides in from the side, allowing users to refine their search criteria. The map will be built using Leaflet and OpenStreetMap, with custom SVG icons for different activity types. The interactive elements will be powered by motion/react for smooth transitions and animations.

Landing Hero Motion Brief

The landing page will feature a continuously moving 2D map animation. As users scroll, the map will zoom in on different regions of France, highlighting clusters of activities. When a user hovers over a region, the map will pause, and detailed activity cards will pop up, providing more information. The animation will loop every 10 seconds, ensuring a seamless user experience. The map will be responsive, adjusting to different screen sizes while maintaining its interactive features.

Interaction Model & Motion Direction

  • Interaction Model: Parallax
  • The landing page will utilize a parallax effect, with the map and activity markers moving at different speeds to create a sense of depth. This will enhance the storytelling aspect of the platform, drawing users into the experience.
Page 5 of 6

Non-Functional Requirements

  • The system must support high availability and scalability to handle a large number of users.
  • Data privacy and security must be ensured, particularly for user information and activity data.
  • The application should be optimized for performance, with fast load times and responsive design.

Tech Stack

  • Frontend: Vue.js 3 + Vite + Pinia
  • Backend: Node.js + Express
  • Database: PostgreSQL + PostGIS
  • Map: Leaflet + OpenStreetMap
  • Emails: Nodemailer + Mailgun
  • Hosting: VPS with Nginx as a reverse proxy
  • Security: HTTPS with Certbot (Let’s Encrypt)

Assumptions and Constraints

  • The application will be hosted on a VPS, which may limit scalability compared to cloud-based solutions.
  • Local geocoding will be implemented using a postal code table, reducing reliance on external geocoding APIs.
  • The system will require manual validation of user-submitted activities to ensure data accuracy.
Page 6 of 6

Glossary

  • PWA: Progressive Web App
  • VPS: Virtual Private Server
  • PostGIS: A spatial database extender for PostgreSQL
  • JWT: JSON Web Token
  • API: Application Programming Interface
  • Nginx: A web server that can also be used as a reverse proxy, load balancer, and HTTP cache

This document outlines the comprehensive requirements for "project-57ad200a," ensuring a robust and user-friendly platform for mapping extracurricular activities in France.

Home design preview
Login: Sign In
Admin: View Dashboard
Admin: Validate Activity
Admin: Delete Activity
Admin: View Reports
Admin: Resolve Report
Admin: View Notifications
Home: View Map
Home: View Activity Details
Home design preview
Login: Sign In
Admin: View Dashboard
Admin: Validate Activity
Admin: Delete Activity
Admin: View Reports
Admin: Resolve Report
Admin: View Notifications
Home: View Map
Home: View Activity Details