Back to Vault

API Reference

Public API notes, Supabase data contracts, and integration references for Rashid.

Supabase Database Schema

The Rashid platform uses Supabase for backend services including authentication, real-time data, and file storage. Below are the primary database tables and their contracts.

TableDescriptionPolicies
profilesUser profiles with preferences and settingsRLS: users can read/write own row
projectsDynamic project entries for the matrix gridRLS: public read, authenticated write
lessonsLearning center course contentRLS: public read, admin write
analyticsPage view and interaction trackingRLS: service_role only

Supabase Realtime Channels

Realtime subscriptions are used for live updates on projects and collaborative features.

supabase.channel('projects-updates')

Listens to INSERT, UPDATE, and DELETE events on the projects table. The admin dashboard uses this channel to reflect changes instantly without page refresh.

Gemini AI Integration

The Rashid AI assistant integrates with the Google Gemini API for conversational AI capabilities.

POST /api/gemini/generate

Request body: { prompt: string, context?: string, model?: string }

The AI supports multilingual responses (Arabic, English, German, French, and more) with streaming support for real-time chat interactions.

Vercel Deployment

The entire Rashid frontend is deployed on Vercel with automatic CI/CD from the GitHub repository. Custom headers and redirects are configured via vercel.json for SEO and SPA routing.