A Spring Boot 3 + Maven powered backend service for a SaaS-style e-learning platform. This project demonstrates how to build a production-ready backend with authentication, user management, and secure APIs.
Designed to showcase clean architecture, modern Java practices, and readiness for scaling SaaS applications.
- Backend Framework: Spring Boot 3
- Build Tool: Maven
- Language: Java 17+
- Database: PostgreSQL (configurable to H2 for testing)
- ORM: Spring Data JPA
- Authentication & Security: Spring Security with form login (extendable to JWT/OAuth2)
- Testing: JUnit 5, Spring Boot Test
- Dev Tools: Lombok, Spring Boot DevTools
backend/
│── src/
│ ├── main/java/com/sass/
│ │ ├── BackendApplication.java # Main entry point
│ │ ├── config/ # Spring Security & App Config
│ │ ├── controller/ # REST API controllers
│ │ ├── model/ # JPA Entities
│ │ ├── repository/ # Data Access Layer
│ │ └── service/ # Business Logic Layer
│ └── test/java/com/sass/
│ └── DemoApplicationTests.java # Unit/Integration tests
│
└── pom.xml # Maven dependencies
-
Entry Point
BackendApplication.java
starts the application withSpringApplication.run(...)
.- Automatically scans
com.sass
package and its subpackages.
-
User Request
- Example: User navigates to
http://localhost:8080/login
. - Spring Security intercepts the request and shows a login page.
- Example: User navigates to
-
Authentication
- If login fails → redirected to
/login?error
. - If login succeeds → redirected to home page or protected API.
- If login fails → redirected to
-
Controllers
- REST controllers in
controller/
handle user-facing endpoints like/api/courses
,/api/users
.
- REST controllers in
-
Services
- Business logic resides in
service/
classes (e.g., course creation, enrollment rules).
- Business logic resides in
-
Data Persistence
- Services call
repository/
interfaces. - Spring Data JPA translates repository calls into SQL queries to PostgreSQL.
- Services call
-
Response
- Data is returned as JSON, ready to be consumed by a React/Flutter frontend.
git clone https://github.com/ManibalaSinha/saas-backend.git
cd saas-backend
Update application.properties
in src/main/resources/
:
spring.datasource.url=jdbc:postgresql://localhost:5432/saasdb
spring.datasource.username=postgres
spring.datasource.password=yourpassword
spring.jpa.hibernate.ddl-auto=update
(For quick start, you can switch to in-memory H2 by uncommenting H2 config.)
mvn spring-boot:run
Backend will start on: http://localhost:8080
mvn test
GET /login
→ Login Page (Spring Security)GET /api/users
→ Fetch all usersPOST /api/courses
→ Create new courseGET /api/courses/{id}
→ Fetch course details
clean architecture in a real-world SaaS backend. Spring Security for authentication & authorization. Built with modern Spring Boot 3 and Java 17. Integrating with React frontend. Follows enterprise-grade practices
** Manibala Sinha** 🔗 LinkedIn | GitHub
If you like this project, don’t forget to star the repo – it motivates me to build more!