This project is a Learning Management System (LMS) built using Java, Spring Boot, SQL, and PostgreSQL. It provides a robust backend for managing courses, users, and roles with a secure and scalable architecture. The system serves more than 15 REST endpoints across 10 distinct resources to support functionalities like course creation, enrollment, and user management.
-
REST API: Over 10 resources for seamless interaction with the system.
-
Fast Response Times: Optimized to achieve response times under 100ms.
-
Role-Based Access Control (RBAC): Secure user authentication with three distinct privilege levels:
-
Admin: Manage users, roles, and courses.
-
Instructor: Create and manage courses.
-
Student: Enroll in and access courses.
-
-
Optimized Database: Designed with 10 related entities using Spring Data JPA, featuring custom queries for enhanced fetch performance.
The LMS addresses the need for a reliable and secure backend for educational platforms. It simplifies course and user management while maintaining high performance and scalability. Plus, it was the perfect excuse to dive into Spring Boot while tackling a term project — killing two birds with one stone! Key challenges solved include:
-
Implementing secure authentication and authorization.
-
Designing an efficient database schema.
-
Providing a fast and user-friendly API for client applications.
Ensure the following tools are installed on your system:
- Java Development Kit (JDK) 17 or later
- Maven
- Docker: Command-line Docker is recommended, but Docker Desktop can also be used.
- Git
Follow these steps to set up and run the project:
-
Clone the repository:
git clone git@github.com:Osanyem/slap-backend.git cd slap-backend
-
Start the database using Docker Compose:
docker-compose up -d
-
Build the project:
./mvnw clean install
-
Run the application:
./mvnw spring-boot:run
-
Access the application: Open your browser and navigate to http://localhost:9090/swagger-ui.html to view the documentation .
The project uses the application.properties
file for configuration. Common settings include:
-
Database: Configure your database connection with:
spring.datasource.url=jdbc:postgresql://localhost:5432/slap spring.datasource.username=your_username # update this to use your postgres username spring.datasource.password=your_password # update this to use your database password defined in docker-compose.yml
Sample endpoints include:
-
GET /api/courses
: Fetch all available courses. -
POST /api/courses
: Create a new course (admin/instructor only). -
PUT /api/courses/{id}
: Update course details (admin/instructor only).
-
Add Dependencies: Update the
pom.xml
file to include new libraries or frameworks. -
Extend Functionality:
-
Define new models in the
domain
package. -
Implement new endpoints in the
controllers
package. -
Add custom business logic in the
services
package. -
Write efficient database queries in the
repositories
package.
-
-
Testing: Write unit and integration tests in the
src/test/java
directory to ensure robustness.
src/
├── main/
│ ├── java/
│ │ └── com.gould.slap/
│ │ ├── controllers/ # REST controllers
│ │ ├── services/ # Business logic
│ │ ├── repositories/ # Database interactions
│ │ └── domain/ # Data models
│ └── resources/
│ ├── application.properties # Configuration file
└── test/
└── java/ # Unit and integration tests
As always, contributions are always welcome! Or feel free to use this project as a starting point for another Spring Boot Project. Here's how you can help:
-
Fork the repository: Click the "Fork" button at the top of this page.
-
Clone your fork:
git clone git@github.com:Osanyem/slap-backend.git cd slap-backend
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes: Implement your feature or bug fix.
-
Commit your changes:
git commit -m "Add feature: your-feature-name"
-
Push to your branch:
git push origin feature/your-feature-name
-
Open a pull request:
-
Go to the original repository on GitHub.
-
Click "Pull Requests" and then "New Pull Request."
-
Describe your changes and submit the PR.
-
Feel free to reach out via the issue tracker for questions or suggestions!