This directory contains the backend code for the KidC platform.
index.ts - Main entry point for the HTTP triggerdatabase/ - Database migrations and queriesroutes/ - API route handlersservices/ - Business logic servicesGET /api/lessons - Get all lessonsGET /api/lessons/:slug - Get a specific lesson by slugGET /api/lessons/:lessonId/exercises - Get exercises for a lessonGET /api/exercises/:id - Get a specific exercisePOST /api/exercises/:id/submit - Submit a solution for an exercisePOST /api/compile - Compile and run C codeGET /api/users/:username/progress - Get learning path with user progressThe platform uses SQLite for data storage with the following tables:
kidc_users_v1 - User informationkidc_lessons_v1 - Lesson contentkidc_exercises_v1 - Exercise definitionskidc_user_progress_v1 - User progress trackingkidc_user_solutions_v1 - User submitted solutionsThe compiler service provides functionality to compile and run C code. In the current implementation, it simulates compilation and execution for demonstration purposes.
The exercise service handles validation of exercise solutions against test cases.