Skip to content

A microservices-based financial ledger platform built with Spring Boot, Hibernate, and PostgreSQL.

Notifications You must be signed in to change notification settings

ChuloWay/Financial-ledger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Financial Ledger Platform

A microservices-based financial ledger platform built with Spring Boot, Hibernate, and PostgreSQL.

Project Structure

financial-ledger-parent/
├── api-gateway/           # API Gateway service
├── transaction-service/   # Transaction management service
├── docker-compose.yml     # Docker services configuration
└── pom.xml               # Parent Maven configuration

Prerequisites

  • Java 17 or higher
  • Maven 3.6+
  • Docker and Docker Compose
  • VSCode with Java extensions

Required VSCode Extensions

Install the following extensions for optimal development experience:

  1. Extension Pack for Java (vscjava.vscode-java-pack)
  2. Maven for Java (vscjava.vscode-maven)
  3. Spring Boot Dashboard (vscjava.vscode-spring-boot-dashboard)
  4. Spring Initializr (vscjava.vscode-spring-initializr)

Resolving Hibernate Annotations Recognition Issue

If your IDE is not recognizing Hibernate annotations, follow these steps:

1. Install Required Extensions

Make sure you have the Java extensions installed in VSCode:

  • Extension Pack for Java
  • Maven for Java
  • Spring Boot Dashboard

2. Reload VSCode

After installing extensions, reload VSCode:

  • Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)
  • Type "Developer: Reload Window" and press Enter

3. Refresh Maven Project

  • Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  • Type "Maven: Reload Projects" and press Enter
  • Or right-click on pom.xml and select "Reload Projects"

4. Clean and Rebuild

Run the following commands in the terminal:

# From the root directory
mvn clean compile

# Or from individual service directories
cd transaction-service
mvn clean compile

5. Check Java Language Server

  • Open Command Palette
  • Type "Java: Restart Language Server"
  • Wait for the language server to restart

6. Verify Dependencies

Ensure Hibernate dependencies are properly included:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

This includes:

  • hibernate-core
  • jakarta.persistence-api
  • spring-data-jpa

Development Setup

1. Clone and Setup

git clone <repository-url>
cd financial-ledger-parent

2. Build the Project

mvn clean compile

3. Start Services with Docker

docker-compose up -d

4. Run Individual Services

# Transaction Service
cd transaction-service
mvn spring-boot:run

# API Gateway
cd api-gateway
mvn spring-boot:run

Troubleshooting

Hibernate Annotations Still Not Recognized

  1. Check Java Version: Ensure you're using Java 17

    java -version
  2. Clear Maven Cache: Sometimes clearing the Maven cache helps

    mvn dependency:purge-local-repository
  3. Reimport Dependencies: Force reimport of Maven dependencies

    mvn dependency:resolve
  4. Check VSCode Java Settings: Ensure these settings are in .vscode/settings.json:

    {
        "java.configuration.maven.annotationProcessing.enabled": true,
        "java.compile.nullAnalysis.mode": "automatic",
        "java.configuration.updateBuildConfiguration": "automatic"
    }
  5. Restart Java Language Server:

    • Command Palette → "Java: Restart Language Server"

Common Issues

  1. Lombok Not Working: Ensure Lombok is properly configured in pom.xml
  2. Import Issues: Use Cmd+Shift+O (macOS) or Ctrl+Shift+O (Windows/Linux) to organize imports
  3. Build Errors: Check that all dependencies are resolved with mvn dependency:tree

Services

Transaction Service

  • Port: 8081
  • Description: Manages financial transactions
  • Database: PostgreSQL
  • Key Features:
    • CRUD operations for transactions
    • Idempotency support
    • Transaction status management

API Gateway

  • Port: 8080
  • Description: Centralized API gateway
  • Features:
    • Route management
    • Load balancing
    • Security

Database Schema

The transaction service uses the following main entities:

  • Transaction: Core transaction entity with Hibernate annotations
  • TransactionStatus: Enum for transaction states
  • TransactionType: Enum for transaction types

Contributing

  1. Follow the existing code structure
  2. Use Hibernate annotations for entity mapping
  3. Include proper validation annotations
  4. Write unit tests for new features
  5. Follow Spring Boot best practices

License

This project is licensed under the MIT License.

About

A microservices-based financial ledger platform built with Spring Boot, Hibernate, and PostgreSQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published