Academix is a Spring Boot application that implements an online learning / course platform with the following capabilities (implemented or scaffolded in code found in this repository):
- Multi-role user model (Admin, Teacher, Student).
- Course management (courses, lectures, documents, content).
- Exams, questions, attempts, and progress tracking.
- Enrollment and payments (Stripe integration, Stripe Connect for teacher onboarding).
- File storage abstraction backed by Supabase (signed upload / signed download flows).
- Certificate issuance and a vault/withdrawal subsystem for teacher payouts.
- OAuth2 (GitHub) login plus JWT for API authentication and a Thymeleaf-based minimal UI (login, register, enroll pages).
- Java (Spring Boot 3.x)
- Spring Data JPA (Hibernate)
- Spring Security + OAuth2 client
- JWT (io.jsonwebtoken / JJWT)
- MySQL (jdbc:mysql)
- Stripe Java SDK (server-side payments & webhooks)
- Supabase Storage (signed upload/download)
- Thymeleaf (minimal server-side pages)
- Lombok, MapStruct / ModelMapper
- Maven build
Spring Boot parent in
pom.xmlis3.5.3— Java 17+ is recommended.
com.talha.academix— main application class (AcademixApplication)config— Spring Security configuration and application configurationcontrollers— REST controllers & view controllers (API surface)services— service layer implementationsrepository— Spring Data JPA repositoriesmodel— JPA entitiesdto— request/response DTOssecurity— customUserDetails, OAuth2 success handler, etc.util— JWT utilities and auth filterresources/templates— Thymeleaf pages (login.html,enroll.html, etc.)resources/application.properties— default config used by the application
The repository contains ~25 JPA entities. Primary ones (file names) and purpose:
User— app users (Admin / Teacher / Student)Course— course entityLecture— lecture inside courseContent— course content (videos, text)Document— attached files / documentsEnrollment— course enrollment recordExam,Question,QuestionOption— exam and question modelsAttempt,AttemptAnswer— exam attempt trackingPayment,StripePaymentDetail,StripePaymentEvent,StripeWebhookEvent— payment & event trackingStoredFile— metadata for files stored in SupabaseCertificate— course certificate recordsTeacherAccount,TeacherQualification— teacher profile/account/onboardingVault,VaultTransaction,Withdrawal— teacher/withdrawal bookkeepingLectureProgress,DocumentProgress,StudentContentProgress— progress tracking
Controller base paths:
GET /— redirects to/login(Thymeleaf view)GET /login,GET /register— viewsGET /oauth2/callback— OAuth2 callback view
REST controllers (base paths):
-
/api/users— user registration, listing, update, deletion (JWT authentication protected)- Public routes (whitelisted in JWT filter):
/api/users/register,/api/users/login,/api/users/auth,/api/users/welcome(see security filter)
- Public routes (whitelisted in JWT filter):
-
/api/courses— create/list/update/delete courses -
/api/lectures— lecture CRUD and playback/progress -
/api/contents— content CRUD -
/api/documents— document management -
/api/enrollments— enroll/unenroll & enrollment listing -
/api/exams,/api/questions,/api/options,/api/attempts,/api/attempt-answers— exam lifecycle and answers -
/api/payments— initiate payments, fetch publishable key -
/api/stripe/connect— teacher Stripe Connect onboarding (onboarding link) -
/stripe/webhook— Stripe webhook endpoint (must configurestripe.webhook-secret) -
/api/files— Supabase signed upload / mark-ready / signed-download -
/api/certificates— certificate generation & download -
/api/vaults,/api/withdrawals— payout & withdrawal flows -
/api/admin/dashboard— admin dashboard endpoints -
ViewControllerserves the minimal UI views
-
JWT-based authentication is implemented (
JwtService,JwtAuthFilter).JwtAuthFilterskips auth for public pages and the endpoints listed in section 5.
-
OAuth2 GitHub login is present with an
OAuth2AuthenticationSuccessHandlerthat:- creates a local
User(default roleSTUDENT) for OAuth users if not present, - issues a JWT and redirects/carries a token in a redirect (see handler code).
- creates a local
-
application.propertiescontains a default user (spring.security.user.name=talha,spring.security.user.password=2612) for simple form login and initial access. -
Many credentials in
application.propertiesare placeholders or stored directly — do not use this in production.
Security recommendation (must do before production):
- Move all secrets (DB password, JWT secret, Stripe keys, Supabase keys, OAuth client secret) into environment variables or a secret manager.
- Java 17+ (required by Spring Boot 3.x)
- Maven 3.6+
- MySQL server (create database
AcademixDBor change URL) - Stripe account & test keys (for payments, and Stripe Connect for teacher onboarding)
- Supabase project (for file storage) or modify file storage implementation
- Optional: GitHub OAuth app for OAuth login
From project root (where pom.xml is):
# Build
mvn clean package
# Run (from target)
java -jar target/academix-0.0.1-SNAPSHOT.jar
# Alternatively run with Maven (dev)
mvn spring-boot:runThe app default port is 8081 (see application.properties). Access http://localhost:8081/login.
To run with a different application.properties, use Spring profiles or pass overrides:
- Stripe is used for payments and teacher payouts (
stripe-javaSDK). - Configure
STRIPE_SECRET_KEYandstripe.publishable-keyin env orapplication.properties. - Stripe webhook endpoint:
/stripe/webhook. You must configure the Stripe dashboard webhook with the endpoint URL and setstripe.webhook-secretin config. - For local webhook testing, use
stripe listenand forward tohttp://localhost:8081/stripe/webhook(in Stripe CLI).
Teacher Stripe Connect:
TeacherStripeConnectControllerprovides an onboarding link route that usesTeacherAccountServiceImpl. Ensure your server URLs (refresh, return) are accurate in production.
-
The app uses Supabase storage for media and document hosting.
-
Flow implemented in
StoredFileController:POST /api/files/initiate-signed-upload— server returns signed upload parameters (Supabase).- Client uploads directly to Supabase using signed URL.
POST /api/files/{id}/mark-ready— notify server that upload completed.GET /api/files/{id}/signed-download— obtain signed download URL for playback or download.
Configure:
supabase.url,supabase.apiKey(public),supabase.serviceRoleKey(server-side privileged key), andsupabase.storage.bucket.
-
Install Java 17+, Maven, MySQL, StripeCLI.
-
Create DB:
CREATE DATABASE AcademixDB; -
Set env vars or edit
application.properties:spring.datasource.*,STRIPE_SECRET_KEY,stripe.publishable-key,stripe.webhook-secret,supabase.*,spring.security.oauth2.client.registration.github.client-id/secret, etc.
-
mvn clean package -
java -jar target/academix-0.0.1-SNAPSHOT.jar -
Browse
http://localhost:8081/login