SnapConnect is a mobile-first social messaging application designed for the financial community. It combines the engaging, ephemeral nature of platforms like Snapchat with powerful, finance-specific tools and AI-powered insights, allowing users to share timely insights through disappearing photo and video messages.
The application allows users—from professional analysts to retail investors and students—to share timely insights and interact with AI for financial analysis, fostering a more informed and connected financial community.
- 1. Product Vision
- 2. Key Features
- 3. Development Roadmap
- 4. Design & Planning Documents
- 5. Technical Architecture
- 6. Getting Started
Financial news and analysis are scattered across platforms that are either too noisy (like Twitter) or too formal (like professional terminals). There is a need for a dedicated space where timely, digestible financial insights can be shared quickly among a trusted network.
SnapConnect provides a mobile-first platform for ephemeral, media-rich financial content with integrated AI-powered insights. By creating a sense of urgency with disappearing messages and stories, it encourages daily engagement. A gamified user score motivates content creation, and implemented AI tools help creators generate accurate, data-driven content more efficiently through RAG (Retrieval-Augmented Generation) technology powered by SEC filings and OpenAI.
- Johnny (The Creator): A savvy retail investor who wants to share his market analysis and build a trusted community with tools that help him create unique, data-rich content.
- Timmy (The Consumer): A finance student who wants to access exclusive, timely insights from trusted creators in an engaging and modern format.
- RAG Chat Interface: Interactive AI assistant powered by SEC filing data and OpenAI GPT-4o-mini
- Conversation Management: Create, edit, and manage titled conversation threads with the AI
- Financial Context: AI responses grounded in real EDGAR filing data with source citations
- Share AI Insights: Post AI responses to public/friend feeds via dedicated share modal
- Collapsible Responses: Long AI responses with expand/collapse functionality for better UX
- Source Citations: Clickable source references with detailed financial document links
- Ephemeral Stories: Photo and video stories with 24-hour auto-deletion
- Real-Time Chat: One-on-one and group text conversations with Supabase Realtime
- Group Messaging: Create and manage group chats with multiple participants
- Media Messaging: Send photos and videos with drawing/annotation tools
- Message Status: Read receipts and typing indicators
- Story Management: Create, view, and delete your own stories with detailed viewer analytics
- Friend System: Complete social graph with friend requests, search by username, and blocking
- User Profiles: Detailed profiles with user scores, friend counts, and story history
- Gamified Scoring: Automated point system (+10 stories, +5 messages) with database triggers
- Group Management: Create groups, add/remove members, and manage group settings
- Phone Authentication: Secure authentication with phone number verification
- Onboarding Flow: Comprehensive user onboarding with feature demonstrations
- Advanced Camera: Custom camera interface with photo/video capture
- Media Storage: Secure cloud storage with automatic cleanup
- AR Text Overlay: Add custom text overlays to media content
- Story Viewer: Instagram-style story viewing with tap navigation
The project is broken into two main phases:
- Focus: Build the foundational social features.
- Includes: User Authentication, Profiles, Friend Management, Real-Time Chat, Ephemeral Stories, and the User Score system.
- Focus: Introduce AI-powered tools to enrich content.
- Includes: A Retrieval-Augmented Generation (RAG) model using official corporate filings (from EDGAR) and OpenAI to help users generate accurate, data-driven insights and responses.
- Implementation: Full chat interface, conversation management, AI feed system, and Node.js API with Pinecone vector search integration.
This project includes detailed documentation covering product requirements, technical architecture, and feature implementation plans. These documents provide essential context for understanding the project's goals and technical foundation.
All planning documents are located in the /feature_docs
directory.
- Product Requirements Document (PRD): Outlines the product's vision, user personas, functional requirements, and success metrics.
- Technical Architecture: Describes the Supabase-based backend, including the database schema, security model, and core logic.
- AI RAG Chat Feature: ✅ COMPLETED Comprehensive implementation plan and status for the AI-powered chat feature with RAG integration.
The application is built with a modern, scalable stack designed for real-time mobile experiences.
- React Native: v0.79.4 with Expo SDK 53.0.13
- TypeScript: Full type safety with strict configuration
- Navigation: React Navigation v7 with stack navigation
- State Management: Zustand for global state (chat, groups)
- UI/Animations: React Native Reanimated, React Native Skia, Linear Gradient
- Camera/Media: Expo Camera, Image Picker, AV, Media Library
- Real-time: Supabase Realtime for live messaging
- Database: Supabase PostgreSQL with Row Level Security (RLS)
- Authentication: Supabase Auth with phone number verification
- Storage: Supabase Storage for media files with automatic cleanup
- Real-time: Supabase Realtime subscriptions for live messaging
- Edge Functions: Supabase Edge Functions for server-side processing
- RAG System: Node.js TypeScript API with OpenAI GPT-4o-mini
- Vector Database: Pinecone for document embeddings and similarity search
- Data Sources: SEC EDGAR filings for financial context and insights
- Processing: Document ingestion and chunking for optimal RAG performance
- Linting: ESLint with Airbnb TypeScript configuration
- Formatting: Prettier for consistent code style
- Quality: Pre-commit hooks with
yarn prebuildvalidation - Navigation: File-based routing with typed navigation parameters
The project follows a modular, AI-first codebase structure with the core
application logic located in the src/ directory. All files are designed to be
under 500 lines for maximum AI tool compatibility.
-
src/components/: 35+ reusable UI components organized by feature:- AI Components:
AIConversationSkeleton,CollapsibleText,SourceList,SourceCitation - Animation Components:
AnimatedCard,AnimatedPressable,AnimatedText,FadeInAnimation,PulseAnimation - Camera Components:
Camera,CameraActions,CameraControls,CameraOptions,CameraPermissionStatus - Drawing Components:
DrawingCanvas,DrawingToolbar - Social Components:
Avatar,FriendListItem,ConversationCard,ConversationListItem - UI Components:
FormField,Icon,ScreenHeader,PhotoPreview,ReturnButton - Skeleton Loaders:
CardSkeleton,ConversationListSkeleton,SkeletonLoader,StoryListSkeleton - Onboarding:
OnboardingSlide,OnboardingSnapshots
- AI Components:
-
src/screens/: 20+ screen components for all app functionality:- Authentication:
LogInScreen,SignUpScreen,PhoneAuthScreen,OnboardingScreen - AI Features:
AIChatScreen,AIHomeScreen,CreateAIPostScreen - Social Features:
HomeScreen,FeedScreen,ProfileScreen - Messaging:
ChatScreen,ConversationScreen - Group Features:
CreateGroupScreen,GroupConversationScreen,GroupDetailsScreen,AddGroupMembersScreen - Friends:
FriendsListScreen,AddFriendScreen - Stories:
StoriesScreen,StoryViewerScreen,MyStoryViewerScreen - Media:
CameraScreen,MediaPreviewScreen,MediaViewerScreen,SelectRecipientsScreen
- Authentication:
-
src/services/: Comprehensive service layer with 9 specialized modules:ai.ts: AI/RAG functionality and conversation management (276 lines)groups.ts: Group chat creation and management (383 lines)user.ts: User profiles and management (307 lines)friends.ts: Friend system and social graph (286 lines)chat.ts: Real-time messaging (216 lines)auth.ts: Authentication and session management (157 lines)stories.ts: Ephemeral content management (140 lines)media.ts: File upload and media handling (132 lines)supabase.ts: Supabase client configuration (72 lines)
-
src/navigation/: Navigation architecture with 5 specialized stacks:RootNavigation.tsx: Main navigation coordinatorUserStack.tsx: Authenticated user flow navigation (340 lines)AuthStack.tsx: Authentication flowChatStack.tsx: Messaging navigationFriendsStack.tsx: Social features navigation
-
src/stores/: Zustand state management:chatStore.ts: Chat state and real-time messaging (171 lines)groupStore.ts: Group chat state management (399 lines)
-
src/types/: Comprehensive TypeScript definitions:ai.ts: AI/RAG related typeschat.ts: Messaging typesgroups.ts: Group functionality typesuser.ts,auth.ts,stories.ts,media.ts: Feature-specific typesnavigation.ts: Navigation parameter typestheme.ts: Styling types
-
src/styles/: Centralized styling system:theme.ts: Theme configuration and dark/light modeshared/: Reusable style components (buttons, containers, text)
-
src/utils/: Utility functions and custom hooks:logger.ts: Centralized logging for debugginghooks/: Custom React hooks includinguseAuthentication.ts
api/: Node.js TypeScript API endpoints for AI/RAG functionalitysupabase/migrations/: 30+ database migrations with comprehensive schemasupabase/functions/: Edge functions for AI processing and data operationsscripts/: Data processing and automation scriptsedgar_ingestion/: Python scripts for SEC EDGAR filing data ingestion and processing for RAG system
The backend is built around a secure and efficient data model.
- Security Model (Row Level Security): The system is secure by default. RLS
is enabled on all tables, and access is granted only through explicit policies
that check a user's JWT (
auth.uid()). For example, a user can only see a "private" story if they are an accepted friend of the author. - Content Expiration (Hybrid TTL): A two-part system ensures content
disappears reliably.
- Instant Invisibility: RLS policies instantly hide content older than 24 hours from all user queries.
- Permanent Deletion: A scheduled Supabase Edge Function
(
daily-cleanup) runs once per day to permanently delete the expired data and associated media files from Storage.
- Automated User Score: The user score is updated automatically and
efficiently using Postgres triggers. An
on inserttrigger on themessagesandstoriestables calls a database function (update_user_score) to increment the creator's score atomically.
This guide covers how to set up and run the SnapConnect project on your local machine for development and testing.
Make sure you have the following software installed on your system:
- Node.js: LTS version (e.g., v18 or later)
- Yarn: For package management (
npm install -g yarn) - Docker Desktop: Must be running to host the local Supabase stack.
- Supabase CLI: For managing the local development environment
(
brew install supabase/tap/supabase-clifor macOS/Linux). - Expo Go: The app on your mobile device (iOS or Android) or a configured local simulator.
Follow these steps to get the application and its backend services running locally.
-
Clone the repository:
git clone <repository-url> cd SnapConnect
-
Install Frontend Dependencies:
yarn install
-
Start Local Backend Services: This command starts the entire Supabase stack (database, auth, etc.) in Docker.
supabase start
The first time you run this, it will download the necessary Docker images and apply all database migrations located in
supabase/migrations. On successful startup, the CLI will output your local SupabaseAPI URLandanon key. -
Configure Environment Variables: The application connects to Supabase using environment variables.
- Create a
.envfile in the project root by copying the example file:cp env.example .env
- Open the new
.envfile and fill in the localAPI URLandanon keyprovided by thesupabase startcommand. It should look like this:EXPO_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321 EXPO_PUBLIC_SUPABASE_ANON_KEY=your-local-anon-key-from-the-cli
- Create a
-
Verify Your Setup: Before running the application, validate your code:
yarn prebuild
This command runs type checking, formatting, and linting to ensure your code is ready for development.
-
Run the Application: Start the Metro development server:
yarn start
Network Troubleshooting: If you encounter network connectivity issues:
# Use tunnel connection for network issues (slower but more reliable) yarn start --tunnel # Clear Metro cache if experiencing build issues yarn start --clear # Combine both options if needed yarn start --tunnel --clear
-
Launch the App:
- Scan the QR code generated by Metro with the Expo Go app on your phone.
- Or, press
ito launch the iOS Simulator orato launch the Android Emulator.
The app will now be running and connected to your local Supabase instance. Any
changes you make to the frontend code will reload automatically. If you make
changes to the backend (e.g., create a new database migration), you may need to
restart the Supabase services (supabase stop and supabase start).
The project includes several helpful development scripts:
yarn prebuild: Validates code quality (type checking, formatting, linting) - always run this after making changesyarn validate: Same as prebuild - ensures code quality before committingyarn lint: Run ESLint to check for code issuesyarn lint:fix: Automatically fix linting issues where possibleyarn format: Format code with Prettieryarn type-check: Run TypeScript compiler to check for type errorsyarn start: Start development server with validationyarn ios: Run on iOS simulator with validationyarn android: Run on Android emulator with validation
If you encounter connectivity issues during development, Expo provides several flags to resolve common problems:
- Purpose: Routes connections through Expo's servers instead of direct local network
- When to use:
- Corporate firewalls blocking local connections
- Complex network configurations (VPNs, restricted WiFi)
- Unable to connect physical device to development server
- Trade-off: Slower than local connections but more reliable
- Usage:
yarn start --tunnel
- Purpose: Clears Metro bundler cache and temporary files
- When to use:
- Experiencing unexplained build errors
- Code changes not reflecting in app
- After installing new dependencies
- Strange bundling or transformation issues
- Usage:
yarn start --clear
- Corporate/University Networks: Often require
--tunneldue to firewall restrictions - Multiple Network Interfaces: May need
--tunnelif your machine has multiple network adapters - Cache Corruption: Use
--clearif seeing outdated code or bundle errors - Expo Go Connection: If QR code scanning fails, try
--tunnelfor more reliable connection
For more information, see Expo CLI documentation and Expo troubleshooting guide.
The codebase follows strict quality standards:
- TypeScript: Full type safety with strict configuration
- ESLint: Airbnb configuration with React Native specific rules
- Prettier: Consistent code formatting
- File Size Limit: All files kept under 500 lines for AI tool compatibility
- Modular Architecture: Clean separation of concerns with single responsibility principle
- Centralized Logging: Use
@utils/logger.tsfor all logging operations