How yasen-ab/wasla works
Purpose and entry points
This is a Vite/React TypeScript application for publishing client quote/proposal pages and managing them through an authenticated admin interface. Browser startup flows from index.html to src/main.tsx, which renders src/App.tsx.
Application composition and routing
src/App.tsx is the top-level route selector. It separates the public quote experience from the admin area, while src/components/admin/router.ts defines admin-side navigation/state. The main UI boundaries are:
• Public quote rendering: src/components/public/PublicQuotePage.tsx
• Admin shell/navigation: src/components/admin/AdminShell.tsx
• Admin authentication gate: src/components/admin/LoginScreen.tsx
Public quote delivery flow
A public route resolves a quote identifier, loads its quote data, and renders a client-facing proposal page in src/components/public/PublicQuotePage.tsx. Formatting and domain type contracts are centralized in src/lib/format.ts and src/lib/types.ts; data access is mediated through src/lib/data.ts, rather than embedded directly in page components.
Admin quote management flow
Authenticated users operate inside src/components/admin/AdminShell.tsx. Quote lifecycle management is split between:
• Quote list, selection, and status-oriented operations: src/components/admin/QuotesList.tsx
• Quote creation/editing: src/components/admin/QuoteEditor.tsx
• Reusable asset/library management: src/components/admin/LibraryPage.tsx
This keeps editing, list management, and reusable content/library concerns as distinct admin stages.
Data, authentication, and persistence boundary
src/lib/supabase.ts is the external backend client boundary. src/lib/auth.tsx owns authentication/session state used by the admin experience. src/lib/data.ts provides application-facing data operations and can isolate UI code from Supabase-specific queries. src/lib/mockData.ts indicates local/sample data support, likely for development or fallback UI states.
Database structure is provisioned through Supabase migration supabase/migrations/20260804081621_create_quotes_schema.sql, making Supabase/Postgres the material persistence infrastructure for quotes and related records.
Shared domain and interface layer
src/lib/types.ts defines shared models across admin editing, persistence, and public rendering. Shared UI primitives in src/components/ui/Button.tsx, src/components/ui/Modal.tsx, and src/components/ui/ImageUploader.tsx support consistent actions, dialogs, and media input without coupling domain pages to presentation mechanics.
Runtime and build infrastructure
The client is a React application bundled and served by Vite (vite.config.ts), with TypeScript project configuration in tsconfig.json. Styling is based on Tailwind/PostCSS (tailwind.config.js, postcss.config.js) plus application styles in src/index.css. Supabase is the primary external service for authentication and database-backed quote data.
Main entry points: data.ts Data operations · PublicQuotePage.tsx Public quote page · AdminShell.tsx Admin shell · QuoteEditor.tsx Quote editor
Components 18
React Client
- HTML entry
index.html - React bootstrap
src/main.tsx - Route selector · Separates public quote routes from the admin area.
src/App.tsx - Public quote page
src/components/public/PublicQuotePage.tsx - Domain models
src/lib/types.ts - Quote formatting
src/lib/format.ts - UI primitives · Buttons, modals, and media input support domain pages.
Admin Experience
- Admin router
src/components/admin/router.ts - Login screen
src/components/admin/LoginScreen.tsx - Admin shell
src/components/admin/AdminShell.tsx - Quotes list · Lists, selects, and changes quote status.
src/components/admin/QuotesList.tsx - Quote editor
src/components/admin/QuoteEditor.tsx - Library page
src/components/admin/LibraryPage.tsx
Data & Backend
- Session state
src/lib/auth.tsx - Data operations · Application-facing quote operations isolate UI from backend queries.
src/lib/data.ts - Supabase client
src/lib/supabase.ts - Supabase Postgres · Persists quotes and related records.
supabase/migrations/20260804081621_create_quotes_schema.sql - Sample data · Supports local or fallback UI states.
src/lib/mockData.ts
Connections 23
- HTML entry → React bootstrap: loads
- React bootstrap → Route selector: renders
- Route selector → Public quote page: public route
- Route selector → Admin router: admin route
- Admin router → Login screen: unauthenticated
- Admin router → Admin shell: authenticated
- Admin shell → Quotes list: manages
- Admin shell → Quote editor: edits
- Admin shell → Library page: manages assets
- Login screen → Session state: signs in
- Session state → Supabase client: auth session
- Public quote page → Data operations: loads quote
- Quotes list → Data operations: reads and updates
- Quote editor → Data operations: creates and saves
- Library page → Data operations: accesses library data
- Data operations → Supabase client: queries
- Data operations → Sample data: local fallback
- Supabase client → Supabase Postgres: persists
- Public quote page → Domain models: uses models
- Quote editor → Domain models: uses models
- Public quote page → Quote formatting: formats proposal
- Quote editor → UI primitives: uses
- Library page → UI primitives: uses