Lumen is a simple course platform with a Node.js backend and a React frontend. It supports browsing courses, enrollment, and admin course management.
- Public course catalog and course detail pages.
- Student enrollment and My Courses views.
- Admin tooling to create and manage courses.
- Auth with JWT-based sessions.
- File uploads for course media.
- Basic dashboards for students and admins.
# one-time install for backend
npm install
# start backend (port from env)
npm run dev
# in another terminal
cd frontend
npm install
npm run dev.\start.ps1- Open the frontend in the browser (Vite prints the local URL).
- Sign up as a student or admin.
- Students can browse courses and enroll.
- Admins can create, edit, and delete courses.
- Use the dashboard pages to see stats.
Create a .env file in the backend root with:
MONGO_URL=your_mongodb_uri
JWT_SECRET=your_jwt_secret
PORT=3000
NODE_ENV=developmentPOST /auth/signupregister a user with role.POST /auth/loginlogin and receive JWT.GET /courseslist public courses.GET /courses/:idview course details.POST /enrollmentsenroll in a course.GET /enrollments/melist current enrollments.GET /dashboard/studentstudent stats.GET /dashboard/adminadmin stats.POST /admin/coursescreate a course.PUT /admin/courses/:idupdate a course.DELETE /admin/courses/:iddelete a course.
backend/Express app, controllers, services, routes, middleware.frontend/Vite + React app.routes/legacy API routes.middlewares/legacy auth helpers.db.jsdatabase connector.index.jsbackend entry point.
- Keep backend and frontend running in separate terminals.
- Use
npm run devfor hot reload. - Use
npm run lintin frontend if needed. - Logs are printed in the backend terminal.
- If Mongo fails, verify
MONGO_URL. - If auth fails, check
JWT_SECRET. - If CORS blocks, confirm frontend origin.
- If ports clash, change
PORT.
start.ps1starts backend and frontend together.npm run devstarts the backend server.npm run buildbuilds the frontend.npm run previewpreviews the frontend build.
- Keep commits small and focused.
- Prefer descriptive branch names.
- Run formatters or linters before PRs.
- Not specified.
- Built for learning and demo purposes.
- Thanks for using Lumen.