How oopsvincent/rhythme works
Project Type and Purpose
• This is a full-stack web application built with Next.js (App Router) that serves as a Personal Alignment System (“Rhythmé”).
• Front-end: React components styled with Tailwind CSS + shadcn/ui.
• Back-end: Supabase for Auth, PostgreSQL, and Storage.
• Hosted on Vercel.
File Structure
• app/: Next.js App Router pages (auth flows, dashboard, settings, legal, root pages).
• components/: Reusable UI pieces (auth forms, navbars, charts, date-pickers, tables, modals).
• utils/supabase/ & lib/utils.ts: Supabase client and server wrappers, middleware.
• store/ & hooks/: Zustand or custom stores; React hooks for UI state and OAuth.
• public/: Static assets (fonts).
• middleware.ts, next.config.ts: Edge configuration, redirects, authentication guards.
• tsconfig.json, tailwind.config.ts, postcss.config.mjs: Build and styling configuration.
README for Additional Insights
• Core Phase 1 features: secure signup/login, habits CRUD, journal entries, focus timer.
• Tech stack confirms Next.js SSR/SSG, React, Supabase (Auth, Postgres, Storage), TailwindCSS, Vercel.
• Future AI/ML integration planned but out of scope for current architecture.
Main Components
a. Frontend (Browser/Client)
• Next.js React pages & components
• JS/CSS Assets served via Vercel CDN
b. Next.js Server (Server-side Rendering & API Routes)
• App Router endpoints (app/auth/…/route.ts)
• Server Components invoking Supabase server client
c. Supabase
• Auth service
• PostgreSQL database
• Storage (if used for attachments)
d. State Management & Business Logic
• React hooks and Zustand stores (store/nav-store.ts, useDialogStore)
• Utility modules (lib/utils.ts, utils/getGreetings.ts)
e. External Services
• Vercel hosting & edge functions
• (Planned) AI/ML service via Python/FastAPI
Relationships and Data Flows
• Browser → Vercel CDN: static assets and hydration.
• Browser → Next.js Server “app” routes:
• Auth flows → Supabase Auth API
• API calls (getTasks.ts, auth.ts) → Supabase Postgres
• Next.js Server → Supabase: uses server-side client for secure data access.
• Browser (client components) → client-side Supabase library (utils/supabase/client.ts) for realtime hooks and storage.
Architectural Patterns and Design Principles
• Separation of Concerns:
• UI Layer: React components under components/ & sections/
• Routing Layer: Next.js file-based App Router
• Data Layer: Supabase wrappers + Zustand stores
• Server-side Rendering / Incremental Static Regeneration for landing, legal, marketing pages.
• API Layer: Next.js Route Handlers co-located under app/auth and app/actions.
• Modular UI: shadcn/ui primitives + custom components.