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
A RESTful backend for a student platform that lets teachers create and manage courses, assignments, announcements and materials, while students enroll in courses, view resources and submit assignments online.
Note: This repository currently contains only the backend. A frontend can be added later and consume the API documented here.
✨ Features
🔐 Authentication & Authorization — JWT-based register/login with role-based access control (Student, Teacher, Admin, Parent).
📚 Course Management — teachers and admins can create, update and delete courses.
📝 Assignments & Submissions — teachers publish assignments with due dates; enrolled students submit (and re-submit) work; teachers grade and give feedback.
📢 Announcements — course announcements posted by teachers.
📄 Materials — teachers share files/links for each course.
🧑🎓 Enrollment — students enroll themselves or are enrolled by teachers/admins; enrollment is enforced when accessing course resources.
# 1. Clone the repository
git clone https://github.com/Shamble96/Student_Platform.git
cd Student_Platform/Backend
# 2. Install dependencies
npm install
# 3. Configure environment variables
cp .env.example .env
# 4. Edit .env and set your values (see Configuration table below)# 5. Start the server
npm run dev # development (auto-reload)# or
npm start # production
The server will start on http://localhost:3333 (or the port you set in .env).
Configuration
Copy .env.example to .env and set the following variables:
Variable
Description
Default
PORT
Port the server runs on
3333
MONGO_URI
MongoDB connection string
mongodb://127.0.0.1:27017/student_platform
JWT_SECRET
Secret key used to sign JWT tokens
(required)
JWT_EXPIRE
Token lifetime (e.g. 30d, 7d, 2h)
30d
📖 API Documentation
Once the server is running, open the interactive Swagger UI:
http://localhost:3333/api-docs
Role-based access summary
Role
Can do
Student
Enroll in courses, view enrolled course resources, submit assignments
Teacher
Create/manage their own courses, assignments, announcements, materials, grade submissions
Admin
Everything a teacher can do, plus full access to all courses