update secrets in env and
echo -n "Y" |
gcloud secrets create X --data-file=-
- Install dependencies:
npm install- Create a
.envfile based on.env.example:
cp .env.example .env-
Fill in your Supabase credentials and email configuration in
.env -
Start the server:
npm startFor development with auto-reload:
npm run devSUPABASE_URL: Your Supabase project URLSUPABASE_SERVICE_ROLE_KEY: Your Supabase service role key (for server-side operations)PORT: Server port (default: 3000)NODE_ENV: Environment (development/production)SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS,SMTP_FROM: Email configuration for notifications
POST /api/course- Submit a new course (requires authentication)
GET /api/unapprovedCourses- Get all pending courses with cross-validationPOST /api/approveCourse- Approve a pending coursePOST /api/rejectCourse- Reject a pending course with feedback
GET /api/approvedCourses- Get all approved courses for the courses dashboardGET /health- Health check endpoint
All API endpoints (except /health) require authentication via Supabase. Include the token in the Authorization header:
Authorization: Bearer <supabase_jwt_token>
Admin endpoints require the user to have ReadAll permission in the users table.
The backend expects the following Supabase tables:
users- User authentication and permissionscourses- Course submissionscrossref_courses- Approved courses from Google Sheetssections- Course sectionsfacilitators- Course facilitators