ECHO is a secure, privacy-focused journaling application that helps users document their thoughts and emotions with end-to-end encryption and mood analysis capabilities.
- π Secure Authentication - JWT-based authentication with Spring Security
- π Journal Management - Create, read, update, and delete journal entries
- π Mood Analysis with Gemini AI - Powered by Google's Gemini AI for sentiment analysis of journal entries to track emotional patterns
- βοΈ Email Notifications - Weekly digests and important updates
- π RESTful API - Clean, well-documented API endpoints
- π Scalable Architecture - Built with Spring Boot for easy scaling
- Backend: Java 17, Spring Boot 2.7.16
- Database: MongoDB
- AI Integration: Google Gemini API for mood analysis
- Security: JWT, Spring Security
- Build Tool: Maven
- Java 17 or higher
- Maven 3.6.3 or higher
- MongoDB 4.4 or higher
- SMTP server (for email functionality)
-
Clone the repository
git clone https://github.com/Devansh-sys/echo.git cd echo
-
Configure the application Create an
application.propertiesfile insrc/main/resources/with the following content:# Server Configuration server.port=8080 # MongoDB Configuration spring.data.mongodb.uri=mongodb://localhost:27017/echo # JWT Configuration jwt.secret=your_jwt_secret_key_here jwt.expiration=86400000 # Email Configuration spring.mail.host=your_smtp_host spring.mail.port=587 spring.mail.username=your_email@example.com spring.mail.password=your_email_password spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true # Gemini AI Configuration gemini.api.key=your_gemini_api_key_here
-
Build and run the application
mvn clean install mvn spring-boot:run
The application will be available at http://localhost:8080
POST /public/login
Content-Type: application/json
{
"username": "user@example.com",
"password": "yourpassword"
}POST /public/sign-up
Content-Type: application/json
{
"username": "newuser@example.com",
"password": "securepassword"
}GET /user
Authorization: Bearer <JWT_TOKEN>PUT /user
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"username": "updated@example.com",
"password": "newpassword"
}DELETE /user
Authorization: Bearer <JWT_TOKEN>GET /journal
Authorization: Bearer <JWT_TOKEN>POST /journal
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"title": "My Journal Entry",
"content": "Today was a great day!"
}GET /journal/id/{entryId}
Authorization: Bearer <JWT_TOKEN>PUT /journal/id/{entryId}
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"title": "Updated Title",
"content": "Updated content"
}DELETE /journal/id/{entryId}
Authorization: Bearer <JWT_TOKEN>GET /admin/all-users
Authorization: Bearer <JWT_ADMIN_TOKEN>POST /admin/create-admin-user
Authorization: Bearer <JWT_ADMIN_TOKEN>
Content-Type: application/json
{
"username": "admin@example.com",
"password": "adminpassword"
}GET /public/health-checkNote: All endpoints except
/public/*require authentication via JWT token in the Authorization header.
- JWT Authentication: All endpoints except
/public/*require a valid JWT token - Password Hashing: BCrypt for secure password storage
- Role-based Access Control:
- Regular users can only access their own journal entries
- Admin users have additional privileges to manage all users
- Input Validation: Comprehensive validation on all endpoints
- CORS: Configured to prevent unauthorized cross-origin requests
- HTTPS: Recommended for production use
src/main/java/net/devansh/Muse/
βββ config/ # Configuration classes
βββ controller/ # REST API controllers
βββ entity/ # Data models
βββ repository/ # Data access layer
βββ security/ # Security configurations
βββ service/ # Business logic
βββ utils/ # Utility classes
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ using Spring Boot
- Inspired by the need for private, secure journaling solutions
Note: ECHO (Every Chronicle Has an Odyssey) - A personal journey through words