Live Application: Mood Tracker
The backend and frontend are deployed on Railway — you can try out the app directly at the link above.
- User authentication with JWT (register, login, logout)
- Secure password change and account management
- Track daily mood entries with notes and emojis support
- Validation for entries (minimum 10 characters, maximum 1000)
- Integration with OpenAI (Spring AI) to analyze moods and provide personalized suggestions
- Integrated with OpenAI (Spring AI) to generate plan based on your entries (moods)
- REST API endpoints tested with Postman
- MySQL database support
- Docker-ready for easy deployment
- Backend: Java, Spring Boot, Spring Security, Spring Data JPA, Spring AI
- Database: MySQL
- Authentication: JWT with blacklist and refresh handling
- Testing: Postman collections
- Deployment: Railway (Dockerized)
mood-tracker/
├── src/main/java/com/moodTracker
│ ├── controller # REST controllers
│ ├── service # Business logic services
│ ├── security # JWT, filters, authentication
│ ├── model # Entities and DTOs
│ ├── repository # JPA repositories
│ └── MoodTrackerApplication.java
├── src/main/resources
│ ├── application.properties # Configurations
│ └── schema.sql # Database schema (if applicable)
└── pom.xml
POST /api/auth/register– Register new userPOST /api/auth/login– Authenticate and get JWTPOST /api/auth/logout– Invalidate JWT (blacklist)POST /api/auth/change-password– Change password
POST /api/mood/create– Create new mood entryPUT /api/mood/update– Update mood entryGET /api/mood/date– Retrieve mood entry by dateGET /api/mood/range– Retrieve moods entries by start & end dateDELETE /api/mood/{id}– Delete entry
POST /api/ai/analyze– Analyze mood entry and provide suggestions with AIPOST /api/ai/plan– Generate personalized plan with AI based on mood entries
Example response:
{
"average": 3.6,
"summary": "Concise summary in English language, ~120 words max.",
"suggestions": [
"Actionable suggestion #1",
"Actionable suggestion #2",
"Actionable suggestion #3",
"Actionable suggestion #4",
"Actionable suggestion #5"
]
}- Java 21+
- Maven 3.9+
- MySQL running locally (or via Docker)
- Docker (for containerized deployment)
# Clone repository
git clone https://github.com/emirtotic/mood-tracker.git
cd mood-tracker
# Build
mvn clean install
# Run
mvn spring-boot:runUpdate application.properties with your database credentials:
spring.datasource.url=jdbc:mysql://localhost:3306/database_name
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=updateBuild and run using Docker:
docker build -t mood-tracker .
docker run -p 8080:8080 mood-trackerContributions are welcome! Please fork the repository and submit a pull request.
Created by: Emir Totić • Backend: Java/Spring Boot, AI integrations