A simple, secure, and modular backend for Studybot, built with Spring Boot and MySQL (Aiven). This backend handles authentication, API integration, email notifications, and database operations for the Studybot platform.
- JWT-based authentication and authorization
- Secure handling of sensitive credentials via
.env - Integration with Groq AI API for chatbot responses
- SMTP email notifications (Gmail SMTP)
- MySQL database support with JPA/Hibernate
- Environment-based configuration for easy deployment
- Docker-ready (optional, can be added later)
- Backend: Java 17, Spring Boot 3.5
- Database: MySQL (via Aiven Cloud)
- Authentication: JWT
- Email: Spring Boot Mail
- Environment Management:
dotenv-java
- Java 17+
- Maven 3.8+
- Git
- Aiven MySQL or local MySQL database
- Clone the repository
git clone https://github.com/pratikcrj07/studybot-backend.git
cd studybot-backend- Create environment file
Copy bot.env.example to bot.env and update your credentials:
cp bot.env.example bot.envEdit bot.env with your API keys, database credentials, and SMTP settings.
- Run the application
mvn clean install
mvn spring-boot:runThe backend will start on port 8080 (or your configured port).
All sensitive credentials and configuration should be stored in bot.env:
SERVER_PORT— Backend server portSPRING_APPLICATION_NAME— Application nameJWT_SECRET— Secret for JWT tokensGROQ_API_URL/GROQ_API_KEY— Groq AI integrationSPRING_MAIL_*— Gmail SMTP configurationSPRING_DATASOURCE_*— MySQL database configuration
Note: Never commit bot.env to public repositories. Use bot.env.example as reference.
- Using MySQL via Aiven Cloud
- JPA/Hibernate handles schema updates automatically (
spring.jpa.hibernate.ddl-auto=update) - Tables will be created automatically on startup
- Fork the repository
- Create feature branches for new functionality
- Commit with clear, concise messages
- Push and open pull requests
This project is open-source. Feel free to use and modify it under [MIT License] or your chosen license.
- Add Docker support for easier deployment
- Add unit/integration tests for endpoints
- Add logging and monitoring for production readiness