Flask backend for user profiles, requirement progress tracking, and schedule/course suggestions.
python3 -m venv venvsource venv/bin/activatepip install flask flask-sqlalchemy requestspython3 src/seed_courses.py(cache Cornell course/offering data)python3 src/seed_requirements.py(seed requirement rules)python3 src/app.py
Server runs at http://127.0.0.1:5000.
docker compose up --buildServer runs at http://127.0.0.1:8080.
docker build -t coursefinder-backend .
docker run --rm -p 8080:8080 coursefinder-backendServer runs at http://127.0.0.1:8080.
All routes are registered with no prefix.
GET /- health checkPOST /users/- create userGET /users/- list usersGET /courses- list/filter courses (subject,credits,q/search,semester)GET /courses/<course_id>- get a single course (optionalsemesterfilter)GET /courses/semesters- list semesters with cached offeringsPOST /users/<user_id>/completed-courses/- mark a course completedPOST /users/<user_id>/distributions/- set completed distributionsPOST /users/<user_id>/schedules/- create a scheduleGET /users/<user_id>/schedules/- list schedules for a user (optionalsemester)GET /schedules/<schedule_id>/- get schedule detailsPOST /schedules/<schedule_id>/offerings/- add offering to scheduleDELETE /schedules/<schedule_id>/offerings/- remove offering from scheduleGET /users/<user_id>/progress/- get requirement progress (optionalschedule_id)GET /schedules/<schedule_id>/suggestions/- get schedule suggestionsPOST /major-requirements/- create major requirement rowGET /major-requirements/- list major requirements (optionalmajor)POST /requirements/sets/- create requirement setPOST /requirements/rules/- create requirement rulePOST /requirements/rules/<rule_id>/courses/- attach accepted course or tag to a rule
- Create/load a user (
POST /users/,GET /users/) - Add completed courses (
POST /users/<user_id>/completed-courses/) - Create schedule (
POST /users/<user_id>/schedules/) - Add/remove planned offerings (
POST /schedules/<schedule_id>/offerings/,DELETE /schedules/<schedule_id>/offerings/) - Read requirement progress (
GET /users/<user_id>/progress/?schedule_id=<schedule_id>) - Read recommendations (
GET /schedules/<schedule_id>/suggestions/)
When adding offerings, send either:
offering_id(internal DB id), orclass_nbr(Cornell class number, scoped to schedule semester)
If a selected offering is a lecture (LEC), backend auto-adds the first valid non-lecture component per component type (for example DIS, LAB, PRJ) that does not conflict with the existing schedule.
For remove, send JSON body with one of:
offering_id(specific offering to remove), orcourse_id(course code likeMATH1920; backend removes the matching lecture and its attached dependent components)
Backend returns progress statuses:
satisfiedin_progressremaining
If frontend enum is COMPLETE | IN_PROGRESS | MISSING | RECOMMENDED, map:
satisfied -> COMPLETEin_progress -> IN_PROGRESSremaining -> MISSINGRECOMMENDEDcomes from suggestions endpoint
POST /users/ accepts required:
namenetidmajoryear(int)collegetargetTerm(ortarget_term)targetCreditsLow(ortarget_credits_low)targetCreditsHigh(ortarget_credits_high)
Optional:
schoolcatalog_year
GET /users/ returns:
- Existing fields:
id,name,school,major,catalog_year,year - Added fields:
initial,netid,college,target_term,target_credits_low,target_credits_high,completed