An NGO community platform connecting mentors and mentees
Lead Forward Platform is a comprehensive NGO community platform that connects members through mentorship, challenges, and shared learning. Beyond mentor-mentee matching, the platform features a modern community feed, gamified points system, admin-curated challenges, and member-created blogs. Built on Cloudflare's edge network, it provides fast, reliable performance for global NGO communities.
- π° Community Feed - Shared posts and updates from community members
- π― Challenges - Member challenges with points rewards (admin-curated)
- π Blogs - Members can publish and share blog posts with the community
- π Leaderboard - Gamified points system showing top community contributors
- π¬ Engagement - Like, comment, and interact with community content
- π Google OAuth Authentication - Secure, password-free sign-in
- π€ Mentor Profiles - Create rich profiles with expertise, availability, and rates
- π Public Mentor Browsing - Search and discover mentors by level, payment type, and availability
- π€ User-Driven Matching - Mentees initiate match requests; mentors accept or decline
- π Match Management - Track match lifecycle: pending β accepted β active β completed
- π³ Flexible Payments - Support for Venmo, PayPal, Zelle, Alipay, WeChat Pay, and Crypto
- π₯ Role-Based Access Control - Admin and Member roles for permission management
- β Points & Gamification - Earn points for activities, visible on leaderboard
- π¨ Modern Navigation - Intuitive sidebar with Feed, Member Area, and Links sections
- π± Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
- π Internationalization - Support for Simplified Chinese (default) and English
- βΏ Accessibility - WCAG 2.1 compliant with semantic HTML and ARIA labels
- React 19 - Modern UI library with concurrent features
- TypeScript - Type-safe development
- shadcn/ui + Radix UI - Accessible component library
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- Hono - Lightweight, fast web framework
- Cloudflare Workers - Edge compute platform
- Cloudflare D1 - Serverless SQLite database
- Vite - Lightning-fast build tooling with HMR
- Vitest - Unit testing framework
- Wrangler - Cloudflare deployment CLI
- Node.js 18+ and npm
- Cloudflare Account (free tier works)
- Google Cloud Console Project (for OAuth - see setup guide below)
npm installFollow the step-by-step guide in GOOGLE_OAUTH_SETUP.md to:
- Create a Google Cloud Console project
- Configure OAuth credentials
- Set up redirect URIs for local and production environments
Then create a .dev.vars file in the project root:
# .dev.vars (for local development)
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
JWT_SECRET=your-local-dev-secret.dev.vars to version control (already in .gitignore)
Run migrations to create the database schema:
# Create local D1 database and run migrations
npm run db:migrateVerify the schema was created:
npm run db:schemanpm run devYour application will be available at http://localhost:5173
# Start development server with HMR
npm run dev
# Build for production (TypeScript compilation + Vite bundle)
npm run build
# Preview production build locally
npm run preview
# Type-check and verify build (includes dry-run deploy)
npm run check
# Lint codebase
npm run lintThis project follows Test-Driven Development (TDD). Always write tests before implementing features.
# Run all tests once
npm run test
# Run tests in watch mode (auto-rerun on changes) - best for TDD
npm run test:watch
# Run tests with coverage report
npm run test:coverage
# Run tests with interactive UI
npm run test:ui
# Run specific test file
npm run test:watch -- src/react-app/__tests__/App.test.tsx
# Run only React tests
npm run test:watch -- --project=react
# Run only Worker/API tests
npm run test:watch -- --project=worker# Run migrations on local D1 database
npm run db:migrate
# View local database schema
npm run db:schema
# Run migrations on production D1 database
npm run db:migrate:prod
# View production database schema
npm run db:schema:prod# Build and deploy to Cloudflare Workers
npm run build && npm run deploy
# Deploy to production
npm run deploy
# Monitor worker logs
npx wrangler tail
# Regenerate Cloudflare types after wrangler.json changes
npm run cf-typegenngo-platform/
βββ src/
β βββ react-app/ # Frontend React application
β β βββ components/ # UI components
β β β βββ Layout.tsx # Two-column layout wrapper
β β β βββ Sidebar.tsx # Navigation sidebar
β β β βββ Navbar.tsx # Top navigation bar
β β β βββ UserRoleBadge.tsx # User role display
β β β βββ UserPointsBadge.tsx # User points display
β β β βββ MentorCard.tsx # Mentor profile card
β β β βββ ProtectedRoute.tsx # Auth route wrapper
β β β βββ ...other components/
β β βββ context/ # React context (AuthContext)
β β βββ pages/ # Route pages (Login, HomePage, MentorBrowse, etc.)
β β βββ services/ # API client and service layer (mentorService, pointsService, etc.)
β β βββ i18n/ # Internationalization (Chinese and English)
β β βββ __tests__/ # React component tests
β βββ worker/ # Backend Hono API (Cloudflare Worker)
β β βββ auth/ # Authentication (JWT, Google OAuth, middleware)
β β βββ index.ts # Main API routes (roles, points, mentors, matches, etc.)
β β βββ __tests__/ # API route tests
β βββ types/ # Shared TypeScript types
β βββ user.ts # User types
β βββ role.ts # Role system types
β βββ points.ts # Points system types
β βββ mentor.ts # Mentor profile types
β βββ match.ts # Match/mentorship types
β βββ api.ts # API request/response types
βββ migrations/ # D1 database migrations (SQLite)
β βββ 0001-0006/ # Original mentor-mentee migrations
β βββ 0007_create_user_roles_table.sql # Role system
β βββ 0008_create_user_points_table.sql # Points system
βββ docs/ # Documentation
β βββ ARCHITECTURE.md # System architecture and design
β βββ NGO_PLATFORM_TRANSFORMATION.md # Vertical slice transformation plan
β βββ ...other docs/
βββ dist/ # Build output (generated)
β βββ client/ # Frontend bundle (served as static assets)
β βββ worker/ # Worker bundle
βββ wrangler.json # Cloudflare Workers configuration
βββ vite.config.ts # Vite build configuration
βββ vitest.config.ts # Vitest test configuration
βββ CLAUDE.md # Detailed developer documentation
βββ README.md # This file
The platform uses a unified deployment model where both the React frontend and Hono backend are deployed together to Cloudflare Workers:
- Frontend: React app built with Vite, served as static assets from
dist/client/ - Backend: Hono framework handles API routes at
/api/v1/* - Database: Cloudflare D1 (serverless SQLite) for persistent data
- Authentication: Google OAuth 2.0 + JWT tokens (stateless, edge-friendly)
All API endpoints follow versioned RESTful conventions:
/api/v1/auth/* # Authentication (login, callback, logout)
/api/v1/users # User management
/api/v1/users/:id/points # Points system
/api/v1/users/:id/role # Role management
/api/v1/roles # Role assignment (admin only)
/api/v1/mentors/profiles/* # Mentor profile CRUD
/api/v1/mentors/search # Public mentor search
/api/v1/matches/* # Match requests and lifecycle
/api/v1/posts/* # Feed posts (coming soon)
/api/v1/challenges/* # Challenges system (coming soon)
/api/v1/blogs/* # Blog management (coming soon)
/api/v1/leaderboard # Leaderboard rankings (coming soon)
Type Safety: Shared TypeScript types (src/types/) ensure consistency between frontend and backend.
For detailed architecture documentation, database schema, development patterns, and the transformation plan, see CLAUDE.md and docs/ARCHITECTURE.md.
This project follows Test-Driven Development (TDD) using the Red-Green-Refactor cycle:
- Red - Write a failing test first
- Green - Write minimal code to make the test pass
- Refactor - Improve code while keeping tests green
Always write tests when:
- Adding a new feature (write test first, then implement)
- Fixing a bug (write test that reproduces bug, then fix)
- Refactoring existing code (ensure tests exist and pass before/after)
Tests are not optional - they are part of the definition of "done."
Tests are colocated with source files in __tests__/ directories:
src/react-app/__tests__/ # React component tests (jsdom environment)
src/worker/__tests__/ # API route tests (node environment)
Run tests in watch mode during development for instant feedback:
npm run test:watchStore sensitive environment variables as Cloudflare secrets (not in wrangler.json):
wrangler secret put GOOGLE_CLIENT_ID
wrangler secret put GOOGLE_CLIENT_SECRET
wrangler secret put JWT_SECRETIf not already created, set up your production D1 database:
# Create database (if needed)
wrangler d1 create platform-db
# Update database_id in wrangler.json with the returned IDnpm run db:migrate:prodnpm run build
npm run deployYour application will be deployed to Cloudflare's global edge network!
npx wrangler tail- Write tests first (TDD approach)
- Run tests in watch mode during development
- Ensure all tests pass before committing
- Run linter to catch style issues
npm run test:watch # Keep running during development
npm run test # Final check before commit
npm run lint # Fix linting issues
npm run build # Verify build succeeds- TypeScript strict mode - No implicit
any, unused variables, or fallthrough cases - Test coverage - Aim for >80% coverage on critical paths
- API versioning - All API routes must use
/api/v1/prefix - Type safety - Use shared types from
src/types/for API contracts
For detailed development guidelines, project-specific patterns (like bit flags), and architecture decisions, see CLAUDE.md.
- Cloudflare Workers Documentation
- Cloudflare D1 Documentation
- Hono Documentation
- Vite Documentation
- React Documentation
- Vitest Documentation
- shadcn/ui Documentation
[Your License Here - e.g., MIT]
For issues, questions, or feature requests, please open an issue.
Built with β€οΈ for the NGO community