A high-performance Spring Boot API designed to navigate and analyze hierarchical transaction data. This project implements graph traversal logic to classify nodes (Root, Leaf, Orphan) and detect cycles within financial data structures.
- Graph Classification: Automatically identifies Root, Leaf, and "Pseudo-Root" (Orphan) nodes.
- Recursive Discovery: Traverses the graph to a specified
maxDepthto retrieve sub-hierarchies. - Cycle Detection: Implements a Depth-First Search (DFS) algorithm to catch and prevent infinite loops in data.
- Transaction Filtering: Built-in filtering for transaction amounts and types (e.g., SALARY).
- Java 17 / Spring Boot 3.x
- Maven (Build Tool)
- Postman (Automated Testing)
Clone & Run
- git clone https://github.com/vishwajeetkr96-hash/Transaction-Explorer-API.git
- cd transaction-explorer-api
- ./mvnw spring-boot:run
- The API will be available at http://localhost:8080.
I have included a full test suite in the root directory of this repository to simplify the testing process.
- File:
Transaction_Explorer_API.postman_collection.json - How to Import:
- Open Postman.
- Click the Import button in the top-left sidebar.
- Drag and drop the
.jsonfile from your local project folder into the Postman window.
The included Postman collection features Automated Assertion Scripts. Every request is automatically validated for:
- Schema Validation: Ensuring the JSON response matches the expected structure and data types.
- Logic Verification: Confirming that the
isRootandisLeafflags correctly reflect the node's position in the graph. - Error Handling: Verifying that the API returns the correct
400(Bad Request) or404(Not Found) status codes for edge cases.
- Select the Transaction Explorer API v1.0 collection in your Postman sidebar.
- Click the Run button (top right of the collection tab).
- Click Run Transaction Explorer... to execute the full suite.
- Ensure all tests show a green PASSED status.
src/: Application source code containing the Graph traversal logic and Spring Boot configuration.DESIGN.md: Technical breakdown of the DFS logic, Orphan handling, and complexity analysis.Transaction_Explorer_API.postman_collection.json: The full API test suite with automated assertions.
Note: For a deep dive into the algorithm choices and complexity analysis, please refer to the DESIGN.md file.




