How srperzibal/instagram-clone works
Project Type and Purpose
• This is a single-page front-end application built with React and Vite.
• It manages user authentication, displays feeds and stories, and interacts with a Supabase backend (database + auth).
File Structure Analysis
• Top Level:
• public & index.html – static assets and HTML entrypoint
• src – application source code
• .env, package.json, vite.config.js – build, dependency, and environment configurations
• Inside src:
• main.jsx – React app bootstrap
• App.jsx & router/AppRouter.jsx – top-level component and routing setup
• context/AuthContext.jsx – global auth state management
• supabaseClient.js – Supabase SDK initialization (external service integration)
• pages/ – route targets (Login.jsx, Sidebar.jsx)
• components/ – UI widgets (Feed, Perfil, PostCard, PostUploader, Stories, StoryModal, StoryUploader)
• Patterns observed:
• SPA with React Router for navigation
• Context API for cross-cutting concerns (authentication)
• Component-based UI hierarchy
Insights from README
• Confirms minimal React + Vite setup with ESLint & fast refresh.
• No built-in backend—external Supabase handles data & auth.
1. Browser (user agent)
2. Vite Dev/Build Server (serves bundle & assets)
3. React Application
– AppRouter (React Router)
– AuthContext Provider
– Page Components (Login, Sidebar)
– UI Components (Feed, PostCard, Stories, etc.)
4. Supabase Service
– Auth API
– Database API
b. Relationships & Data Flow
• Browser ↔ Vite Server: GET index.html, JS/CSS bundles, HMR WS
• Browser ↔ React App: user interactions, virtual DOM updates
• React App → SupabaseClient: REST/GraphQL calls for sign-in, CRUD operations
• Supabase → React App: JSON responses (auth tokens, records)
c. Architectural Patterns & Principles
• Single-Page Application (SPA)
• Component hierarchy & composition
• Context for global state (AuthContext)
• Separation of concerns: routing, state, UI, data access
d. Key Technologies & Frameworks
• Vite (dev server, bundler)
• React (UI library)
• React Router (routing)
• Context API (global state)
• Supabase JS SDK (backend as a service)
• ESLint (linting)