A demo of the Impact Collaboration Platform for Wheels Foundation, facilitating connections between Partners, Solutions, and Funding for social impact.
Our mission is to accelerate social impact by connecting innovators with implementation partners. We directly support UN Sustainable Development Goal 17: Partnerships for the Goals. By facilitating the discovery of solutions in Health, Education, and Water, we also contribute to SDGs 3, 4, and 6.
As a Digital Public Good (DPG) candidate, we adhere to open standards and transparent governance:
frontend/: React application (Vite + TypeScript + TailwindCSS).backend/: Node.js/Express application (TypeScript + Firebase Admin).
- Node.js (v20+)
- Firebase Project with Firestore and Authentication enabled.
-
Backend Setup:
cd backend npm install # Create .env file with firebase credentials details if not using default
-
Frontend Setup:
cd frontend npm install # Create .env with VITE_API_URL if backend is not on localhost:3000
To run the full stack locally:
-
Start Backend (Port 3000):
cd backend npm run dev -
Start Frontend (Port 5173):
cd frontend npm run dev
-
Backend Tests (Unit & Integration):
cd backend npm test
-
Frontend Build Verification:
cd frontend npm run build
- Framework: React (Vite) + TypeScript
- UI Library: Material UI (MUI). Chosen for its robust component ecosystem, accessibility compliance, and professional aesthetic ("Google Material Design").
- Form Management: JSON Forms. Renders forms dynamically based on JSON Schemas fetched from the backend, ensuring a Single Source of Truth for data validation.
- State Management: React Context (
AuthContext) for user state.
- Runtime: Node.js + Express
- Database: Firestore (NoSQL)
- Authentication: Firebase Admin SDK
To ensure consistency between Backend validation and Frontend UI rendering, JSON Schemas are stored centrally in the Backend and served via API.
- Backend: validation middleware uses these schemas to validate requests.
- Frontend:
useSchemahook fetches schemas from/v1/schemas/:typeto render forms using JSON Forms. - Benefit: Updating a schema in the backend automatically updates the frontend form validation and UI structure.
Role-Based Access Control (RBAC) is enforced using Firebase Custom Claims.
- Backend: responsible for assigning roles (e.g.,
ADMIN) via Admin SDK (setAdminscript or API). Middleware checksreq.user.roleto authorize routes. - Frontend:
AuthContextdecodes the Firebase ID Token to extract custom claims. The UI conditionally renders elements (e.g., "Users" menu, "Approve" buttons) based on the user's role.
You can manage the system using these scripts. Run them from the backend directory.
- Promote User to Admin:
{ "cmd": "npx ts-node scripts/setAdmin.ts <email>" }- Grants ADMIN role to an existing user. - Create Default Admin:
{ "cmd": "npx ts-node scripts/createAdmin.ts" }- Creates a hardcoded admin user if not exists. - Seed Users:
{ "cmd": "npx ts-node scripts/seed_users.ts" }- Populates the database with test users. - Set Claims:
{ "cmd": "npx ts-node scripts/set_claims.ts <email> <role>" }- Manually set custom claims (roles) for a user. - Generate Admin Token:
{ "cmd": "npx ts-node scripts/generate_token_admin.ts" }- Generates a test ID token for the admin user (useful for curl/Postman).
- Seed All Data:
{ "cmd": "npx ts-node scripts/seed_all.ts" }- Clears and repopulates Firestore with sample data (solutions, partners, users). - Import Data:
{ "cmd": "npx ts-node scripts/import_data.ts" }- Imports data from CSV files. - Find Duplicates:
{ "cmd": "npx ts-node scripts/find_duplicates.ts" }- Scans for duplicate solution entries. - Delete Duplicates:
{ "cmd": "npx ts-node scripts/delete_duplicates.ts" }- Removes recognized duplicate entries. - Migrate Solutions:
{ "cmd": "npx ts-node scripts/migrate_solutions.ts" }- Runs migration logic for solution schema updates. - Migrate V2 Solutions:
{ "cmd": "npx ts-node scripts/migrate_v2_solutions.ts" }- Specific migration script for V2 schema.
- Generate OpenAPI Spec:
{ "cmd": "npx ts-node scripts/generateOpenApi.ts" }- Generatesopenapi.jsonfrom Zod schemas. - Test Vertex AI:
{ "cmd": "./scripts/test_vertex_curl.sh" }- Test script for Vertex AI connectivity via curl. - Test Storage:
{ "cmd": "npx ts-node scripts/test_storage.ts" }- Verifies Firebase Storage configuration and access. - Test I18n:
{ "cmd": "npx ts-node scripts/test_i18n_backend.ts" }- Tests backend internationalization logic.