How projectunicorn25/timepulse works
Project type and purpose
• TimePulse is a full-stack, collaborative time-tracking web application.
• Built with Next.js App Router (v14), React Server & Client Components, Supabase (PostgreSQL, Auth, Realtime), Tailwind CSS, and Zod for schema validation.
• Provides contractor and manager workflows: log time, submit for approval, realtime updates, audit trails, role-based security (RLS).
File structure
• app/ – Next.js App Router directory
• (auth) – login/signup pages
• admin – manager dashboard pages and API route at /admin/api/status/route.ts
• dashboard – contractor pages (entry form, list)
• actions.ts – server-side form actions with Zod
• layout.tsx & providers.tsx – root layout, theme & toast providers
• middleware.ts – route protection
• components/ – shared UI components (Navbar, Buttons, Backgrounds)
• lib/ – Supabase client initializers (supabaseClient.ts, supabaseServer.ts), utility functions, Zod schemas (validation.ts)
• supabase.sql – database schema and RLS policies
• Config & tooling – next.config.mjs, tailwind.config.ts, ESLint, PostCSS, TS config, deployment scripts
README for architectural insights
• Auth via Supabase Auth (OAuth and email/password)
• Realtime WebSocket updates using Supabase’s realtime engine
• Approval workflow enforced by database policies and server-side actions
• Optimistic UI patterns, loading states and toasts handled in React components
Elements
• Clear rectangular blocks for each component (Browser UI, Next.js Server, Supabase Auth, Supabase DB, Supabase Realtime)
• UI components (e.g., light blue)
• Server/API (e.g., green)
• Data stores/services (e.g., orange)
• Labels for key modules (e.g., app/dashboard, app/admin/api/status, lib/supabaseServer)