How supabase-community/svelte-kanban works
Project type and purpose
• This is a full‑stack single-page web application (a Trello‑style Kanban board) built with SvelteKit on the front end and Supabase (PostgreSQL + Auth + Realtime) as the back end.
• The README confirms it’s a Trello clone using Supabase for storage and authentication, deployed (e.g., on Vercel).
File structure
• Top level:
• Static assets (static/) and index.html for hosting.
• SvelteKit config (svelte.config.js, vite.config.js, jsconfig.json).
• Supabase folder for database schema, seeds, and CLI config (supabase/config.toml, seed.sql, .branches/dump.sql).
• src/ contains SvelteKit routes and components:
– src/routes/+layout.js, +page.svelte, route files for Login, BoardList, dynamic boards/[id], and components (Header, AddForm, AddList, List, InPlaceEdit).
– src/routes/db.js configures the Supabase client.
– src/index.test.js holds tests.
• Build scripts and dependencies: package.json, pnpm‑lock.yaml, .eslintrc, .prettierrc, etc.
README for additional insights
• Supabase storage requires running setup.sql and seed.sql.
• Authentication flows: login route.
• Database schema creation and seeding is automated via Supabase CLI.
• The app uses Supabase client (supabase-js) on the client side for CRUD and real‑time updates.
a. Main components
• Browser / Client (SvelteKit SPA)
• SvelteKit Server (routes + page endpoints if running server‑side)
• Supabase Services
– Auth (handles sign‑in, tokens)
– Database (PostgreSQL tables: boards, lists, cards, users)
– Realtime (WebSocket channel for live updates)
• Deployment platform (e.g., Vercel, optional)
b. Relationships and interactions
1) User → Browser UI (Svelte components)
2) Browser UI ↔ Supabase Auth (login/signup API)
3) Browser UI ↔ Supabase Database (CRUD via REST / PostgREST or supabase-js client)
4) Browser UI ↔ Supabase Realtime (subscribe to changes on boards/lists/cards)
5) (Optional) Browser → SvelteKit server for server‑side rendering/load functions → Supabase
c. Architectural patterns
• SvelteKit’s File‑Based Routing for component composition and SSR/CSR hybrid.
• Separation of concerns: UI components vs. data access (db.js).
• Event‑driven updates via Supabase Realtime.
d. Key technologies
• SvelteKit (frontend + SSR)
• supabase-js (client library)
• PostgreSQL (hosted by Supabase)
• Vite (bundler)
• pnpm (package manager)
Essential details to capture
• File‑based routing → show mapping between URL paths and Svelte components (e.g., /boards/[id] → BoardDetail component).
• db.js as the single Supabase client instantiation (central data access module).
• Supabase CLI artifacts (seed.sql, setup.sql) illustrating database provisioning.
• Real‑time update mechanism for collaborative editing.