A modern, full-featured educational platform built with Spring Boot and Spring Security. This platform enables instructors to create and manage courses, students to enroll and learn, and administrators to oversee the entire ecosystem.
- Features
- Technology Stack
- Architecture
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Documentation
- Testing
- Project Structure
- Additional Documentation
- Contributing
- User Registration & Login with email verification via OTP
- JWT-based Authentication for secure API access
- Role-based Access Control (Student, Instructor, Admin)
- Password Reset functionality with email verification
- Change Password for authenticated users
- Create, Edit, and Delete Courses (Instructor)
- Course Categories for organized browsing
- Course Sections and Subsections for structured content
- Course Progress Tracking for students
- Course Thumbnails via Cloudinary integration
- Draft and Published status management
- Razorpay Payment Gateway integration
- Secure Payment Processing for course enrollment
- Payment Verification and order management
- Multiple Student Enrollment support
- Course Rating System (1-5 stars)
- Student Reviews for completed courses
- Average Rating Calculation and display
- User Profile Creation with additional details
- Profile Updates (contact number, about, gender, date of birth)
- Profile Image Upload via Cloudinary
- Instructor Dashboard with enrolled students
- Email Notifications for registration, enrollment, and updates
- Contact Us Form for user inquiries
- SMTP Integration for reliable email delivery
- Cloudinary Integration for image and video uploads
- Secure URL Generation for media assets
- Optimized Media Delivery
- Java 21 - Programming Language
- Spring Boot 3.2.0 - Application Framework
- Spring Security - Authentication & Authorization
- Spring Data MongoDB - Database Integration
- Spring Boot Mail - Email Services
- MongoDB - NoSQL Database for flexible data storage
- JWT (JSON Web Tokens) - Stateless authentication
- BCrypt - Password hashing
- JJWT 0.11.5 - JWT implementation
- Cloudinary - Media storage and delivery
- Razorpay - Payment gateway integration
- SMTP - Email delivery
- Lombok - Boilerplate code reduction
- Maven - Dependency management
- Spring Boot DevTools - Development utilities
- JUnit 5 - Unit testing framework
- Mockito - Mocking framework
- Spring Security Test - Security testing utilities
This application follows a layered architecture pattern:
┌─────────────────────────────────────┐
│ Controllers Layer │ ← REST API Endpoints
├─────────────────────────────────────┤
│ Service Layer │ ← Business Logic
├─────────────────────────────────────┤
│ Repository Layer │ ← Data Access
├─────────────────────────────────────┤
│ MongoDB Database │ ← Data Persistence
└─────────────────────────────────────┘
Key Components:
- Controllers: Handle HTTP requests and responses
- Services: Implement business logic
- Repositories: Manage database operations
- DTOs: Data Transfer Objects for API communication
- Entities: MongoDB document models
- Configuration: Security, JWT, Cloudinary, and application settings
- Utils: Helper classes (JWT utilities, etc.)
- Exception: Custom exception handling
Before you begin, ensure you have the following installed:
- Java Development Kit (JDK) 21 or higher
- Apache Maven 3.6+
- MongoDB 4.4+
- Download MongoDB
- Or use MongoDB Atlas (cloud-based)
- Git (for cloning the repository)
- Cloudinary Account - For media storage (Sign up)
- Razorpay Account - For payment processing (Sign up)
- SMTP Email Service - For sending emails (Gmail, SendGrid, etc.)
git clone https://github.com/yourusername/edtechplatform.git
cd edtechplatformOption A: Local MongoDB
# Start MongoDB service
mongod --dbpath /path/to/your/data/directoryOption B: MongoDB Atlas (Cloud)
- Create a free cluster at MongoDB Atlas
- Get your connection string
Create a .env file in the root directory or set system environment variables:
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/studynotion
MONGODB_DATABASE=studynotion
MONGODB_AUTH_DATABASE=admin
MONGODB_USERNAME=root
MONGODB_PASSWORD=root
# JWT Configuration
JWT_SECRET=myVerySecretKeyThatShouldBeAtLeast256BitsLongForHS256Algorithm2024SecureTokenGeneration
JWT_EXPIRATION=86400000
# Cloudinary Configuration
CLOUD_NAME=your_cloudinary_cloud_name
API_KEY=your_cloudinary_api_key
API_SECRET=your_cloudinary_api_secret
# Razorpay Configuration
RAZORPAY_KEY=your_razorpay_key_id
RAZORPAY_SECRET=your_razorpay_secret_key
# Email Configuration (SMTP)
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME[email protected]
MAIL_PASSWORD=your_app_specific_passwordNote: See EMAIL_CONFIGURATION_GUIDE.md for detailed email setup instructions.
mvn clean installThe application uses application.properties.yaml for configuration. Default values are provided, but you should override them using environment variables for production.
src/main/resources/application.properties.yaml- Main configuration filepom.xml- Maven dependencies and build configuration
The application uses Spring Security with JWT tokens:
- Public endpoints:
/api/auth/**,/api/categories/**,/api/course/details/** - Protected endpoints: All other endpoints require authentication
- Role-based access: Different roles (STUDENT, INSTRUCTOR, ADMIN) have different permissions
# Using Maven
mvn spring-boot:run
# Or using Maven wrapper (Windows)
.\mvnw.cmd spring-boot:run
# Or using Maven wrapper (Unix/Mac)
./mvnw spring-boot:run# Build the JAR file
mvn clean package -DskipTests
# Run the JAR
java -jar target/edtechplatform-0.0.1-SNAPSHOT.jarThe application will start on http://localhost:8080 by default.
http://localhost:8080
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/sendotp |
Send OTP for registration | No |
| POST | /api/auth/signup |
Register new user | No |
| POST | /api/auth/login |
Login user | No |
| POST | /api/auth/changepassword |
Change password | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/course/create |
Create new course | Yes (Instructor) |
| PUT | /api/course/edit |
Edit course details | Yes (Instructor) |
| GET | /api/course/details/{courseId} |
Get course details | No |
| GET | /api/course/instructor |
Get instructor's courses | Yes (Instructor) |
| DELETE | /api/course/delete/{courseId} |
Delete course | Yes (Instructor) |
| POST | /api/course/progress/update |
Update course progress | Yes (Student) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/categories/create |
Create category | Yes (Admin) |
| GET | /api/categories/all |
Get all categories | No |
| GET | /api/categories/{categoryId} |
Get category details | No |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/v1/payment/capturePayment |
Initiate payment | Yes (Student) |
| POST | /api/v1/payment/verifyPayment |
Verify payment | Yes (Student) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| PUT | /api/v1/profile/update |
Update user profile | Yes |
| DELETE | /api/v1/profile/delete |
Delete user account | Yes |
| GET | /api/v1/profile/details |
Get profile details | Yes |
| GET | /api/v1/profile/enrolled-students |
Get enrolled students | Yes (Instructor) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/v1/review/create |
Create review | Yes (Student) |
| GET | /api/v1/review/average/{courseId} |
Get average rating | No |
| GET | /api/v1/review/all |
Get all reviews | No |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/v1/section/create |
Create section | Yes (Instructor) |
| PUT | /api/v1/section/update |
Update section | Yes (Instructor) |
| DELETE | /api/v1/section/delete |
Delete section | Yes (Instructor) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/v1/subsection/create |
Create subsection | Yes (Instructor) |
| PUT | /api/v1/subsection/update |
Update subsection | Yes (Instructor) |
| DELETE | /api/v1/subsection/delete |
Delete subsection | Yes (Instructor) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/v1/reach/contact |
Submit contact form | No |