Sagely is a comprehensive Learning Management System (LMS) backend API built with Spring Boot that provides RESTful services for educational institutions to manage courses, announcements, requirements, and student interactions.
- JWT-based Authentication: Secure token-based authentication system
- Role-based Access Control: Two user roles - Admin and Student
- User Registration & Login: Complete user management system
- Profile Management: Users can update their profiles and change passwords
- Default Admin Account: Automatically creates admin user on startup
- Course CRUD Operations: Create, read, update, and delete courses
- Course Enrollment: Students can enroll in available courses
- Course Details: View course information and descriptions
- Student Management: Admins can view enrolled students for each course
- Announcement Management: Create, update, and delete announcements
- Course-specific Announcements: Link announcements to specific courses
- Categorized Announcements: Organize announcements by categories
- Attachment Support: Attach files to announcements
- Assignment Creation: Admins can create course requirements/assignments
- File Submission: Students can submit files for requirements
- Submission Tracking: Track and view all submissions
- Requirement Management: Full CRUD operations for requirements
- Course Notifications: Send notifications to all students in a course
- Individual Notifications: Send targeted notifications to specific students
- Notification Status: Track read/unread status of notifications
- User Preferences: Configure email and site notification preferences
- File Upload: Support for file uploads in requirements and announcements
- File Storage: Secure file storage in the uploads directory
- Download Support: Access to downloadable course materials
- Backend Framework: Spring Boot 3.5.5
- Java Version: Java 21
- Database: MySQL
- ORM: Spring Data JPA with Hibernate
- Security: Spring Security with JWT
- Authentication: JWT (JSON Web Tokens)
- Password Encoding: BCrypt
- Build Tool: Maven
- Code Generation: Lombok
- Spring Boot Web Starter
- Spring Boot Data JPA
- Spring Boot Security
- MySQL Connector
- JWT (jjwt 0.12.3)
- Lombok
- Spring Boot Test
- Java 21 or higher
- Maven 3.6+
- MySQL 8.0+
- Git
-
Clone the repository
git clone <repository-url> cd sagely
-
Database Setup
- Create a MySQL database named
sagely - Update database credentials in
src/main/resources/application.properties:spring.datasource.url=jdbc:mysql://localhost:3306/sagely spring.datasource.username=your_username spring.datasource.password=your_password
- Create a MySQL database named
-
Build and Run
mvn clean install mvn spring-boot:run
-
Access the Application
- The application will start on
http://localhost:8080 - Default admin credentials:
- Email:
admin@sagely.com - Password:
admin123
- Email:
- The application will start on
POST /signup- User registrationPOST /login- User loginPOST /logout- User logoutPOST /change-password- Change passwordGET /me- Get current user profilePUT /profile/update- Update user profile
GET /- Get all coursesGET /{id}- Get course by IDPOST /- Create course (Admin only)PUT /{id}- Update course (Admin only)DELETE /{id}- Delete course (Admin only)POST /{courseID}/enroll- Enroll in course (Student only)GET /{courseID}/announcements- Get course announcementsGET /{courseID}/students- Get enrolled students (Admin only)
GET /- Get all announcementsGET /{id}- Get announcement by IDPOST /- Create announcement (Admin only)PUT /{id}- Update announcement (Admin only)DELETE /{id}- Delete announcement (Admin only)
GET /courses/{id}/requirements- Get course requirementsPOST /requirements- Create requirement (Admin only)PUT /requirements/{id}- Update requirement (Admin only)DELETE /requirements/{id}- Delete requirement (Admin only)POST /requirements/{requirementID}/submit- Submit requirement (Student only)GET /requirements/{requirementID}/submissions- Get requirement submissionsGET /me/submissions- Get my submissions (Student only)
GET /notifications/me- Get my notificationsPOST /courses/{courseID}/notify- Send course notification (Admin only)POST /students/{studentID}/notify- Send student notification (Admin only)PATCH /notifications/{notificationID}/read- Mark notification as read
The application uses the following main entities:
- User: Stores user information with roles (Admin/Student)
- Course: Course information and details
- Announcement: Course announcements with attachments
- Requirement: Course assignments/requirements
- RequirementSubmission: Student submissions for requirements
- Notification: User notifications
- EnrolledStudents: Course enrollment tracking
- Attachment: File attachments for announcements
- DownloadableFiles: Course materials
- JWT Authentication: Stateless authentication using JSON Web Tokens
- Role-based Authorization: Different access levels for Admin and Student roles
- Password Encryption: BCrypt password hashing
- CORS Configuration: Cross-origin resource sharing setup
- Session Management: Stateless session management
src/
βββ main/
β βββ java/com/EgronX/sagely/
β β βββ config/ # Security and configuration classes
β β βββ Controller/ # REST API controllers
β β βββ Dto/ # Data Transfer Objects
β β βββ Entities/ # JPA entities
β β βββ Mapper/ # Entity-DTO mappers
β β βββ Repository/ # Data access layer
β β βββ Service/ # Business logic layer
β β βββ SagelyApplication.java
β βββ resources/
β βββ application.properties
β βββ sagely.sql # Database schema
β βββ static/ # Static resources
βββ test/ # Test classes
- Secure user registration and authentication
- Profile management with notification preferences
- Role-based access control (Admin/Student)
- Password change functionality
- Complete course lifecycle management
- Student enrollment system
- Course-specific content organization
- Student roster management for admins
- Announcement system for course updates
- Notification system for important messages
- File attachment support
- Categorized content organization
- Requirement/assignment creation and management
- File submission system for students
- Submission tracking and review
- Course-specific requirement organization
The application can be configured through application.properties:
- Database connection settings
- Server port configuration
- Default admin account settings
- JPA/Hibernate configuration
--
Sagely - Empowering education through technology π