Repository navigation
Architecture
Bosaj edited this page Aug 20, 2026
·
4 revisions
The Les Ambassadeurs du Bien platform is architected as a high-performance Single-Page Application (SPA) backed by serverless cloud services.
| Layer | Technology | Responsibilities |
|---|---|---|
| Frontend Core | React 19, React Router v7 | Component rendering, client-side routing, and DOM reconciliation. |
| Build & Tooling | Vite 7 | Fast ESM bundling, code splitting via manualChunks, and HMR. |
| Styling & Motion | Tailwind CSS 4, Framer Motion | Responsive layouts, RTL mirroring, dark mode, and fluid animations. |
| Backend as a Service | Supabase (PostgreSQL 15) | Relational database, Row Level Security (RLS), Auth, Storage buckets. |
| Serverless Functions | Netlify Functions (Node.js) | Server-side Stripe PaymentIntent creation at /.netlify/functions/create-payment-intent. |
| Third-Party Gateways | Stripe Elements, PayPal SDK | Secure PCI-compliant online donation processing. |
| Geographic Mapping | Leaflet, React-Leaflet | Dynamic branch mapping across Moroccan cities. |
State is shared across components using modular React Context providers:
-
AuthContext(src/context/AuthContext.jsx):- Synchronizes user authentication state via Supabase Auth events (
SIGNED_IN,SIGNED_OUT,TOKEN_REFRESHED). - Fetches user profile directly via native REST API using the session JWT to avoid client mutex deadlocks.
- Exposes helper methods:
login(),logout(),loginWithGoogle(),refreshProfile(), andhasPermission(permName).
- Synchronizes user authentication state via Supabase Auth events (
-
DataContext(src/context/DataContext.jsx):- Centralizes all content retrieval (
news,events,programs,projects,testimonials,partners,gallery_images). - Uses
Promise.allfor parallel non-blocking public data fetches. - Manages admin mutation actions (
addPost,updatePost,deletePost,togglePin,verifyMember).
- Centralizes all content retrieval (
-
LanguageContext(src/context/LanguageContext.jsx):- Manages the selected language (
ar,fr,en) and stores user preference inlocalStorage. - Dynamically alters
document.documentElement.dirtortlfor Arabic andltrfor French/English.
- Manages the selected language (
-
ThemeContext(src/context/ThemeContext.jsx):- Controls dark/light theme toggle and applies the
darkclass todocument.documentElement.
- Controls dark/light theme toggle and applies the
Production Web App: https://a-a-b-v.netlify.app/
Official Email: asosoufaraelkhir48@gmail.com | GitHub Repo: Bosaj/les-ambassadeurs-web
Facebook β’ Instagram β’ X (Twitter) β’ LinkedIn β’ WhatsApp
Platform developed & maintained by Oussama ELHADJI β All Rights Reserved Β© 2026