AnchorFlow is a microservices application that manages hierarchical data structures using Neo4j graph database. It provides a robust solution for representing complex relationships between entities in a tree-like structure, with automatic display name management and audit logging.
Key Features:
- Multi-level hierarchical data management
- Automatic display name generation
- Real-time updates via Kafka
- Business logic management with Drools
- Comprehensive audit logging
- GraphQL and REST API support
- Java 17
- Docker Desktop
- Git
- Clone the repository:
git clone https://github.com/avisheku/anchorflow.git
cd anchorflow- Build and run the services:
docker-compose up --build- To stop and remove all containers and volumes:
docker-compose down -v-
Anchor Service (
http://localhost:8080)- GraphQL and REST APIs for data operations
- Interactive API documentation
-
Rule Service (
http://localhost:8081)- Business logic and event processing with Drools and Kafka
- Automatic display name management and audit logging
The system automatically generates display names for entities following these rules:
- Anchor's display name is its name
- Node's display name is
parentDisplayName-nodeName - Leaf's display name is
parentDisplayName-leafName
Example:
- Anchor: "India"
- Node: "India-Maharashtra"
- Leaf: "India-Maharashtra-Mumbai"
- Browser Interface:
http://localhost:7474 - Username: neo4j
- Password: password
- Host: localhost
- Port: 5432
- Database: anchor_db
- Username: postgres
- Password: password
- Interface:
http://localhost:8080/swagger-ui.html
- GraphiQL Interface:
http://localhost:8080/graphiql
{
"name": "Netflix",
"type": "Platform",
"nodes": [
{
"name": "2023",
"type": "Year",
"nodes": [
{
"name": "Action",
"type": "Genre",
"leafs": [
{
"name": "Extraction 2",
"type": "Movie"
},
{
"name": "The Night Agent",
"type": "Movie"
}
]
},
{
"name": "Drama",
"type": "Genre",
"leafs": [
{
"name": "The Diplomat",
"type": "Movie"
}
]
}
]
},
{
"name": "2024",
"type": "Year",
"nodes": [
{
"name": "Sci-Fi",
"type": "Genre",
"leafs": [
{
"name": "3 Body Problem",
"type": "Movie"
}
]
}
]
}
]
}{
"name": "TechNova Inc",
"type": "company",
"description": "A multinational tech company",
"nodes": [
{
"name": "Engineering",
"type": "department",
"description": "Handles product development",
"nodes": [],
"leafs": [
{
"name": "Alice Johnson",
"type": "employee",
"description": "Senior Software Engineer"
},
{
"name": "Bob Singh",
"type": "employee",
"description": "DevOps Engineer"
}
]
},
{
"name": "Marketing",
"type": "department",
"description": "Focuses on market research and brand management",
"nodes": [],
"leafs": [
{
"name": "Clara Fernandez",
"type": "employee",
"description": "Marketing Lead"
},
{
"name": "David Kim",
"type": "employee",
"description": "Content Strategist"
}
]
}
]
}{
"type": "country",
"name": "India",
"displayName": "India",
"nodes": [
{
"type": "state",
"name": "West Bengal",
"displayName": "West Bengal",
"nodes": [
{
"type": "city",
"name": "Kolkata",
"displayName": "Kolkata"
},
{
"type": "city",
"name": "Durgapur",
"displayName": "Durgapur"
}
]
},
{
"type": "state",
"name": "Maharashtra",
"displayName": "Maharashtra",
"nodes": [
{
"type": "city",
"name": "Mumbai",
"displayName": "Mumbai"
},
{
"type": "city",
"name": "Pune",
"displayName": "Pune"
}
]
}
]
}- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request