Engineering Compassion Through AI
C4C Campus is a learning platform that trains developers to build AI tools for animal advocacy, climate action, and AI safety. Based in Bengaluru with remote participation worldwide.
We run three programs to build technical capacity in impact movements:
- Weekend Bootcamp - 12 weeks, no technical skills required. Learn no-code/low-code AI development.
- Global Hackathons - Build prototype tools and find your team.
- Full-Time Accelerator - 12 weeks intensive. Take your prototype to production.
| Animal Advocacy | Climate Action | AI Safety |
|---|---|---|
| Supply chain transparency | Greenwashing detection | Harm detection |
| Rescue coordination | Renewable energy optimization | Adversarial defense |
| Campaign automation | Climate litigation support | Ethics testing |
This codebase powers the C4C Campus learning management system:
- Student Experience - Course progress, assignments, quizzes, certificates
- Teacher Tools - Course creation, cohort management, grading, analytics
- Admin Portal - Application review, user management, platform settings
- Discussion Forums - Course-specific discussions with moderation
- Astro + React
- Supabase (PostgreSQL, Auth, Storage)
- Tailwind CSS
- Resend (Email)
- Vercel (Hosting)
git clone https://github.com/Open-Paws/c4c-campus-website.git
cd c4c-campus-website
npm install
cp .env.example .env # Fill in your credentials
npm run devPUBLIC_SUPABASE_URL=https://your-project.supabase.co
PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
RESEND_API_KEY=re_your_api_key
SITE_URL=https://your-domain.comschema.sql is everything. Single command:
npm run db:schema-apply # Backup + destructive reset + validateSee docs/DATABASE.md for details/troubleshooting.
IMPORTANT: The database schema (schema.sql) is the single source of truth. TypeScript types must always match the schema. See docs/DATABASE.md for detailed schema management workflows.
- Update
schema.sqlwith your changes - Update corresponding TypeScript types:
src/types/index.ts- Core types (Enrollment, Course, Module, Lesson, Cohort, etc.)src/types/quiz.ts- Quiz system types (Quiz, QuizAttempt, QuizQuestion, etc.)src/types/assignment.ts- Assignment types (Assignment, Submission, etc.)
- Update any API handlers that reference modified columns
- Run TypeScript compilation to catch type errors:
npx astro check - Update integration tests to verify new schema fields
- UUIDs: All
idfields on tables likecohorts,quiz_attempts,assignment_submissionsare UUID strings, not numbers - Nullable fields: Match DB
NULLwith TypeScript| null - JSONB columns: Define typed interfaces (e.g.,
CohortProgressforcohort_enrollments.progress) - CHECK constraints: TypeScript union types must match DB constraints exactly (e.g.,
QuestionType,GradingStatus) - Column renames: If the DB column name differs from the TypeScript property, add a comment noting the mapping
The project includes automated schema-types synchronization:
# Generate types from local schema (requires Supabase CLI)
npm run db:types
# Manually check schema-types synchronization
npm run db:types:checkA GitHub Actions workflow (.github/workflows/schema-types-check.yml) automatically runs on every push or PR that modifies schema.sql or src/types/**. The CI will fail if:
- TypeScript types don't match the database schema
- UUID fields are incorrectly typed as
numberinstead ofstring - Known schema mismatches are detected (e.g.,
time_limitvstime_limit_minutes)
To fix schema-type issues:
- Run
npm run db:types:checkto identify problems - Update types in
src/types/to matchschema.sql - Ensure all ID fields use
stringtype (UUIDs) - Run
npx astro checkto verify no TypeScript errors
IMPORTANT: Do NOT hand-edit src/types/generated.ts. This file is auto-generated from the database schema.
When making schema changes:
- Modify
schema.sqlwith your changes - Run
npm run db:typesto regeneratesrc/types/generated.ts - Commit BOTH
schema.sqlandsrc/types/generated.tstogether - The CI will fail if generated.ts is out of sync
The helper type aliases at the bottom of generated.ts (like QuizRow, AssignmentRow) may be manually maintained, but the Database type definition must remain auto-generated.
Consider adding a pre-commit hook to catch drift early:
# In your local tooling configuration, run this when schema.sql or src/types/ change:
npm run db:types:checkConnect to Vercel and add environment variables. That's it.
After deploying, update your Supabase project's Site URL to match your domain.
MIT
Built by Open Paws for the animal liberation movement.