How louaygharsaly2025/madaricloud works
1. Overall shape
- This repository is a Next.js App Router frontend for “MadariCloud,” a BaaS console experience.
- The code here is primarily the user-facing control panel and auth flows; the actual backend services described in the README (database, storage, functions, realtime, auth engine) are not implemented in this repo.
2. Route structure and locale boundary
- All user-facing routes live under app/[lang], making language a first-class part of the URL.
- Supported languages are backed by JSON dictionaries in dictionaries/ and loaded through lib/dictionary.ts.
- proxy.ts is the routing boundary likely responsible for locale detection / redirects / guarding localized paths.
3. Public entry points
- app/page.tsx is the root entry and likely redirects or lands on a localized route.
- The localized root app/[lang]/layout.tsx wraps the app with language-specific context.
- app/layout.tsx provides the global HTML shell and app-wide styling hooks.
4. Authentication area
- Auth pages are grouped under app/[lang]/(auth) with separate routes for login, signup, and recovery.
- This separation keeps auth visually and behaviorally distinct from the dashboard, while still sharing the same locale system.
- app/actions/recovery.ts is the key server-side mutation boundary for the manual recovery flow described in the README.
5. Dashboard shell
- The dashboard lives under app/[lang]/(dashboard) and has its own layout.tsx, which is the main shell for authenticated sections.
- This layout likely composes the persistent navigation and top controls used across dashboard pages.
- The dashboard index page (app/[lang]/(dashboard)/page.tsx) acts as the landing surface after login.
6. Dashboard feature modules
- The dashboard is split into feature pages for AI, auth, database, functions, storage, and settings.
- This structure mirrors the product’s BaaS domain model: each subsystem gets a dedicated console section rather than a monolithic admin page.
- app/[lang]/(dashboard)/ai/ChatClient.tsx suggests the AI section has an interactive client-side experience, while the other sections appear as separate operational panels.
7. Shared UI and chrome
- Reusable shell components live in components/: Sidebar, HeaderControls, ThemeProvider, NotificationBell, and visual widgets like MadariPulse and RealtimeChart.
- The components/ui/ folder contains atomic UI pieces such as GlassCard, CopyButton, and GenerateKeyCard.
- These components define the product’s glassmorphism / premium console presentation layer.
8. State and interaction boundaries
- Most of the interactive dashboard surface is likely composed of client components where needed, especially for charts, notifications, copy actions, theme switching, and chat.
- Server-side boundaries are concentrated in App Router pages/layouts and the app/actions/ folder.
- This clean split suggests a mostly static-shell dashboard with targeted interactive islands.
9. Data and localization flow
- The primary request flow is: locale URL → routing/proxy → locale layout → page/component tree.
- Dictionary files provide the translated copy for the same screens across six languages: Arabic, Tunisian Derja, English, French, Italian, and German.
- The architecture is optimized for content reuse across locales, not for separate per-language builds.
10. Technology choices that matter architecturally
- The stack is Next.js 16 + React 19, with the App Router driving layout composition and route grouping.
- Styling is Tailwind CSS v4, which supports the dense componentized UI approach used here.
- Recharts supports the analytics/dashboard visualizations, and Lucide React supplies the icon system used across the console.
11. Repo boundary to keep in mind
- The README describes backend capabilities like GoTrue auth, PostgreSQL realtime, MinIO storage, and edge functions, but those systems are not present as server implementations in this tree.
- In architectural diagrams, this repo should be shown as the frontend console and locale/auth shell that would sit in front of those services, not as the services themselves.
Main entry points: (dashboard)/layout.tsx Dashboard shell · dictionary.ts Dictionary loader · [lang]/layout.tsx Locale layout · (auth) Auth routes
Components 34
Routing & Shell
App Router entrypoints, locale boundary, and route composition.
- Root page · Top-level entry that likely redirects into the localized app.
app/page.tsx - App shell · Global HTML and app-wide styling shell.
app/layout.tsx - Locale layout · Wraps the app in language-specific context.
app/[lang]/layout.tsx - Locale proxy · Boundary for locale detection, redirects, and localized path handling.
proxy.ts
Auth Flow
Public authentication and recovery screens.
- Auth routes · Localized public auth area for login, signup, and recovery.
app/[lang]/(auth) - Login · Localized sign-in screen.
app/[lang]/(auth)/login/page.tsx - Signup · Localized account creation screen.
app/[lang]/(auth)/signup/page.tsx - Recovery · Localized manual account recovery screen.
app/[lang]/(auth)/recovery/page.tsx - Recovery action · Server-side mutation boundary for the recovery flow.
app/actions/recovery.ts
Dashboard
Authenticated console sections and feature pages.
- Dashboard shell · Persistent authenticated shell for dashboard pages.
app/[lang]/(dashboard)/layout.tsx - Dashboard home · Landing page after login.
app/[lang]/(dashboard)/page.tsx - AI console · Localized AI section of the console.
app/[lang]/(dashboard)/ai/page.tsx - Chat client · Interactive AI chat surface.
app/[lang]/(dashboard)/ai/ChatClient.tsx - Auth console · Dashboard section for authentication management.
app/[lang]/(dashboard)/auth/page.tsx - Database · Dashboard section for database operations.
app/[lang]/(dashboard)/database/page.tsx - Functions · Dashboard section for function management.
app/[lang]/(dashboard)/functions/page.tsx - Storage · Dashboard section for object storage operations.
app/[lang]/(dashboard)/storage/page.tsx - Settings · Dashboard configuration and preferences page.
app/[lang]/(dashboard)/settings/page.tsx
Shared UI
Reusable chrome, widgets, and UI primitives.
- Sidebar · Primary dashboard navigation.
components/Sidebar.tsx - Header controls · Top-bar controls for the console.
components/HeaderControls.tsx - Theme provider · Theme switching and UI mode context.
components/ThemeProvider.tsx - Notifications · Notification entry point in the console chrome.
components/ui/NotificationBell.tsx - Realtime chart · Dashboard analytics visualization.
components/RealtimeChart.tsx - MadariPulse · Brand/status visual component.
components/MadariPulse.tsx - Glass card · Core premium card surface used across the console.
components/ui/GlassCard.tsx - Copy button · Clipboard interaction primitive.
components/ui/CopyButton.tsx - Key card · Credential/key generation UI primitive.
components/ui/GenerateKeyCard.tsx
Localization
Dictionary loading and translated content sources.
- Dictionary loader · Loads locale dictionaries for the app.
lib/dictionary.ts - English · Translated copy for English screens.
dictionaries/en.json - French · Translated copy for French screens.
dictionaries/fr.json - German · Translated copy for German screens.
dictionaries/de.json - Italian · Translated copy for Italian screens.
dictionaries/it.json - Arabic · Translated copy for Arabic screens.
dictionaries/ar.json - Derja · Translated copy for Tunisian Derja screens.
dictionaries/tn.json
Connections 33
- Root page → Locale proxy: locale entry · Root navigation is funneled through locale handling.
- Locale proxy → Locale layout: localized path · Proxy routes users into the language-scoped app.
- App shell → Locale layout: wraps · Global shell contains the localized application shell.
- Locale layout → Dictionary loader: loads copy · Localized layout depends on dictionary resolution.
- Dictionary loader → English: source · English translation source.
- Dictionary loader → French: source · French translation source.
- Dictionary loader → German: source · German translation source.
- Dictionary loader → Italian: source · Italian translation source.
- Dictionary loader → Arabic: source · Arabic translation source.
- Dictionary loader → Derja: source · Tunisian Derja translation source.
- Locale layout → Auth routes: routes to · Localized routes split into auth and dashboard areas.
- Locale layout → Dashboard shell: routes to · Localized routes split into auth and dashboard areas.
- Auth routes → Login: contains · Auth area includes login.
- Auth routes → Signup: contains · Auth area includes signup.
- Auth routes → Recovery: contains · Auth area includes recovery.
- Recovery → Recovery action: mutates · Recovery screen submits server-side recovery actions.
- Dashboard shell → Sidebar: uses · Dashboard shell composes persistent navigation.
- Dashboard shell → Header controls: uses · Dashboard shell composes top-level controls.
- Dashboard shell → Theme provider: wraps · Dashboard UI depends on theme context.
- Dashboard shell → Notifications: includes · Dashboard chrome includes notifications.
- Dashboard home → Realtime chart: shows · Home surface can present live analytics.
- Dashboard home → MadariPulse: shows · Home surface can present brand/status visuals.
- AI console → Chat client: contains · AI section embeds interactive chat.
- Database → Glass card: uses · Feature pages are built from shared UI surfaces.
- Storage → Copy button: uses · Storage flows often include copy actions.
- Settings → Key card: uses · Settings can expose credential management UI.
- Dashboard shell → Dashboard home: lands on · Dashboard shell frames the dashboard index.
- Dashboard shell → AI console: navigates to · Dashboard shell exposes AI section.
- Dashboard shell → Auth console: navigates to · Dashboard shell exposes auth management.
- Dashboard shell → Database: navigates to · Dashboard shell exposes database management.
- Dashboard shell → Functions: navigates to · Dashboard shell exposes functions management.
- Dashboard shell → Storage: navigates to · Dashboard shell exposes storage management.
- Dashboard shell → Settings: navigates to · Dashboard shell exposes settings.