A secure, end-to-end encrypted (E2EE) journal application built with Spring Boot. This application provides a modern REST API for managing personal journal entries with sentiment analysis, weather integration, and advanced security features.
Maintained by: Rickarya Das
- End-to-End Encryption (E2EE): Your journal entries are encrypted for maximum privacy
- User Authentication: Secure authentication with JWT tokens and OAuth2 (Google)
- Sentiment Analysis: Automatic sentiment detection for your journal entries
- Weather Integration: Correlate entries with real-time weather data
- Caching: Redis-powered caching for improved performance
- Email Notifications: Scheduled email reminders and notifications
- Admin Dashboard: Administrative controls for system management
- API Documentation: Interactive Swagger/OpenAPI documentation
- Kafka Integration: Event-driven architecture for processing
- MongoDB: Flexible document storage for entries
- Framework: Spring Boot 2.7.16
- Language: Java 17
- Database: MongoDB
- Cache: Redis
- Message Queue: Apache Kafka
- Authentication: JWT, OAuth2
- API Documentation: Springdoc OpenAPI (Swagger UI)
- Build Tool: Maven
- Testing: JUnit 5, Mockito
Before running the application, ensure you have the following installed:
- Java 17+
- Maven 3.8+
- Docker and Docker Compose (for containerized setup)
- MongoDB (or use Docker)
- Redis (or use Docker)
- Kafka (or use Docker)
- Clone the repository:
git clone https://github.com/ridash2005/SpringBoot-Journal-App.git
cd journalApp- Copy the environment template:
cp .env.example .env- Update
.envwith your configuration:
MONGODB_URI=mongodb://mongo:27017
REDIS_HOST=redis
REDIS_PASSWORD=your_redis_password
KAFKA_SERVERS=kafka:9092
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
JAVA_EMAIL=your_email@gmail.com
JAVA_EMAIL_PASSWORD=your_app_password
WEATHER_API_KEY=your_weather_api_key
SERVER_PORT=8080- Start the application:
docker-compose up -dThe application will be available at: http://localhost:8080/journal
- Clone the repository:
git clone https://github.com/ridash2005/SpringBoot-Journal-App.git
cd journalApp- Copy the environment template:
cp .env.example .env-
Update
.envwith your local configuration -
Start required services (using Docker):
docker-compose -f docker-compose.dev.yml up -d- Build the application:
mvn clean package -DskipTests- Run the application:
mvn spring-boot:runAll configuration is managed through environment variables. See .env.example for all available options.
Key configurations:
MONGODB_URI: MongoDB connection stringREDIS_HOST: Redis server hostKAFKA_SERVERS: Kafka bootstrap serversGOOGLE_CLIENT_ID&GOOGLE_CLIENT_SECRET: Google OAuth2 credentialsJAVA_EMAIL&JAVA_EMAIL_PASSWORD: Gmail credentials for sending emailsWEATHER_API_KEY: API key for weather serviceSERVER_PORT: Application server port (default: 8080)
Once the application is running, access the interactive API documentation at:
http://localhost:8080/journal/swagger-ui.html
Or view the OpenAPI specification at:
http://localhost:8080/journal/v3/api-docs
src/
├── main/
│ ├── java/net/rickarya/journalApp/
│ │ ├── controller/ # REST API Controllers
│ │ ├── service/ # Business logic services
│ │ ├── entity/ # JPA entities
│ │ ├── repository/ # Data access layer
│ │ ├── config/ # Spring configuration
│ │ ├── filter/ # Security filters
│ │ ├── dto/ # Data transfer objects
│ │ ├── utils/ # Utility classes
│ │ ├── cache/ # Caching logic
│ │ ├── scheduler/ # Scheduled tasks
│ │ ├── constants/ # Application constants
│ │ ├── enums/ # Enumeration types
│ │ ├── model/ # Domain models
│ │ └── api/response/ # API response wrappers
│ └── resources/
│ ├── application.yml # Spring configuration
│ └── logback.xml # Logging configuration
└── test/
└── java/ # Unit and integration tests
mvn clean packagemvn testmvn test -Dtest=UserServiceTestmvn clean test jacoco:reportPOST /journal/public/signup- User registrationPOST /journal/public/login- User loginGET /journal/public/health- Health check
GET /journal/user/all- Get all journal entriesPOST /journal/user/add- Create new journal entryGET /journal/user/{id}- Get journal entry by IDPUT /journal/user/{id}- Update journal entryDELETE /journal/user/{id}- Delete journal entry
GET /journal/admin/all-users- Get all usersDELETE /journal/admin/user/{id}- Delete userGET /journal/admin/stats- System statistics
For complete API documentation, see Swagger UI at /journal/swagger-ui.html
- JWT Tokens: All user requests require valid JWT tokens
- Password Encryption: Passwords are hashed using BCrypt
- CORS: Configured to allow trusted origins
- CSRF Protection: Disabled for stateless API but ensure HTTPS in production
- Sensitive Data: Never commit
.envfiles or secrets to version control
- Follow Google Java Style Guide
- Use meaningful variable and method names
- Add JavaDoc comments for public APIs
- Keep methods small and focused (max 30 lines)
- Use conventional commits:
feat:,fix:,docs:,style:,refactor:,test:,chore: - Example:
feat: add sentiment analysis for journal entries
- Ensure all tests pass before submitting PR
- Update documentation if needed
- Keep PRs focused on a single feature/fix
If port 8080 is already in use, change it in .env:
SERVER_PORT=8081Verify MongoDB URI in .env and that MongoDB service is running:
docker-compose logs mongoEnsure Kafka and Zookeeper are running:
docker-compose logs kafkaRun tests with verbose output:
mvn test -X- Request Logging: All requests are logged in
logs/directory - Metrics: Use Spring Boot Actuator endpoints for monitoring
- Caching: Redis caching reduces database load
- Rate Limiting: Configure in application.yml for production
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see LICENSE file for details.
For issues and questions:
- 📧 Email: rickaryadas@gmail.com
- 🐛 Report bugs: GitHub Issues
- 💡 Suggest features: GitHub Discussions
- Mobile application (iOS/Android)
- Advanced analytics and insights
- AI-powered writing suggestions
- Multi-language support
- Collaborative journal entries
- Export to PDF/Word
- Rickarya Das - GitHub
- Spring Boot community
- MongoDB and Redis documentation
- OpenAPI/Swagger specification