A Spring Boot-based REST API for managing events, user connections, and AI-powered quiz generation.
- User authentication and authorization with JWT
- Event management (creation, subscription, updates)
- User connection system with request/accept workflow
- AI-powered quiz generation using Google's Gemini API
- WebSocket support for real-time notifications
- Secure cookie-based session management
- Role-based access control
- Java 17 or higher
- Maven 3.6 or higher
- PostgreSQL database
- Google Cloud account (for Gemini API access)
Create an application.properties file in src/main/resources/ with the following properties:
# Database Configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/eventdb
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
# JWT Configuration
jwt.secret-key=your_jwt_secret_key
client.id=your_google_client_id
# Gemini API Configuration
gemini.api.key=your_gemini_api_key
# Server Configuration
server.port=8080- JWT-based authentication
- Secure HTTP-only cookies
- CORS configuration for specific origins
- Password encryption using BCrypt
- Role-based authorization
POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/logout- User logout
POST /api/events- Create new eventGET /api/events- List all eventsGET /api/events/{id}- Get event detailsPATCH /api/events/{id}- Update eventDELETE /api/events/{id}- Delete eventPOST /api/events/subscribe- Subscribe to event
POST /api/connections/request- Request connectionGET /api/connections/pending- Get pending connectionsPATCH /api/connections/answer- Answer connection requestGET /api/connections/accepted- Get accepted connections
POST /api/quiz/generate- Generate quiz questionsGET /api/quiz/history- Get quiz history
/websocket- WebSocket endpoint for real-time notifications- Topics:
/topic/notifications- General notifications/queue/private- Private messages/user/queue/notifications- User-specific notifications
The API uses standardized error responses with appropriate HTTP status codes:
- 400 Bad Request - Invalid input data
- 401 Unauthorized - Authentication required
- 403 Forbidden - Insufficient permissions
- 404 Not Found - Resource not found
- 409 Conflict - Resource conflict
- 500 Internal Server Error - Server-side error
- Clone the repository
- Configure the application.properties
- Run
mvn clean install - Start the application with
mvn spring-boot:run
Build and run using Docker:
docker-compose up --build- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.