How phuturedigital/phuture-platform works
1. Repo shape
- This is a monorepo for multiple product surfaces under one platform umbrella: website, phuture-os, livin, pulse, and zwakala.
- The common pattern is a TypeScript/Vite frontend per app, backed by Supabase for auth, database, storage, and serverless edge logic.
2. Product boundaries
- apps/website is the public marketing/site layer: home, services, portfolio, audit funnel, quote/cart/lead capture, and a small admin area.
- apps/phuture-os is the main internal operating system for the business: multi-tenant admin/client portals, onboarding, billing, bookings, CRM, messaging, integrations, analytics, support, and system health.
- apps/livin is a property/community app: listings, saved properties, suburb alerts, neighborhood intelligence, host/property workflows.
- apps/pulse is a survey/assessment app: guided question flow, consent, resume, insight and admin analytics/export.
- apps/zwakala is an events/discovery app: events, venues, follows, RSVPs, notifications, venue dashboards, and admin tooling.
3. Frontend architecture
- Each app uses a client-side React UI with route/page components and smaller feature components.
- Auth, permissions, consent, and “protected route” concerns are handled in-app through contexts/hooks/components rather than a separate BFF.
- Tailwind/Vite/TypeScript are the shared frontend stack; each app is independently deployable.
4. Supabase as the shared backend
- Supabase is the primary backend boundary across the repo.
- Frontends talk directly to Supabase from the browser for CRUD, auth, and real-time-style app state.
- The supabase/ directories contain SQL migrations, RLS policies, triggers, cron setup, and edge functions, showing that domain logic is split between client and database/serverless layers.
5. Data model and access control
- The architecture is strongly schema-driven: many timestamped migrations evolve tables, views, triggers, indexes, and policies over time.
- Row-level security is a major design constraint, especially in phuture-os, which has explicit tenant isolation, role/membership modeling, and admin bypass policies.
- packages/supabase contains shared generated database types, acting as the typed contract between Supabase schema and the apps.
6. Serverless and event-driven flows
- Supabase edge functions handle privileged operations, webhooks, scheduled jobs, and side effects.
- In phuture-os, functions cover integrations and automations for Paystack, WhatsApp, LinkedIn, Meta, Google Ads, Canva, Google Search Console, booking notifications, onboarding, intake, support, and processing jobs.
- Several migrations install cron jobs and trigger-based workflows, so many flows are database/event initiated rather than manually invoked from the UI.
7. Domain-specific backend behavior
- livin has functions and tables around suburb alerts and neighborhood intelligence, implying notification and enrichment flows around property neighborhoods.
- pulse persists survey responses/progress and computes insights/recommendations, with admin exports and reporting as a secondary workflow.
- zwakala centers on event discovery, follows, saved items, notifications, and venue moderation/claim flows.
- website has lead capture, audit-share/reporting, and portfolio/order flows, backed by Supabase tables and admin UI.
8. External service integration layer
- The system integrates with payment, messaging, ads, and creative services: Paystack, WhatsApp, Meta/Facebook, LinkedIn, Google Ads, Canva, Google Search Console, and email delivery.
- These integrations are mostly isolated behind Supabase functions and shared helper modules, so the browser never directly owns secrets or provider credentials.
9. Outbound processing
- outbound-functions/ is a separate serverless worker-style area for batch or rendering-heavy tasks such as audits, daily pipelines, mockup generation, image fetching, and email enrichment.
- This suggests a second async boundary beyond Supabase edge functions for jobs that are more offline, pipeline-driven, or rendering-centric.
10. Operational and deployment setup
- GitHub Actions run Supabase CI/deploy workflows, indicating schema/function deployment is treated as infrastructure, not just app code.
- Each app also has Vercel config, so frontends are likely deployed independently.
- The repo includes demo-account seed functions, test helpers, and archived migrations, showing a production system with repeatable environment setup and historical schema evolution.
11. How to draw the architecture
- Draw each app as an independent React frontend layer.
- Put Supabase at the center as the shared data/auth/backend platform, with DB migrations, RLS, triggers, storage, and edge functions around it.
- Add external integrations off to the side, connected mostly through edge functions and cron/webhook flows.
- Show packages/supabase as the shared type contract, and outbound-functions as a separate async/job-processing lane.
Main entry points: functions edge functions · database.types.ts supabase types · website website · phuture-os phuture-os
Components 19
Frontends
Independent React/Vite product surfaces
- website · Public site with services, portfolio, audit funnel, quote and lead capture, plus small admin tools
apps/website - phuture-os · Internal operating system for multi-tenant admin, client portals, onboarding, billing, CRM, support, and integrations
apps/phuture-os - livin · Property and community experience for listings, saved properties, suburb alerts, and host workflows
apps/livin - pulse · Guided assessment flow with consent, progress resume, insights, and admin reporting
apps/pulse - zwakala · Events and venues discovery with follows, RSVPs, notifications, venue dashboards, and moderation
apps/zwakala
Supabase platform
Shared database, auth, storage, and edge logic
- Supabase · Central platform for auth, database, storage, RLS, triggers, cron, and edge functions
- migrations · Timestamped SQL migrations that define tables, views, policies, triggers, and indexes across products
apps/phuture-os/supabase/migrations - RLS policies · Tenant isolation and per-app authorization enforced in the database
- triggers & cron · Database-triggered and scheduled workflows that drive notifications, sync, and cleanup
- edge functions · Privileged operations, webhooks, integrations, and scheduled jobs
apps/phuture-os/supabase/functions
Shared code
Typed contracts and cross-app modules
- supabase types · Generated database types shared between apps and the Supabase schema
packages/supabase/src/database.types.ts
Async workers
Offline and rendering-heavy processing lane
- outbound-functions · Separate async processing area for audits, pipelines, mockups, and enrichment
outbound-functions
External services
Third-party providers used through serverless integrations
- Paystack · Payment and billing provider
- WhatsApp · Messaging and notification channel
- Google services · Google Ads, Search Console, and related analytics or OAuth flows
- Meta · Meta/Facebook OAuth, campaigns, and reporting
- LinkedIn · Campaign and posting integrations
- Canva · Design creation and export workflows
- email delivery · Outbound email and digest delivery
Connections 25
- website → Supabase: CRUD/auth · Browser app talks directly to Supabase for leads, portfolio, audit, and admin data
- phuture-os → Supabase: core data · Primary backend boundary for tenant, CRM, billing, booking, and support state
- livin → Supabase: property data · Listings, profiles, saves, and suburb alert state
- pulse → Supabase: responses · Survey progress, consent, and result persistence
- zwakala → Supabase: events data · Events, venues, follows, RSVPs, notifications, and moderation data
- website → supabase types: types · Uses generated database types as the typed client contract
- phuture-os → supabase types: types · Uses generated database types as the typed client contract
- livin → supabase types: types · Uses generated database types as the typed client contract
- pulse → supabase types: types · Uses generated database types as the typed client contract
- zwakala → supabase types: types · Uses generated database types as the typed client contract
- migrations → Supabase: schema · Defines and evolves the shared database and policy surface
- RLS policies → Supabase: guardrails · Row-level security constrains tenant and role access
- triggers & cron → Supabase: automation · Database events and cron jobs drive side effects and sync
- edge functions → Supabase: serverless · Privileged logic runs close to the data boundary
- edge functions → Paystack: billing · Payment initialization, verification, onboarding, and webhook handling
- edge functions → WhatsApp: messages · Messaging setup, webhooks, and send flows
- edge functions → Google services: ads/search · OAuth, metrics, and conversions for Google services
- edge functions → Meta: campaigns · OAuth, campaign updates, and performance fetches
- edge functions → LinkedIn: publishing · Campaign creation, posting, and reporting flows
- edge functions → Canva: designs · Design generation and export/post workflows
- edge functions → email delivery: notifications · Booking, digest, onboarding, and reminder emails
- phuture-os → outbound-functions: async jobs · Routes heavier audit, mockup, and pipeline work to the worker lane
- website → outbound-functions: rendering · Uses offline generation for audit and social preview outputs
- Supabase → edge functions: invokes · Database/webhook/cron flows trigger serverless actions
- Supabase → triggers & cron: events · Triggers and scheduled jobs are installed within the platform boundary