A Spring Boot application providing AI-powered educational features with real-time communication capabilities.
- Java 17 or higher
- Maven 3.6+
- Docker & Docker Compose
- PostgreSQL 15+
- Redis 7+
# Windows
./start.bat
# Linux/macOS
chmod +x start.sh
./start.sh# Start dependencies
docker-compose up -d postgres redis
# Set environment variables
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/instructai_db
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=password
# ... (see Environment Variables section)
# Run application
./mvnw spring-boot:run| Variable | Description | Default |
|---|---|---|
SPRING_DATASOURCE_URL |
PostgreSQL connection string | jdbc:postgresql://localhost:5432/instructai_db |
SPRING_DATASOURCE_USERNAME |
Database username | postgres |
SPRING_DATASOURCE_PASSWORD |
Database password | password |
REDIS_HOST |
Redis server host | localhost |
REDIS_PORT |
Redis server port | 6379 |
REDIS_PASSWORD |
Redis password | `` |
SERVER_PORT |
Application server port | 8007 |
SOCKETIO_PORT |
Socket.IO server port | 9092 |
JWT_SECRET |
JWT signing secret | yourSecretKeyHereShouldBeVeryLongAndSecure |
GEMINI_API_KEY |
Google Gemini API key | Required |
FRONTEND_CLIENT |
Frontend URL for CORS | http://localhost:3000 |
application.properties: Default configuration with fallbacksapplication-prod.properties: Production-specific settingsdocker-compose.yml: Local development setuprender.yaml: Render.com deployment configuration
- Spring Boot: Main application framework
- Spring Data JPA: Database access layer
- Spring Security: Authentication and authorization
- Spring Cache: Redis-based caching
- Socket.IO: Real-time communication
- PostgreSQL: Primary database
- Redis: Caching and session storage
- AI-powered course generation using Google Gemini
- Real-time chat and collaboration
- User progress tracking
- JWT-based authentication
- Comprehensive caching strategy
- Health monitoring with Spring Actuator
GET /actuator/health- Health checkPOST /api/auth/login- User authenticationGET /api/courses- Course listingPOST /api/courses- Course creationGET /api/users/profile- User profileGET /api/threads- Community threads
- Socket.IO endpoint:
ws://localhost:9092 - Real-time chat messaging
- Live progress updates
- Collaborative features
src/
βββ main/
β βββ java/
β β βββ com/screening/interviews/
β β βββ config/ # Configuration classes
β β βββ controller/ # REST controllers
β β βββ dto/ # Data transfer objects
β β βββ model/ # JPA entities
β β βββ repo/ # Repository interfaces
β β βββ security/ # Security configuration
β β βββ service/ # Business logic
β βββ resources/
β βββ application.properties
β βββ application-prod.properties
βββ test/ # Unit and integration tests
InterviewFeedback.java: Main application classSecurityConfig.java: Security configurationRedisConfig.java: Redis configurationSocketIOConfig.java: Socket.IO configurationWebClientConfig.java: HTTP client configuration
The application uses JPA entities with automatic schema generation:
User: User profiles and authenticationCourse: Course definitionsModule: Course modulesThread: Community discussion threadsMessage: Chat messagesUserProgress: Progress tracking
# Unit tests
./mvnw test
# Integration tests
./mvnw integration-test
# All tests
./mvnw verify- Unit tests for service layer
- Integration tests for repositories
- Controller tests with MockMvc
- Security tests
# Development mode
./start.sh --mode dev
# Production mode
./start.sh --mode prod --rebuild# Build image
docker build -t instructai-server .
# Run container
docker run -p 8007:8007 -p 9092:9092 instructai-server- Fork/clone the repository
- Connect to Render.com
- Use the provided
render.yamlconfiguration - Deploy automatically with environment variables
- Use strong JWT secrets
- Enable HTTPS
- Configure proper CORS origins
- Set up database backups
- Monitor application metrics
- Configure log aggregation
- Application health:
/actuator/health - Database connectivity check
- Redis connectivity check
- Custom health indicators
- Prometheus metrics:
/actuator/metrics - JVM metrics
- Database connection pool metrics
- Cache hit/miss ratios
- Custom business metrics
- Structured logging with logback
- Configurable log levels
- Request/response logging
- Error tracking and alerting
- JWT-based authentication
- Configurable token expiration
- Secure password hashing with BCrypt
- Role-based access control
- Method-level security
- Resource-based permissions
- CORS configuration
- CSRF protection
- Security headers middleware
Error: Unable to open JDBC Connection for DDL execution
Solution: Check database credentials and ensure PostgreSQL is running
Error: Could not connect to Redis
Solution: Verify Redis server is running and credentials are correct
Error: Could not safely identify store assignment for repository
Solution: Ensure RedisRepositoriesAutoConfiguration is excluded
# Enable debug logging
export LOGGING_LEVEL_COM_SCREENING_INTERVIEWS=DEBUG
./mvnw spring-boot:run- Database connection pool sizing
- Redis cache TTL configuration
- JVM heap settings
- Thread pool configuration
- Swagger UI:
/swagger-ui.html(when enabled) - OpenAPI spec:
/v3/api-docs
- Follow Spring Boot best practices
- Write comprehensive tests
- Document API changes
- Update configuration examples
- Test deployment scenarios
- Use Spring Boot conventions
- Follow Java naming conventions
- Add proper JavaDoc comments
- Use meaningful variable names
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Check the troubleshooting guide
- Review application logs
- Check GitHub issues
- Contact the development team
Made with β€οΈ by the InstructAI Team