A distributed quiz platform built with Spring Boot microservices, featuring user authentication, quiz management, and AI-powered question generation.
-
User Management
- JWT-based authentication
- Role-based access control
- User registration and profile management
-
Quiz System
- Create and manage quizzes
- Submit answers and view results
- Track quiz history
-
Question Bank
- Categorized questions
- Multiple question types
- AI-powered question generation
-
Rate Limiting
- Redis-based rate limiting
- Protects AI endpoints
- Configurable limits
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ API Gateway │◄───►│ Quiz Service │◄───►| PostgreSQL |
└─────────────────┘ └─────────────────┘ └─────────────────┘
▲ ▲
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ User Service | | Question Service |
└─────────────────┘ └─────────────────┘
▲ ▲
└───────────┬───────────┘
│
▼
┌─────────────────┐
| Service Registry |
└─────────────────┘
- Backend: Java 17, Spring Boot 3.1.1
- Database: PostgreSQL
- Authentication: JWT, Spring Security
- Service Discovery: Eureka
- API Gateway: Spring Cloud Gateway
- AI: Google Gemini Pro
- Caching: Redis
- Build: Maven
- Java 17+
- Maven 3.6.3+
- PostgreSQL 13+
- Redis 6.2+
-
Clone the project
git clone https://github.com/Devansh-sys/quizzy.git cd quizzy -
Set up databases
CREATE DATABASE quiz_db; CREATE DATABASE user_db; CREATE DATABASE question_db;
-
Configure services Update
application.propertiesin each service with your database and Redis credentials. -
Run services
# Start services in order cd service-registry && mvn spring-boot:run cd user-service && mvn spring-boot:run cd question-service && mvn spring-boot:run cd quiz-service && mvn spring-boot:run cd api-gateway && mvn spring-boot:run
Add JWT token to header:
Authorization: Bearer <token>
POST /api/v1/auth/register- Register userPOST /api/v1/auth/authenticate- LoginGET /api/v1/users/me- User profile
POST /quiz/create- New quizGET /quiz/{id}- Get quizPOST /quiz/submit/{id}- Submit answersGET /quiz/user/{userId}- User history
GET /question/all- All questionsPOST /question/add- Add question (Admin)GET /question/category/{category}- By categoryGET /question/generate- AI questions
- 5 requests/minute per endpoint
- Uses Redis
- Fork the repo
- Create feature branch
- Commit changes
- Push and open PR