A secure and scalable backend for managing personal journal entries
The Journal App Backend is a secure digital platform that enables users to create, manage, and maintain personal journal entries.
It provides RESTful APIs for:
- User Registration & Authentication (JWT)
- CRUD operations for journal entries
- Weekly email updates
This backend ensures data security, scalability, and maintainability for personal journaling applications.
JournalApp/
├── config/ # Security & application configurations
├── controller/ # REST API controllers
├── model/ # Entity models
├── repository/ # MongoDB repositories
├── service/ # Business logic services
├── dto/ # Data transfer objects
├── utils/ # Utility/helper classes
└── resources/ # application.properties and static files
- JWT Authentication & Authorization – Secure login and role-based access control
- User Management – Register, update profile, delete account
- Journal Entry Management – Create, read, update, and delete journal entries
- Admin Features – Manage users and their roles
- Weekly Email Updates – Automated summaries for users
- API Documentation – Swagger UI integration
- Code Quality – Static analysis with SonarCloud
- Language: Java
- Framework: Spring Boot (2.7.15)
- Database: MongoDB
- Authentication: JWT
- API Documentation: Swagger (Springdoc OpenAPI)
- Logging: SLF4J with Logback
- Testing Tools: Postman, SonarCloud
- Email Service: SMTP
- Build Tool: Maven / Gradle
- Clone the repository
git clone https://github.com/your-username/JournalEntryAPI.git
cd JournalEntryAPI- Configure Environment Variables
Create a.envfile in the root directory with the following keys:
MAIL_USERNAME=your_email@example.com
MAIL_PASSWORD=your_email_password
MONGO_USERNAME=your_mongo_username
MONGO_PASSWORD=your_mongo_password
MONGO_CLUSTER_HOST=your_mongo_cluster_host
MONGO_APP_NAME=Cluster1Note: These values will be injected into your Spring Boot application via environment variables.
- Update
application.ymlorapplication-dev.yml
Configure your MongoDB and mail settings using the environment variables:
spring:
data:
mongodb:
uri: mongodb+srv://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_CLUSTER_HOST}/${MONGO_APP_NAME}?retryWrites=true&w=majority
mail:
username: ${MAIL_USERNAME}
password: ${MAIL_PASSWORD}
host: smtp.gmail.com
port: 587
properties:
mail:
smtp:
auth: true
starttls:
enable: true- Build & Run the project
mvn clean install
mvn spring-boot:run- Access API documentation
Swagger UI : http://localhost:8080/swagger-ui/index.html
- Register and log in
- Create, update, and delete personal journal entries
- View and manage profile
- Receive weekly email updates
- All user permissions
- View all journal entries
- Manage user accounts and roles
You must set the following in a .env file before running the project:
MAIL_USERNAME=your_email@example.com
MAIL_PASSWORD=your_email_password
MONGO_USERNAME=your_mongo_username
MONGO_PASSWORD=your_mongo_password
MONGO_CLUSTER_HOST=your_mongo_cluster_host
MONGO_APP_NAME=Cluster1MAIL_USERNAME→ Your email for sending updatesMAIL_PASSWORD→ Email password or App Password (for Gmail)MONGO_USERNAME→ MongoDB Atlas usernameMONGO_PASSWORD→ MongoDB Atlas passwordMONGO_CLUSTER_HOST→ MongoDB cluster host URL (without protocol)MONGO_APP_NAME→ Name of your MongoDB database/cluster
Static Code Analysis – SonarCloud
- Tool: SonarCloud
- Integrated with CI pipeline for quality checks
- Detects code smells, bugs, and vulnerabilities before merge
API Testing – Postman
- Positive and negative test scenarios
- JWT authentication flows validated
- Comprehensive Postman Collection covering all endpoints