Skip to content

Harshit-0413/spring-boot-journal-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Journal Application

A backend journal application built using Spring Boot, focused on clean architecture, modern Spring practices, and real-world backend features.

This project allows users to create and manage journal entries, supports authentication and authorization, integrates caching and messaging, and is structured to be production-ready.


🎯 Project Objective

This project was built to practice and demonstrate real-world backend development concepts such as authentication, authorization, asynchronous processing, caching, and clean architecture using Spring Boot and modern backend tools.


🚀 Features

  • User authentication & authorization (Spring Security + JWT)
  • CRUD operations for journal entries
  • Role-based access control (Admin / User)
  • Swagger / OpenAPI documentation
  • Redis caching for performance optimization
  • Kafka-based asynchronous processing for background tasks
  • Email notifications
  • External API integration (Weather API)
  • Multiple environment support (dev / test / prod)

📖 API Documentation (Swagger)

The application provides interactive API documentation using Swagger (OpenAPI).

Swagger UI (Local)

http://localhost:8080/swagger-ui/index.html

Authentication in Swagger

  • Authenticate using JWT
  • Add the token using the Authorize button:
  • Authorization: Bearer <JWT_TOKEN>

Swagger allows testing both public and secured endpoints directly from the browser

🛠 Tech Stack

  • Java 17+
  • Spring Boot (3.x)
  • Spring Security
  • Spring Data MongoDB
  • Redis
  • Apache Kafka
  • Maven
  • JWT
  • Docker (optional)
  • Render (deployment-ready)

🏗 Architecture Overview

  • Layered architecture (Controller, Service, Repository)
  • DTO-based request/response handling
  • Stateless authentication using JWT
  • Asynchronous event processing using Kafka
  • Centralized configuration management

⚙️ Configuration

The application supports multiple environments:

  • application-dev.yml
  • application-test.yml
  • application-prod.yml

Sensitive configuration (credentials, API keys) should be provided using environment variables.


🔐 Environment Variables

Set the following environment variables or create a .env file:

MONGODB_URI=
JWT_SECRET=
REDIS_URL=
EMAIL_USERNAME=
EMAIL_PASSWORD=
WEATHER_API_KEY=
SENDGRID_API_KEY=
  • Email delivery is handled via SendGrid. A valid SENDGRID_API_KEY is required for email notifications to work.

▶️ Running the Application Locally

./mvnw spring-boot:run

Then access:


🚀 Live Deployment

The application is deployed on Render and running in production mode.

🔗 Base URL:
https://spring-boot-journal-app.onrender.com

⚠️ Note: This is a backend-only API. Accessing / directly may return a 404 response. Please use the documented API endpoints via Postman or a frontend client.

Active Environment

  • SPRING_PROFILES_ACTIVE=prod

Deployed Using

  • Docker
  • Render Web Service
  • MongoDB Atlas
  • Redis Cloud
  • SendGrid (Email service)

Health Check

You can verify the service is running via:

GET /public/health-check

Response: ok

About

A Spring based Journal App.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published