Skip to content

Raam751/VibeEdu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VibeEdu 🎓

A real-time classroom engagement platform built with Spring Boot. Teachers create interactive sessions, students join with a 6-digit code and respond to questions in real-time.

Features

  • JWT Authentication — Secure token-based auth for teachers and students
  • Session Management — Create sessions with unique 6-digit join codes; lifecycle: CREATED → ACTIVE → ENDED
  • Question Types — MCQ (with validated options), Rating (1-5), and Open Text
  • Role-Based Access — Teachers create content, students respond; enforced at both role and ownership level
  • Answer Validation — MCQ bounds checking, rating range enforcement, text length limits
  • Pagination & Filtering — Paginated endpoints with status/teacher/date filtering
  • Swagger UI — Interactive API documentation with JWT support

Tech Stack

  • Java 21
  • Spring Boot 3.4.x
  • Spring Security + JWT (jjwt)
  • Spring Data JPA + H2 (in-memory)
  • Bean Validation (Jakarta)
  • Lombok
  • SpringDoc OpenAPI (Swagger UI)
  • JUnit 5 + Mockito + AssertJ

Quick Start

git clone https://github.com/Raam751/VibeEdu.git
cd VibeEdu
./mvnw spring-boot:run

The app starts at http://localhost:8080

API Endpoints

Authentication (Public)

Method Endpoint Description
POST /api/auth/register Register (TEACHER or STUDENT)
POST /api/auth/login Login, receive JWT token

Sessions

Method Endpoint Access Description
POST /api/sessions Teacher Create session
GET /api/sessions Auth List all (paginated)
GET /api/sessions/{id} Auth Get by ID
GET /api/sessions/code/{code} Public Join by code
GET /api/sessions/filter Auth Filter by status/teacher/date
PUT /api/sessions/{id}/start Owner Start session
PUT /api/sessions/{id}/end Owner End session
DELETE /api/sessions/{id} Owner Delete (cascades)

Questions

Method Endpoint Access Description
POST /api/questions Teacher Create question
GET /api/questions/{id} Auth Get by ID
GET /api/questions/session/{id} Auth List by session
PUT /api/questions/{id} Teacher Update question
DELETE /api/questions/{id} Teacher Delete (cascades)

Responses

Method Endpoint Access Description
POST /api/responses Student Submit response
GET /api/responses/question/{id} Teacher View responses
GET /api/responses/question/{id}/paged Teacher View (paginated)
PUT /api/responses/{id} Owner Update own response

Users

Method Endpoint Access Description
GET /api/users Teacher List all (paginated)
GET /api/users/{id} Auth Get by ID
GET /api/users/students Teacher List students
DELETE /api/users/{id} Teacher Delete student

Swagger UI

Visit http://localhost:8080/swagger-ui.html — click "Authorize" and paste your JWT token.

H2 Console

Database viewer at http://localhost:8080/h2

  • JDBC URL: jdbc:h2:mem:vibeedu
  • Username: sa
  • Password: (empty)

Architecture

src/main/java/com/vibeedu/vibeedu/
├── controller/    # REST endpoints with Swagger annotations
├── service/       # Business logic, validation, ownership checks
├── repository/    # Spring Data JPA with EntityGraph optimization
├── entity/        # JPA entities with cascade relationships
├── dto/
│   ├── req/       # Request DTOs with Bean Validation
│   └── res/       # Response DTOs with static factory methods
├── security/      # JWT filter, helper, UserDetailsService
├── config/        # Security (CORS, JWT filter chain), Swagger
└── exception/     # Custom exceptions + global handler

Running Tests

./mvnw clean test

Sample Flow

# 1. Register a teacher
curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"name":"Jane","email":"jane@test.com","password":"pass123","role":"TEACHER"}'

# 2. Create a session (use token from step 1)
curl -X POST http://localhost:8080/api/sessions \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"title":"Intro to Java"}'

# 3. Add an MCQ question
curl -X POST http://localhost:8080/api/questions \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"sessionId":1,"text":"What is 2+2?","type":"MCQ","options":["3","4","5","22"]}'

# 4. Start the session
curl -X PUT http://localhost:8080/api/sessions/1/start \
  -H "Authorization: Bearer <token>"

# 5. Register a student, join, and respond

Built for learning and interview showcase 📚

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages