How mahdi015/mediapost-front works
Project type and purpose
• This is a single-page front-end web application (built in Vue 3 + TypeScript) that allows users to upload photos, videos, and files.
• It uses Supabase as a Backend-as-a-Service for authentication, database/storage, and is deployed (via Netlify) as a static site.
Main components
a. Browser / Client
• Vue SPA (App.vue, Pages, Components)
• UI Components: Home.vue, CreatePost.vue, PostCard.vue
b. API Layer (src/functions/api.ts)
• Encapsulates all calls to Supabase
• Exposes methods like uploadFile(), fetchPosts(), authenticateUser()
c. Supabase Client (src/lib/supabaseClient.ts)
• Configured with Supabase URL and anon key (from .env)
d. Supabase Services (external)
• Auth Service
• Database (Post metadata)
• Storage (media files)
e. Hosting/CDN
• Netlify (serving the built SPA)
Relationships and Data Flows
• Browser → Vue Components: user interactions trigger component methods.
• Vue Components → API Layer: components import and call functions in src/functions/api.ts.
• API Layer → Supabase Client: each function calls supabaseClient to perform RPCs (auth, db CRUD, storage).
• Supabase Client → Supabase Services: the client library makes HTTP requests to Supabase endpoints.
• Supabase Services → Supabase Client → Browser: responses flow back through the same chain.
• Hosting Pipeline: GitHub → Netlify CI → build (npm run build) → deploy static assets (public/* + dist) to CDN.
Architectural Patterns & Design Principles
• Clear separation of concerns:
• Presentation layer (Vue components)
• Service/API layer (wrapper functions)
• Infrastructure (Supabase as BaaS)
• Single-page application architecture
• Environment-based configuration (.env for Supabase keys)
• Module structure: grouping by feature (Pages/, Components/) vs. by technical role (lib/, functions/)
Relevant Technologies & Frameworks
• Vue 3 with Composition API (main.ts, App.vue)
• TypeScript for type safety (src/types/*.ts)
• Supabase JS client for backend interactions
• Netlify for hosting
• SCSS for styling (global.scss)
• Build/config: Babel, webpack (vue.config.js), ESLint, tsconfig.json