The Graph Service is a crucial component of the Gateway suite, enabling easy interaction with DSNP private and public graphs on the Frequency blockchain. This document provides an overview of the service, its architecture, and guides for setup and usage.
- 📖 About the Project
- 🔍 Architecture Overview
- 🔑 Key Features
- 💻 Getting Started
- 🚀 API Documentation
- 🛠 Development
- 🤝 Contributing
- ❓ FAQ
- 📝 License
The Graph Service simplifies the management and interaction with DSNP (Decentralized Social Networking Protocol) private and public graphs on the Frequency blockchain. It provides an easy-to-use interface for fetching, updating, and watching graphs.
The Graph Service is built using NestJS and is divided into two main components:
- API: Handles incoming HTTP requests
- Worker: Processes jobs that require blockchain interaction
- Fetch Graphs: Retrieve social connection data
- Update Graph: Modify social connections
- Watch Graphs: Monitor changes in social graphs
This section will guide you through setting up the Graph Service using either Docker or local development.
Ensure you have the following installed:
-
Clone the repository and navigate to the project directory:
git clone https://github.com/ProjectLibertyLabs/gateway.git cd gateway
-
Install dependencies:
npm install
-
Set up environment variables:
cp env-files/graph.template.env .env
Edit the
.env
file with appropriate values for your environment. -
Start all services using Docker Compose:
docker compose up -d redis frequency graph-service-api graph-service-worker
-
Set up with account data:
make setup-account
If you prefer to run services locally for development:
-
Start Redis and Frequency:
docker compose up -d redis frequency
-
Set up with account data:
make setup-account
-
Start the Graph Service API:
make start-graph-api
-
Start the Graph Service Worker:
make start-graph-worker
- Access Swagger UI: http://localhost:3012/docs/swagger
- View and manage queues: http://localhost:3012/queues
- Access Swagger UI: http://localhost:3000/docs/swagger
- View and manage queues: http://localhost:3000/queues
For more detailed setup instructions, environment variable configuration, and advanced usage, please refer to our comprehensive documentation.
Explore our Live API Documentation for detailed information on endpoints and usage.
This section covers testing, debugging, linting, and information about the technologies used in the Graph Service.
Run E2E tests:
npm run test:e2e:graph
To run the linter:
npm run lint
To automatically fix linting issues:
npm run format
- Framework: NestJS
- Language: TypeScript
- Testing: Jest, Supertest
- Data Store: Redis (ioredis)
- API Documentation: Swagger
- Containerization: Docker, Docker Compose
For a complete list of technologies used, please refer to the Tech Stack section in the full documentation.
We welcome contributions! Please check our Contributing Guidelines and open issues.
Q: What is the difference between Reconnection Service and Graph Service?
The Reconnection Service is designed for providers who have users migrating to DSNP, whereas the Graph Service is for users who are already on DSNP or don't need to migrate pre-DSNP users.
This project is licensed under the Apache 2.0 License.