How debangshucode/full-stack-web-application-creative-showcase works
Project type and purpose
• This is a modern full-stack Single Page Application (SPA) named “Creative Showcase.”
• Frontend: React + Vite + Tailwind CSS + OGL (WebGL hero effect).
• Backend: Supabase (Auth, PostgreSQL, Storage).
• Users can sign up/login, upload/manage images, view public galleries and profiles.
File structure
• Top-level files: package.json, Vite/TS/Tailwind configs, index.html.
• src/
• main.jsx & index.html → entry point, mounts React App.
• App.jsx → root router component.
• components/ → reusable UI (Header, Footer, HeroSection, ImageGrid, LightRays, ProtectedRoute, etc.).
• pages/ → route targets (LandingPage, LoginPage, SignUpPage, DashboardPage, PublicProfilePage).
• contexts/ → React Contexts (AuthContext for Supabase auth state, ThemeContext for dark/light).
• lib/supabase.js → initialized Supabase client.
• supabase/
• migrations/20251228083936_create_profiles_and_images_tables.sql → DB schema.
• .temp/ → local CLI metadata (project-ref, versions, URLs).
• Configuration: vite.config.ts, tsconfig*, tailwind.config.js, eslint.config.js, postcss.config.js.
README for architectural insights
• Confirms SPA with React Router, protected routes, RLS policies in the database.
• Supabase handles both authentication and data storage (Postgres + Storage buckets).
• DB triggers auto-create profiles on signup; RLS ensures row-level security.
Main components & relationships
a. Components
1. Client Browser (User’s device)
2. Static Host / CDN (e.g., Vercel) serving built SPA
3. React SPA
– React Router → route switching
– AuthContext → manages session with Supabase Auth
– ThemeContext → toggles dark/light mode
– Pages & Components → UI layers
4. Supabase Backend
– Authentication Service (GoTrue)
– PostgreSQL Database (profiles, images tables + RLS + triggers)
– Storage Bucket (images)
5. External Libraries/Services
– OGL (WebGL light rays)
– Toast notifications (react-hot-toast)
b. Relationships & Interactions
1. Browser → CDN: GET / → index.html + JS/CSS assets
2. React SPA → Supabase Auth: sign-up, login, session refresh
3. React SPA → Supabase DB:
– Query public galleries & user profiles (public RLS policy)
– Query/update user images in Dashboard (authenticated RLS policy)
4. React SPA → Supabase Storage:
– Upload image file → storage bucket
– Generate public URL → save to images table
– Delete image → remove from storage & DB
5. DB trigger → Auto-create profile row on new authenticated user
c. Architectural patterns & design principles
• SPA with client-side routing
• Context API for cross-cutting concerns (auth, theme)
• BaaS (Backend as a Service) via Supabase
• Row Level Security ensures authorization at data layer
• Component-based UI (atomic & page components)
d. Key technologies/frameworks
• React + React Router
• Vite bundler
• Tailwind CSS for styling
• Supabase (Auth, Postgres, Storage)
• OGL for WebGL effects
• react-hot-toast, lucide-react for UX
Essential details to capture
• Separation of concerns: hosting vs. client vs. backend services
• Contexts and routing within the SPA
• Supabase’s multiple roles (Auth, DB, Storage, RLS)
• Data-flow for image upload/download and profile creation