This project visualizes relationships between user accounts using transaction data and shared attributes in a Neo4j graph database environment. It includes both backend API services and a frontend visualization interface.
- Graph Database: Neo4j for storing user and transaction relationships
- Backend API: RESTful API endpoints for managing users, transactions, and relationships
- Frontend Visualization: Interactive graph visualization using Cytoscape.js
- Relationship Detection: Automatic detection of relationships based on transactions and shared attributes
- Containerized Environment: Containerized application for easy deployment
POST /users: Add or update user informationPOST /transactions: Add or update transaction detailsGET /users: List all usersGET /transactions: List all transactionsGET /relationships/user/:id: Fetch all connections of a userGET /relationships/transaction/:id: Fetch all connections of a transactionGET /analytics/shortestPath: Find the shortest path between two usersGET /analytics/transactionClusters: Find clusters of transactions sharing attributesGET /export/graph: Export the full graph in JSON or CSV
- Docker and Docker Compose
- Git
git clone <repository-url>
cd <repository-directory>docker-compose upThis will:
Build and start the frontend, backend, and Neo4j containers
Automatically seed the database with sample data
Make the services available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Neo4j Browser: http://localhost:7474 (user: neo4j, password: password)
docker-compose downThe project includes automatic database seeding when containers are started. The seed data includes:
- 7 users with shared attributes (e.g., phone, address, payment methods)
- 10 transactions with direct and indirect user links
- Multiple examples of shared attributes used for relationship detection (e.g., phone number, address, device ID, IP)
If you need to manually trigger reseeding:
docker-compose run --rm seedThe system identifies and visualizes the following relationships:
- User-to-User (Shared Attributes): Links based on common emails, phone numbers, addresses, or payment methods.
- User-to-Transaction:
SENT_MONEY: User initiated a transaction.RECEIVED_BY: User received a transaction.
- User-to-User (Transfers):
TRANSFERRED_TO: Direct transfers between users (INCOMING/OUTGOING).
- Transaction-to-Transaction: Links based on shared metadata (e.g., device ID, IP address, behavior patterns).