How anvayb/priorityvizualizer works
Project Type & Purpose
• Full-stack, single-page application (SPA) for priority/task management.
• Frontend: React 18 + TypeScript + Vite + TailwindCSS + shadcn/ui components.
• Backend: Supabase (PostgreSQL + Auth) as a serverless BaaS.
• Hosting/CI: Netlify serves static assets; Supabase CLI handles migrations.
File Structure
• Top-level configs: .env, netlify.toml, tsconfig*, vite.config.ts, Makefile, supabase/config.toml
• Frontend source (src/):
– main.tsx (entry point)
– pages/ (Auth, Index, NotFound)
– components/ (UI and feature components: PieChart, PriorityForm, CompletionCounter, etc.)
– integrations/supabase/ (client.ts, types.ts)
– hooks/, lib/, types/
• Public assets (public/): static JSON, robots.txt
• Supabase folder: migration files, CLI temp
• Build & style scripts: package.json, postcss.config.js, tailwind.config.ts, eslint.config.js
Key Architectural Insights from README
• SPA architecture: client-heavy; all business logic runs in browser.
• Data persistence options:
– Cloud-sync via Supabase (Auth + Row-Level Security + Postgres).
– Local export/import of JSON.
• UI patterns: hierarchical pie chart, dynamic forms, React Hook Form + Zod.
Main Components & Relationships
A. User’s Browser (React SPA)
– UI Layer: Pages, Components, Charts, Forms
– State Layer: React hooks + context (use-mobile, use-toast)
– Integration Layer: supabase client for Auth & DB operations
– Utilities: JSON export/import (src/lib/utils.ts)
B. Static Asset Hosting (Netlify)
– Vite build outputs JS/CSS, deployed by Netlify
– netlify.toml configures build & redirects
C. Supabase Service
– Auth module for user sign-up / sign-in
– PostgreSQL database with tables: sections → subsections → tasks
– Row-Level Security enforces per-user data isolation
– CLI migrations (supabase/migrations/*.sql) for schema versioning
D. External Storage: Local File System
– JSON generation (timestamped) and download
– JSON upload parser for importing data
Architectural Patterns & Design Principles
• SPA with “API-driven UI” — clear separation of UI, state, and data layers.
• BaaS pattern — no custom backend code; relies on Supabase for persistence and auth.
• Progressive enhancement — offline mode via local JSON export/import.
• Component-based architecture — reusable UI primitives under src/components/ui.
• Infrastructure-as-code — supabase/config.toml + migration SQL files.