Skip to content

Archit-d300/Journal-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Journal App 📓

A secure RESTful Journal Application built using Spring Boot, MongoDB, and Spring Security. The application enables users to create, manage, and organize personal journal entries while providing role-based access control, weather integration, caching, scheduled tasks, and email notifications.

🚀 Features

User Features

  • User Registration & Authentication
  • Create Journal Entries
  • View All Personal Journal Entries
  • Update Existing Journal Entries
  • Delete Journal Entries
  • Update User Profile
  • Delete Account

Security

  • Spring Security Authentication
  • Role-Based Access Control
  • Protected User Endpoints
  • Admin-Only Operations

Admin Features

  • View All Users
  • Create Admin Users
  • Clear Application Cache

Additional Features

  • MongoDB Database Integration
  • Redis Caching Support
  • Weather API Integration
  • Scheduled Tasks using Spring Scheduler
  • Email Notification Service
  • Custom Repository Implementations

🛠️ Tech Stack

Technology Purpose
Java 8 Programming Language
Spring Boot 2.7 Backend Framework
Spring Security Authentication & Authorization
Spring Data MongoDB Database Layer
MongoDB NoSQL Database
Redis Caching
Spring Mail Email Service
Maven Dependency Management
Lombok Boilerplate Reduction

📂 Project Structure

journalApp/
├── controller/
│   ├── PublicController
│   ├── UserController
│   ├── JournalEntryController
│   └── AdminController
│
├── service/
│   ├── UserService
│   ├── JournalEntryService
│   ├── WeatherService
│   └── EmailService
│
├── repository/
│   ├── UserRepository
│   ├── JournalEntryRepository
│   └── ConfigJournalAppRepository
│
├── entity/
│   ├── User
│   ├── JournalEntry
│   └── ConfigJournalAppEntity
│
├── scheduler/
│   └── UserScheduler
│
├── cache/
│   └── AppCache
│
└── config/
    └── SpringSecurity

⚙️ Installation & Setup

Prerequisites

  • Java 8+
  • Maven 3+
  • MongoDB
  • Redis (Optional)
  • SMTP Email Account (Optional)

Clone Repository

git clone https://github.com/Archit-d300/Journal-App.git

cd Journal-App/journalApp

Configure Application

Update your application.yml or application.properties:

spring:
  data:
    mongodb:
      uri: mongodb://localhost:27017/journaldb

  mail:
    host: smtp.gmail.com
    port: 587
    username: your-email
    password: your-password

Configure Redis if enabled:

spring:
  redis:
    host: localhost
    port: 6379

▶️ Run the Application

Using Maven:

mvn spring-boot:run

Or:

mvn clean install

java -jar target/journalApp-0.0.1-SNAPSHOT.jar

Application starts at:

http://localhost:8080

🔑 API Endpoints

Public APIs

Method Endpoint Description
GET /public/healthCheck Application Health Check
POST /public/create-user Register New User

User APIs

Method Endpoint
GET /user
PUT /user
DELETE /user

Journal APIs

Method Endpoint
GET /journal
POST /journal
GET /journal/id/{id}
PUT /journal/id/{id}
DELETE /journal/id/{id}

Admin APIs

Method Endpoint
GET /admin/all-users
POST /admin/create-admin-user
GET /admin/clear-app-cache

⏰ Scheduled Jobs

The application includes scheduled tasks for:

  • Refreshing application cache
  • Processing user sentiment summaries
  • Sending automated email notifications

Current scheduler:

@Scheduled(cron = "0 0 9 * * SUN")

Runs every Sunday at 9:00 AM.


🌤 Weather Integration

The application fetches weather information using an external Weather API and displays personalized greetings to authenticated users.

Example:

Hi John, Weather Today: Weather feels like 31°C

📧 Email Notifications

Email services are used to:

  • Send sentiment analysis summaries
  • Deliver scheduled notifications
  • Support future user engagement features

🧪 Running Tests

mvn test

Tests cover:

  • User Service
  • User Details Service
  • Email Service
  • Repository Layer

🔒 Security

Implemented using Spring Security:

  • Authentication
  • Password Encoding
  • Protected Routes
  • Admin/User Roles
  • Secure API Access

📈 Future Enhancements

  • JWT Authentication
  • Swagger/OpenAPI Documentation
  • Docker Support
  • Kubernetes Deployment
  • Full Sentiment Analysis using NLP
  • Frontend Dashboard
  • Mobile Application
  • Entry Search & Filtering
  • File Attachments
  • End-to-End Encryption

👨‍💻 Author

Archit Deshpande


📄 License

This project is licensed under the MIT License.

Feel free to fork, improve, and contribute.

About

Secure Journal Management System built with Spring Boot, MongoDB, Spring Security, Redis caching, weather integration, and scalable REST APIs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages