Skip to content

Sanket17052006/Journal-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Journal App

A secure, end-to-end encrypted journal application built with Spring Boot, MongoDB and features JWT-based authentication.

Features

  • JWT-based authentication
  • CRUD operations for journal entries
  • User management
  • MongoDB integration
  • RESTful API

Technology Stack

  • Backend: Spring Boot 2.7.15
  • Database: MongoDB
  • Authentication: JWT (JSON Web Tokens)
  • Security: Spring Security
  • Build Tool: Maven

API Endpoints

Authentication

  • POST /authenticate/login - User login
  • POST /authenticate/register - User registration

Journal Entries (Authenticated)

  • GET /journal - Get all journal entries for current user
  • POST /journal - Create new journal entry
  • GET /journal/id/{id} - Get specific journal entry
  • PUT /journal/id/{id} - Update journal entry
  • DELETE /journal/id/{id} - Delete journal entry

User Management (Authenticated)

  • GET /user - Get all users (Admin only)
  • PUT /user - Update current user
  • DELETE /user - Delete current user

Quick Start

Prerequisites

  • Java 17
  • Maven 3.6+
  • MongoDB (or use MongoDB Atlas)

Running Locally

  1. Clone the repository:
git clone <repository-url>
cd Journal-App
  1. Update MongoDB connection in application.properties:
spring.data.mongodb.uri=your-mongodb-uri
spring.data.mongodb.database=journaldb
  1. Build and run:
mvn clean install
mvn spring-boot:run

The application will be available at http://localhost:8080

Usage Examples

Register a new user:

curl -X POST http://localhost:8080/authenticate/register \
  -H "Content-Type: application/json" \
  -d '{"username":"testuser","password":"password123"}'

Login:

curl -X POST http://localhost:8080/authenticate/login \
  -H "Content-Type: application/json" \
  -d '{"username":"testuser","password":"password123"}'

Create journal entry (with JWT token):

curl -X POST http://localhost:8080/journal \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"title":"My Day","content":"Today was a great day!"}'

Environment Variables

  • SPRING_DATA_MONGODB_URI - MongoDB connection string
  • SPRING_DATA_MONGODB_DATABASE - Database name
  • JWT_SECRET - JWT secret key (optional, uses default if not set)
  • JWT_EXPIRATION - JWT token expiration time in milliseconds

Security Features

  • Password encryption using BCrypt
  • JWT-based stateless authentication
  • CORS support
  • Input validation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License.

About

A personal journal application with a RESTful API backend. Built with Java and the Spring Boot framework, and integrated a NoSQL database (MongoDB) for data persistence. This project demonstrates modern backend development practices.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages