How hoangnguyenkim/kindwave works
Purpose and entry points
KindWave is a TypeScript fundraising/campaign application with donor, organizer, administrator, and volunteer experiences. The browser client starts at src/main.tsx, renders the application shell in src/App.tsx, and is served by Vite (vite.config.ts). A Node/TypeScript backend entry point exists at server.ts.
Client application shell and navigation
src/App.tsx is the primary UI composition and view-selection boundary. Shared navigation, authentication presentation, notifications, and layout components live in src/components/Navbar.tsx, src/components/LoginView.tsx, and src/components/ToastContainer.tsx. The static host document is index.html.
Role-specific product surfaces
Feature-level views separate the primary user workflows:
• Public discovery and campaign browsing: src/features/HomeView.tsx, src/features/CampaignDetailView.tsx
• Donor activity: src/features/DonorDashboard.tsx
• Campaign management: src/features/OrganizerDashboard.tsx
• Administrative oversight: src/features/AdminDashboard.tsx
• Volunteer participation: src/features/VolunteerHub.tsx
These views form the main control boundary between role-specific workflows and reusable presentation components.
Campaign and donation workflow
Campaign discovery and display are centered on src/components/CampaignCard.tsx and src/features/CampaignDetailView.tsx. Campaign creation/editing is modeled as a guided UI flow in src/components/CampaignWizard.tsx. Donation capture is isolated in src/components/DonationModal.tsx, allowing campaign views and dashboards to invoke contribution actions without owning that UI state.
Data model and persistence boundary
Client-side domain types are centralized in src/types.ts; seeded or fallback application data is in src/data/initialData.ts. Server persistence is isolated behind server/db.ts, with repository data artifacts db-store.json, db-images.json, and metadata.json. This establishes a clear boundary: React features consume application state/data, while server/database code owns durable storage access.
Backend and external service runtime
The application requires Node.js and uses a local development command from package.json. server.ts likely hosts API behavior used by the client, while server/db.ts manages storage operations. The README requires GEMINI_API_KEY through .env.local, indicating an integration with Google Gemini/AI Studio; .env.example documents the environment-variable contract. The AI service should remain server-side or otherwise protected from direct browser key exposure.
Validation and delivery
API behavior is covered at the backend boundary by test/api.test.ts. Build/runtime configuration is split between vite.config.ts for the frontend and vitest.config.ts for testing, with TypeScript compilation governed by tsconfig.json.
Main entry points: App.tsx Application shell · HomeView.tsx Discovery and campaign detail · server.ts Node API server · index.html Static host document
Components 19
Browser client
React application served by Vite.
- Static host document
index.html - Client bootstrap
src/main.tsx - Application shell · Selects views and coordinates shared UI.
src/App.tsx - Shared UI · Navbar, login presentation, notifications, and layout.
src/components/Navbar.tsx - Domain types
src/types.ts - Seed and fallback data
src/data/initialData.ts
Product workflows
Role-specific and public feature views.
- Discovery and campaign detail · Campaign browsing and campaign display.
src/features/HomeView.tsx - Donor dashboard
src/features/DonorDashboard.tsx - Organizer dashboard
src/features/OrganizerDashboard.tsx - Admin dashboard
src/features/AdminDashboard.tsx - Volunteer hub
src/features/VolunteerHub.tsx - Campaign UI · Campaign cards and guided campaign creation/editing.
src/components/CampaignCard.tsx - Donation modal · Reusable donation capture flow.
src/components/DonationModal.tsx
Server runtime
Node API and persistence boundary.
- Node API server · Hosts API behavior used by the browser client.
server.ts - Persistence access · Owns durable storage operations.
server/db.ts - Repository data artifacts · Store, image, and metadata artifacts.
db-store.json - Gemini integration · Requires the Gemini API key outside the browser.
Runtime configuration
- Vite frontend runtime
vite.config.ts - Environment contract · Documents Gemini API key configuration.
.env.example
Connections 20
- Static host document → Client bootstrap: loads
- Vite frontend runtime → Static host document: serves
- Client bootstrap → Application shell: renders
- Application shell → Shared UI: composes
- Application shell → Discovery and campaign detail: selects
- Application shell → Donor dashboard: selects
- Application shell → Organizer dashboard: selects
- Application shell → Admin dashboard: selects
- Application shell → Volunteer hub: selects
- Discovery and campaign detail → Campaign UI: uses
- Organizer dashboard → Campaign UI: uses
- Discovery and campaign detail → Donation modal: invokes
- Donor dashboard → Donation modal: invokes
- Application shell → Domain types: uses
- Application shell → Seed and fallback data: uses fallback data
- Application shell → Node API server: calls API
- Node API server → Persistence access: persists through
- Persistence access → Repository data artifacts: reads and writes
- Node API server → Gemini integration: uses server-side
- Environment contract → Gemini integration: documents key