Quick Start & Setup
Relevant source files
The following files were used as context for generating this wiki page:
RDM Digital is a digital territorial platform built on a stack comprising React, Vite, and Supabase. It is designed to operate as a "Sovereign Urban Operating System" for Real del Monte, Hidalgo, integrating digital identity (ID-NVIDA), smart tourism, telemetry, and federated governance. The system utilizes a heptafederated kernel (TAMV MD-X4) to manage services across seven distinct domain federations.
Sources: README.md:1-15, scripts/002_rdm_seed.sql:1-5
The setup process involves configuring a React frontend environment, initializing a Supabase backend with specific SQL migrations for territorial and federated data, and deploying Edge Functions to handle critical integrations such as GitHub synchronization and payment processing via Stripe.
Sources: README.md:33-55, package.json:3-15
Local Development Environment
Prerequisites
The project uses pnpm as the primary package manager. The frontend is built with React 18 and Vite, utilizing TypeScript for type safety.
Sources: package.json:11-15, README.md:128-142
Installation Steps
- Clone and Install Dependencies:
pnpm install - Launch Development Server:
pnpm dev - Build for Production:
pnpm build
Sources: README.md:128-142, package.json:7-13
Technical Stack Components
| Category | Technology |
|---|---|
| Frontend | React 18, Vite, TypeScript, React Router |
| Styling | Tailwind CSS, Radix UI, Lucide React |
| Data Management | TanStack React Query, Supabase JS Client |
| Backend | Supabase Edge Functions (Deno) |
| Mapping | Leaflet, React-Leaflet |
| Database | PostgreSQL (Supabase) |
Sources: package.json:16-95, README.md:65-80
Backend Architecture & Data Flow
The backend is anchored by Supabase, employing Edge Functions for serverless execution and PostgreSQL for data persistence. The data model is structured around "Federations" and "POIs" (Points of Interest).
System Initialization Flow
The initialization requires running SQL migrations and seed scripts to populate the federated structure and the initial territorial nodes.
Core Database Entities
The project defines a heptafederated model where data is partitioned into seven federations.
| Federation ID | Name | Focus |
|---|---|---|
educativa | Federación Educativa | Universidad TAMV, knowledge |
cultural | Federación Cultural | Heritage, mining history |
economica | Federación Económica | Trade, MSR, BookPI |
tecnologica | Federación Tecnológica | Isabella AI, Kernel, Infra |
salud | Federación de Salud | Wellness, community health |
comunicacion | Federación de Comunicación | Media, radio, press |
gubernamental | Federación Gubernamental | Protocols, assembly, governance |
Sources: supabase/migrations/20260512080845_110fe96e-4027-403f-98c8-f6d495c1bf4c.sql:11-30, scripts/002_rdm_seed.sql:8-40
Configuration and Integration
GitHub Synchronization
A critical setup component is the github-sync Edge Function, which analyzes and classifies repositories from the OsoPanda1 GitHub profile to build the "Evolutionary Repository."
Security and Roles
The system implements Role-Based Access Control (RBAC) via Supabase Auth metadata and database triggers.
- Default Role:
tourist - Administrative Promotion: Requires manual insertion into
user_rolesfor theadminrole. - Trigger logic:
handle_new_user()maps auth metadata to profile records.
Sources: supabase/migrations/20260512080845_110fe96e-4027-403f-98c8-f6d495c1bf4c.sql:1-5, 115-145
Application Routing
The application utilizes a shell-based routing architecture. The AppShell provides the core navigation layout, while sub-routes handle specific territorial and federated modules.
Sources: src/App.tsx:18-60
Setup Conclusion
Successful setup results in a functional 72% production-ready system capable of synchronizing GitHub data, managing federated points of interest, and serving a tourism-focused UI. Developers should ensure the VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY environment variables are correctly configured in the frontend to communicate with the Supabase backend.
Sources: README.md:110-125, package.json:7-13