How adamblackman/briefo-public works
Project type and purpose
• Briefo is a full-stack, cross-platform mobile social app built with React Native/Expo Router (TypeScript) that delivers AI-generated newsfeeds, enables chat & comments, tracks stock portfolios, and provides AI-driven research.
• Backend is powered by Supabase (PostgreSQL, Auth, Realtime) plus a suite of Supabase Edge Functions (TypeScript on Deno) that implement serverless micro-services calling external APIs (Perplexity, Alpaca, Alpha Vantage, LinkPreview).
File structure
• app/ – Expo Router pages & layouts, React Native entry points for chat, tabs, article, profile, stock research, etc.
• components/ – Reusable UI pieces organized by feature (chat, news, portfolio, profile, notifications, friends, stocks).
• context/, hooks/, lib/ – State contexts (Auth, Theme, NavigationFocus), custom hooks and utility functions (Supabase client, data-fetch wrappers).
• supabase/functions/ – Edge Functions grouped by feature (perplexity-news, perplexity-chat, stock-detail, portfolio-tab-data, notifications helpers).
• types/, data/ – TypeScript interfaces reflecting Supabase tables and mock data for tests/demo.
• Configuration – metro.config.js, tsconfig.json, bolt & npm config, eas.json for Expo Application Services.
README for additional insights
• Clearly states tech stack tiers: Frontend (Expo + React Native), Backend (Supabase core + Edge Functions), Third-party APIs.
• Describes feature-specific Edge Functions (daily-news cron, research reports, live quotes, notifications).
• Mentions scheduling/cron and realtime flows via Supabase Realtime & triggers.
a. Main components
– Mobile Client (iOS/Android/Web)
– Supabase Auth & Realtime (WebSocket subscriptions)
– Supabase PostgreSQL Database (with RLS policies)
– Supabase Edge Functions (serverless microservices)
– Third-Party APIs (Perplexity AI, LinkPreview, Alpaca, Alpha Vantage)
– Optional CI/CD for function deployment (Supabase CLI, GitHub Actions)
b. Relationships and interactions
– Mobile Client ↔ Supabase Auth (login, token refresh)
– Mobile Client ↔ Supabase Database (CRUD via Supabase JS, realtime updates)
– Mobile Client ↔ Edge Functions (RPC calls via REST endpoints for heavy AI work)
– Edge Functions ↔ Third-Party APIs (HTTP calls to Perplexity, Alpaca, etc.)
– Edge Functions ↔ Database (write results back into tables)
c. Architectural patterns & design principles
– Client-Server separation: UI vs. data/business logic
– Microservices: each Edge Function encapsulates one domain action
– Event-driven / cron jobs for scheduled news generation
– Realtime subscriptions for chat and notifications
– RLS and service-role key segregation for security
d. Key technologies, frameworks & libraries
– Frontend: Expo Router, React Navigation, React Context, custom hooks
– Backend: Supabase JS client, Deno runtime (Edge Functions)
– Utilities: React-Query style data-fetch in lib/ & hooks/
– CI/CD: Expo Application Services (EAS), Supabase CLI