You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before you start working, check the Assignees section. If no one is assigned, leave a comment claiming the issue and assign it to yourself. This prevents duplicate work.
See the Community Wiki for contributing guidelines and git workflow.
Problem
There is no way to create or edit a course through the frontend UI. The backend's POST /api/courses/ and PATCH /api/courses/{id}/ endpoints are fully implemented, but there's no dedicated form page. Users need a proper create/edit experience with draft persistence, date pickers, and unsaved changes protection — matching the quality of SlideshowEditorPage.tsx.
Requirements
Routes
/courses/new — Create a new course (protected)
/courses/:id/edit — Edit an existing course (protected, teacher-only)
Form Fields
Field
Input Type
Validation
Title
Text input
Required, non-empty
Outline
Textarea
Optional, max 1000 chars with counter
Subject
LazySelect
Optional, choices from choicesService
Language
LazySelect
Optional, choices from choicesService
Country
LazySelect
Optional, choices from choicesService
Visibility
Dropdown/radio
Required: Public / Restricted / Private (with descriptions)
Start Date
Date picker
Required, must be before end date
End Date
Date picker
Required, must be after start date
Allow Join Requests
Toggle/checkbox
Only relevant when visibility is "Restricted"
Draft Auto-Save (like slideshow editor)
Save form state to localStorage on every change
Key: course-draft-{courseId} or course-draft-new
On edit mode: fetch server data, compare against draft, discard stale drafts
Show toast when recovering from a draft: "Draft recovered from {time ago}"
Claiming This Task
Before you start working, check the Assignees section. If no one is assigned, leave a comment claiming the issue and assign it to yourself. This prevents duplicate work.
See the Community Wiki for contributing guidelines and git workflow.
Problem
There is no way to create or edit a course through the frontend UI. The backend's
POST /api/courses/andPATCH /api/courses/{id}/endpoints are fully implemented, but there's no dedicated form page. Users need a proper create/edit experience with draft persistence, date pickers, and unsaved changes protection — matching the quality ofSlideshowEditorPage.tsx.Requirements
Routes
/courses/new— Create a new course (protected)/courses/:id/edit— Edit an existing course (protected, teacher-only)Form Fields
choicesServicechoicesServicechoicesServiceDraft Auto-Save (like slideshow editor)
course-draft-{courseId}orcourse-draft-newUnsaved Changes Protection (3-layer)
beforeunloadwarning (viauseUnsavedChangeshook)useBlockerwith custom modal (viaUnsavedChangesModal)useFormDirtyState)Create Flow
POST /api/courses/— creator automatically becomes teacher/courses/{newId}Edit Flow
getCourseDetail(id)user_rolefield) — redirect or show error if notPATCH /api/courses/{id}/with changed fields onlyDesign
ProfilePage.tsx(glass-morphism, grouped sections)Architecture Context
Component Hierarchy
A single
CourseFormPage.tsxcomponent handles both create and edit, switching behavior based on amodeprop or URL params.Dependencies
coursesApi.createCourse(),coursesApi.getCourseDetail(),coursesApi.updateCourse()CourseCreateRequest,CourseUpdateRequest,CourseDetailtypesLazySelectfromcomponents/common/useUnsavedChanges,useFormDirtyStatehooksUnsavedChangesModalfromcomponents/common/choicesServicefor subject/language/country choicesAPI Dependencies
POST /api/courses/— fully implementedtitleCanCreateCoursepermission (may require teacher occupation)GET /api/courses/{id}/— fully implementedCourseDetailwithuser_rolefield for permission checkingPATCH /api/courses/{id}/— fully implementedIsCourseTeacherpermissionFiles to be Altered
New files:
Frontend/EduLiteFrontend/src/pages/CourseFormPage.tsxFrontend/EduLiteFrontend/src/hooks/useCourseDraft.ts(optional — localStorage draft management)Modified files:
Frontend/EduLiteFrontend/src/App.jsx— add/courses/newand/courses/:id/editroutesFrontend/EduLiteFrontend/src/i18n/locales/en.json— addcourses.form.*translationsFrontend/EduLiteFrontend/src/i18n/locales/ar.json— addcourses.form.*translationsTesting Requirements