This is a simple authentication system that uses JWT for authentication.
- Multi-user registration/login (Students, Teachers, Institutions)
- JWT token authentication with configurable expiration
- RESTful API endpoints for authentication operations
- H2 in-memory database (with plans to migrate to PostgreSQL)
- Comprehensive test suite with unit, integration, and API tests using JaCoCo for coverage
- Entities: Student, Teacher, Institution, Courses, Assessments
- Security: Spring Security with JWT filters and password encryption
- Database: Schema supports educational features like courses, assessments, and institutional management
- Testing: Comprehensive test suite with unit, integration, and API tests using JaCoCo for coverage
POST /api/auth/register/{learner|teacher|institution}POST /api/auth/login/{learner|teacher|institution}GET /api/protected/*- Protected endpoints requiring JWT tokens
- Java 21, Spring Boot 3.5.3, Spring Security
- JWT (io.jsonwebtoken), H2 Database, Maven
- JUnit 5, Mockito for testing
- Clone the repository
- Run
mvn clean install - Run
mvn spring-boot:run - The application will start on port 8080
- You can access the H2 console at
http://localhost:8080/h2-console - The default username is
saand the password is empty - The database name is
studentdb
- Run
mvn testto run all tests - Run
mvn jacoco:reportto generate coverage report - The coverage report will be generated in
target/site/jacoco/index.html - The tests are also configured to run on GitHub Actions
- The coverage report will be generated on each push to the repository
- The coverage report will be available in the GitHub Actions tab