The Learning Management System (LMS) backend is built using Java Spring Boot and designed to manage user roles, authentication, and role-based access to various system features. This backend facilitates the smooth operation of a Learning Management System, including user management, course enrollment, and role-specific operations.
- Student: Can view courses, enroll, and access learning materials.
- Instructor: Can create and manage courses.
- Admin: Manages user roles and overall system configurations.
- User: Basic system user with limited access.
- Login functionality.
- Token-based authentication using JWT.
- Role-based URL access control.
- Create, update, delete, and view courses.
- User registration and management.
- Role-specific access control for functions.
| Component | Technology |
|---|---|
| Backend Framework | Java Spring Boot (version 3.4.1) |
| Database | PostgreSQL |
| Authentication | JWT |
| Testing Tools | Postman |
src/
|-- main/
| |-- java/com/lms/
| | |-- controllers/ # REST controllers
| | |-- services/ # Business logic
| | |-- repositories/ # Database repositories
| | |-- models/ # Data models
| | |-- config/ # Security and app configuration
| |-- resources/
| |-- application.yml # Application configuration
|-- test/
|-- java/com/lms/ # Test cases
- Java: Ensure JDK 17 or above is installed.
- PostgreSQL: Install PostgreSQL and create a database for the project.
- Postman: For testing API endpoints.
-
Clone the repository:
git clone https://github.com/Yousef-karem/Learning-Management-System.git cd Learning-Management-System/lms-backend -
Configure the database:
- Update
src/main/resources/application.ymlwith your PostgreSQL credentials.
spring: datasource: url: jdbc:postgresql://localhost:5432/lms_db username: your_username password: your_password jpa: hibernate: ddl-auto: update jwt: secret: your_jwt_secret
- Update
-
Build and run the project:
./mvnw spring-boot:run
-
Access the API:
- API base URL:
http://localhost:8080
- API base URL:
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/login | Authenticate user and return JWT token. |
| POST | /auth/register | Register a new user. |
| Method | Endpoint | Description |
|---|---|---|
| GET | /users | List all users (Admin only). |
| PUT | /users/{id}/role | Update user role (Admin only). |
| Method | Endpoint | Description |
|---|---|---|
| GET | /courses | View all courses (Student/Instructor/Admin). |
| POST | /courses | Create a new course (Instructor only). |
| PUT | /courses/{id} | Update course details (Instructor only). |
| DELETE | /courses/{id} | Delete a course (Instructor/Admin). |
- Open Postman.
- Import the Postman collection provided in the repository (if available) or manually create requests based on the endpoints listed above.
- Test the endpoints using appropriate roles and JWT tokens.
Contributions are welcome! Follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push to your fork.
- Open a pull request to the main repository.
This project is licensed under the MIT License.
For further inquiries or collaboration, please contact:
- Yousef Karem
GitHub Profile - Juliana George
GitHub Profile - Ephraim Youssef
GitHub Profile - Ramez Ragaay
GitHub Profile - Arsany Nageh
GitHub Profile
This backend system is a crucial component of the Learning Management System and ensures secure and efficient management of users, roles, and courses.