How thsigyyy678b/daily-whatsapp-wins works
Purpose and delivery model
Daily WhatsApp Challenge is a client-rendered marketplace: users complete WhatsApp-status tasks for rewards, while businesses purchase and operate status-ad campaigns. It is a TypeScript React SPA built with Vite/Bun and deployable as static GitHub Pages or to conventional static hosts. Browser clients call Supabase directly using publishable-key environment variables.
Key deployment path: .github/workflows/deploy.yml; application bootstrap: src/start.ts, src/server.ts.
Application bootstrap and routing
The route tree defines the primary product surfaces: public landing/authentication, user dashboard, business dashboard, and administrator panel. Routing must support a configurable base path for GitHub Pages and SPA hosting.
• Router construction/base path: src/router.tsx
• Root document/layout and global providers: src/routes/__root.tsx
• Generated route registration: src/routeTree.gen.ts
Primary endpoints are represented by route modules, not server APIs: src/routes/index.tsx, src/routes/dashboard.tsx, src/routes/business.tsx, src/routes/admin.tsx.
Identity and access boundary
Authentication is application-managed rather than Supabase Auth. User and business credentials are stored/validated through app data; super-admin credentials are explicitly hardcoded. Role selection after login controls access to user, business, or admin routes and operations.
• Session and admin credential logic: src/lib/session.ts
• Unified login: src/routes/login.tsx
• User and business onboarding: src/routes/signup-user.tsx, src/routes/signup-business.tsx
This is the main security boundary: the documented model uses plaintext credentials and unrestricted anon-role database CRUD, so it is unsuitable for production without auth, server-side authorization, and RLS.
Supabase persistence layer
Supabase is the sole backend/data API, accessed directly from the browser. The initial migration establishes operational entities: users, businesses, tasks, assignments/submissions, campaigns, withdrawals, wallet history, and globally editable settings.
• Supabase client/environment integration: src/lib/supabase.ts
• Schema bootstrap: supabase/migrations/20260101000000_init.sql
• Shared application limits/settings-related policy: src/lib/limits.ts
The database is the source of truth for wallets, task lifecycle, campaign lifecycle, payout requests, and admin-configured URLs/package values.
Core product workflows
User flow: sign up → authenticate → receive/perform eligible tasks → submit status proof → earn wallet entries after approval → request withdrawals; referrals and free-task limits are governed by settings. Business flow: sign up → select package/manage campaign → submit ad creative and campaign details. Admin flow: review and control users, tasks, submissions, businesses, campaigns, withdrawals, and settings.
• User work/reward surface: src/routes/dashboard.tsx
• Business campaign surface: src/routes/business.tsx
• Operational approval/configuration surface: src/routes/admin.tsx
Task creatives, proof screenshots, campaign images, and carousel images are Google Drive share links transformed client-side into direct-view URLs; Google Drive is therefore an external content dependency.
UI composition and client boundaries
Page modules own feature workflows and compose a shared header plus a local shadcn-style UI component library. Global styles establish the premium black/green visual system. There is no indicated dedicated API server, background worker, or payment-provider integration; UPI configuration is stored as settings for payout guidance/QR use.
• Shared navigation: src/components/site-header.tsx
• Reusable UI primitives: src/components/ui/
• Global styles: src/styles.css
Reliability and publishing
Client errors are captured/reported through Lovable-oriented helpers and route-level error handling. GitHub Pages builds in static SPA mode, including a 404 shell for refresh fallback; other hosts need the same Supabase public environment variables.
• Error capture/reporting: src/lib/error-capture.ts, src/lib/lovable-error-reporting.ts
• Error-page handling: src/lib/error-page.ts
• Static deployment workflow: .github/workflows/deploy.yml
Main entry points: router.tsx Router and base path · dashboard.tsx User work and wallet · session.ts Session and roles · business.tsx Campaign management
Components 17
React SPA
Client-rendered product surfaces and shared UI.
- App bootstrap
src/start.ts - Static server entry
src/server.ts - Router and base path · Supports GitHub Pages base paths and SPA routing.
src/router.tsx - Root layout
src/routes/__root.tsx - Landing and auth
src/routes/index.tsx - Login and onboarding · Unified login plus user and business signup flows.
src/routes/login.tsx - Session and roles · App-managed credentials select user, business, or admin access.
src/lib/session.ts - User work and wallet · Tasks, proof submission, rewards, referrals, and withdrawals.
src/routes/dashboard.tsx - Campaign management · Packages, creative, and campaign operations.
src/routes/business.tsx - Operations admin · Reviews entities, approvals, withdrawals, and settings.
src/routes/admin.tsx - Shared UI and styles
src/components/site-header.tsx - Error reporting · Route errors are captured through Lovable-oriented helpers.
src/lib/error-capture.ts
Supabase
Browser-accessed persistence boundary.
- Supabase browser client · Uses publishable environment variables from the browser.
src/lib/supabase.ts - Operational database · Source of truth for identities, workflows, wallets, campaigns, and settings.
supabase/migrations/20260101000000_init.sql - Limits and settings policy · Applies shared task and settings-related limits.
src/lib/limits.ts
External dependencies
- Google Drive content · Share links are transformed client-side for creatives and proof images.
Publishing
- GitHub Pages deployment · Builds a static SPA with a 404 refresh fallback.
.github/workflows/deploy.yml
Connections 23
- GitHub Pages deployment → App bootstrap: publishes static app
- App bootstrap → Static server entry: initializes
- App bootstrap → Router and base path: mounts
- Router and base path → Root layout: renders within
- Router and base path → Landing and auth: public route
- Router and base path → Login and onboarding: identity routes
- Router and base path → User work and wallet: user route
- Router and base path → Campaign management: business route
- Router and base path → Operations admin: admin route
- Login and onboarding → Session and roles: authenticates via
- Session and roles → User work and wallet: authorizes user role
- Session and roles → Campaign management: authorizes business role
- Session and roles → Operations admin: authorizes admin role
- User work and wallet → Supabase browser client: reads and writes
- Campaign management → Supabase browser client: reads and writes
- Operations admin → Supabase browser client: operates and configures
- Supabase browser client → Operational database: direct browser CRUD · Anon-role access is the principal security boundary.
- Limits and settings policy → User work and wallet: governs eligibility
- Operational database → Limits and settings policy: stores editable settings
- User work and wallet → Google Drive content: loads proof and task media
- Campaign management → Google Drive content: loads campaign media
- Root layout → Shared UI and styles: composes
- Router and base path → Error reporting: reports route errors