A web application for visualizing and exploring the Circles Protocol.
Circles is a decentralized protocol designed to create and distribute fair and social money through personal currencies. It creates a new form of money that is distributed equally to all participants as a basic income. The system uses personal currencies and a web of trust to create a money system that is both fair and accessible to everyone.
- Avatar Exploration: View detailed information about avatars (humans, organizations, and groups)
- Trust Network Visualization: Interactive graph visualization of trust relationships
- Transaction History: Explore all transactions and events for any avatar
- Bot Detection: Identify potential bot accounts in the network
- Trust Management: View and analyze trust relationships between avatars
- Comprehensive Statistics: View network-wide statistics and metrics
Circles Explorer follows a domain-driven design (DDD) approach with a clear separation of concerns:
graph TD
subgraph "UI Layer"
UI[Frontend Components]
Pages[Pages]
Shared[Shared Components]
end
subgraph "Coordinators Layer"
PC[Profiles Coordinator]
EC[Events Coordinator]
end
subgraph "Domain Layer"
PD[Profiles Domain]
ED[Events Domain]
TD[Trust Domain]
AD[Avatars Domain]
BD[Bots Domain]
ToD[Tokens Domain]
end
subgraph "Services Layer"
API[API Services]
SDK[Circles SDK]
end
subgraph "State Management"
Store[Zustand Stores]
end
UI --> Pages
Pages --> PC
Pages --> EC
PC --> PD
PC --> BD
PC --> Store
EC --> ED
EC --> PD
PD --> API
ED --> API
TD --> API
AD --> API
BD --> API
ToD --> API
API --> SDK
- Domain Layer: Contains domain-specific logic, repositories, adapters, and types
- Coordinators: Orchestrate data fetching and management across multiple domains
- UI Components: React components for rendering the user interface
- Services: API clients and utilities for external communication
- State Management: Global state stores using Zustand
src/
├── domains/ # Domain layer with domain-specific logic
│ ├── avatars/ # Avatar domain
│ ├── bots/ # Bot detection domain
│ ├── events/ # Events domain
│ ├── profiles/ # Profiles domain
│ ├── tokens/ # Tokens domain
│ └── trust/ # Trust relations domain
├── coordinators/ # Coordinators for orchestrating multiple domains
├── hooks/ # React hooks for UI components
├── pages/ # UI pages
├── shared/ # Shared UI components
├── stores/ # Global state stores
├── services/ # API clients and utilities
├── constants/ # Application constants
├── utils/ # Utility functions
└── types/ # Global type definitions
Each domain contains:
types.ts: Type definitions for the domainadapters.ts: Adapters for transforming data between different formatsrepository.ts: Repository for fetching and managing domain data
Coordinators orchestrate fetching data from multiple domains and manage the data flow between domains. They are responsible for:
- Coordinating data fetching from multiple repositories
- Managing data dependencies between domains
- Providing a unified API for UI components
Available coordinators:
useProfilesCoordinator: Coordinates fetching profile data and bot verdictsuseEventsCoordinator: Coordinates fetching events data and related profiles
- Node.js 22.3.0 or higher
- pnpm (recommended) or npm
-
Clone the repository:
git clone https://github.com/circles/circles-explorer.git cd circles-explorer -
Install dependencies:
pnpm install
-
Create a
.envfile based on.env.example:cp .env.example .env
-
Start the development server:
pnpm dev
The application will be available at http://localhost:5173.
pnpm dev- Start a development server with hot reloadpnpm build- Build for production (output todistfolder)pnpm preview- Locally preview the production buildpnpm test- Run unit and integration tests related to changed filespnpm test:ci- Run all unit and integration tests in CI modepnpm test:e2e- Run all e2e tests with the Cypress Test Runnerpnpm test:e2e:headless- Run all e2e tests headlesslypnpm format- Format all files with Prettierpnpm lint- Run TypeScript, ESLint and Stylelintpnpm validate- Runlint,test:ciandtest:e2e:ci
- UI Components request data through coordinators
- Coordinators orchestrate data fetching from multiple domains
- Domain Repositories fetch data from external services
- Adapters transform data between external and internal formats
- Coordinators update the global state with the fetched data
- UI Components render data from the global state
- React: UI library
- TypeScript: Type-safe JavaScript
- Zustand: State management
- React Query: Data fetching and caching
- Vite: Build tool
- TailwindCSS: Utility-first CSS framework
- NextUI: UI component library
- React Router: Routing
- React Force Graph: Graph visualization
- Viem: Ethereum interaction library
- Circles SDK: SDK for interacting with the Circles Protocol
The application follows a domain-driven design approach with the following principles:
- Bounded Contexts: Each domain represents a bounded context with its own models and logic
- Repositories: Each domain has a repository for data access
- Adapters: Data is transformed between external and internal formats
- Aggregates: Domain objects are grouped into aggregates
- Value Objects: Immutable objects that represent concepts in the domain
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Open a pull request
- Make sure all tests pass before submitting a PR
- Follow the code style guidelines
- Write tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.