🗺️ LaMap - Cartographie des initiatives sociales, environnementales et solidaires pour trouver où s'engager près de chez soi
Plateforme web collaborative de cartographie des initiatives d'économie circulaire, sociale et solidaire (ESS) et associatives en France.
LaMap permet aux utilisateurs de :
- 📍 Découvrir des initiatives ESS et associatives locales sur une carte interactive
- ➕ Ajouter de nouvelles initiatives
- 🔍 Filtrer par type (ressourceries, AMAP, repair cafés, etc.)
- 🌍 Rechercher dans un rayon géographique
- 💬 Partager et commenter des initiatives
| Technologie | Version | Usage |
|---|---|---|
| Next.js | 15+ (App Router) | Framework React SSR/SSG |
| React | 19+ | Bibliothèque UI |
| TypeScript | 5+ | Typage statique |
| Tailwind CSS | 3+ | Styling utility-first |
| shadcn/ui | Latest | Bibliothèque de composants (Radix UI) |
| Jest | Latest | Tests unitaires |
| React Testing Library | Latest | Tests composants |
| Mapbox GL JS | Latest | Cartographie WebGL |
| Supabase | Latest (@supabase/ssr) | Backend (PostgreSQL + PostGIS + Auth) |
| PostGIS | Via Supabase | Requêtes géospatiales |
- Node.js 18+ (recommandé : 20+)
- npm, yarn, pnpm ou bun
- Un compte Supabase (gratuit)
- Un token Mapbox (gratuit jusqu'à 50k requêtes/mois)
git clone https://github.com/votre-username/lamap.git
cd lamapnpm install
# ou
yarn install
# ou
pnpm installCréez un fichier .env.local à la racine :
# Mapbox
NEXT_PUBLIC_MAPBOX_TOKEN=pk.eyJ1...votre_token
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGc...votre_key- Allez sur supabase.com
- Créez un nouveau projet
- Notez l'URL et la clé anonyme (dans Settings > API)
Exécutez ce SQL dans l'éditeur SQL de Supabase :
-- Activer PostGIS
CREATE EXTENSION IF NOT EXISTS postgis;
-- Table des initiatives
CREATE TABLE initiatives (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
description TEXT,
address TEXT,
location GEOGRAPHY(POINT, 4326) NOT NULL,
verified BOOLEAN DEFAULT false,
image_url TEXT,
website TEXT,
phone TEXT,
email TEXT,
opening_hours JSONB,
user_id UUID REFERENCES auth.users(id) ON DELETE SET NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Index spatial pour performance
CREATE INDEX initiatives_location_idx ON initiatives USING GIST(location);
CREATE INDEX initiatives_type_idx ON initiatives(type);
-- Row Level Security
ALTER TABLE initiatives ENABLE ROW LEVEL SECURITY;
-- Politiques RLS
CREATE POLICY "Lecture publique" ON initiatives
FOR SELECT USING (true);
CREATE POLICY "Création authentifiée" ON initiatives
FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Modification propriétaire" ON initiatives
FOR UPDATE USING (auth.uid() = user_id);npx supabase gen types typescript --project-id <votre-project-id> > src/lib/supabase/types.tsnpm run devOuvrez http://localhost:3000 dans votre navigateur.
npm testnpm test -- --watchnpm test -- --coveragelamap/
├── src/
│ ├── app/ # App Router Next.js
│ │ ├── layout.tsx # Layout racine
│ │ ├── page.tsx # Page d'accueil (carte)
│ │ ├── globals.css # Styles globaux
│ │ └── actions.ts # Server Actions
│ ├── components/ # Composants React
│ │ ├── Initiative/
│ │ │ └── InitiativeCard.tsx
│ │ ├── Map/
│ │ │ └── Map.tsx # Carte Mapbox
│ │ ├── ui/ # shadcn/ui components
│ │ │ ├── button.tsx
│ │ │ ├── card.tsx
│ │ │ ├── dialog.tsx
│ │ │ └── ...
│ │ ├── AddInitiativeForm.tsx
│ │ ├── FilterPanel.tsx
│ │ └── MapView.tsx # Vue principale
│ ├── lib/
│ │ ├── supabase/
│ │ │ ├── client.ts # Client Supabase navigateur
│ │ │ ├── server.ts # Client Supabase Server Components
│ │ │ └── types.ts # Types générés de la DB
│ │ └── utils.ts # Utilitaires (cn, etc.)
│ ├── types/
│ │ └── initiative.ts # Types TypeScript métier
│ └── __tests__/ # Tests Jest
│ ├── components/ # Tests unitaires
│ ├── integration/ # Tests d'intégration
│ └── lib/ # Tests des utilitaires
├── docs/ # 📚 Documentation projet
│ ├── QUICKSTART.md
│ ├── CONTEXT_ENGINEERING_GUIDELINES.md
│ ├── LEARNING_CONTEXT.md
│ ├── MAP_TROUBLESHOOTING.md
│ ├── BEST_PRACTICES.md
│ ├── STATUS.md
│ └── ...
├── public/ # Assets statiques
├── scripts/ # Scripts utilitaires
│ └── check-map.sh # Vérification configuration
├── __mocks__/ # Mocks Jest (Mapbox, Supabase)
├── .github/ # Configuration GitHub
│ └── copilot-instructions.md
├── .env.local # Variables d'environnement (non versionné)
├── jest.config.js
├── jest.setup.js
├── tailwind.config.ts
├── tsconfig.json
├── components.json # Configuration shadcn/ui
└── package.json
- Strict mode activé
- Toujours typer les props, fonctions et retours
- Utiliser les interfaces pour les objets
- Utiliser les types unions pour les énumérations
- Server Components par défaut
- Ajouter
'use client'uniquement si nécessaire (interactivité) - Props typées avec des interfaces
- Nommage : PascalCase
- Tailwind CSS utility-first
- Palette personnalisée LaMap (vert ESS)
- Classes responsive : mobile-first
- Un fichier de test par composant
- Nommage :
ComponentName.test.tsx - Tester : rendu, interactions, accessibilité
- Utiliser
@testing-library/react
npm run build
vercel deployLe projet Next.js peut être déployé sur :
- Netlify
- AWS Amplify
- Railway
- Fly.io
- Docker (avec
next/standalone)
Voir la documentation Next.js.
- 📖 Guide de démarrage rapide - Installation et premiers pas
- 🏗️ Architecture & Décisions - Guidelines de développement
- 🎓 Contexte d'apprentissage - Approche pédagogique
- 🗺️ Dépannage de la carte - Résolution des problèmes Mapbox
- 🧩 Configuration shadcn/ui - Composants installés
- 📦 Dépendances - Liste des packages utilisés
- ✅ Bonnes pratiques - Conventions de code
- 📊 État du projet - Fonctionnalités et roadmap
- 📝 Résumés des sessions - Historique du développement
Les contributions sont les bienvenues ! Pour contribuer :
- Fork le projet
- Créez une branche (
git checkout -b feature/AmazingFeature) - Committez vos changements (
git commit -m 'Add some AmazingFeature') - Push vers la branche (
git push origin feature/AmazingFeature) - Ouvrez une Pull Request
- Respecter les conventions de code
- Ajouter des tests pour les nouvelles fonctionnalités
- Mettre à jour la documentation
- Suivre le Conventional Commits
Raphael - Projet de formation Next.js + TypeScript + Cartographie
Status du projet : 🚧 En développement actif
Dernière mise à jour : 10 octobre 2025