Skip to content

Latest commit

 

History

History
177 lines (112 loc) · 4.88 KB

README.md

File metadata and controls

177 lines (112 loc) · 4.88 KB

Graph Service

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.

📗 Table of Contents

📖 About the Project

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.

🔍 Architecture Overview

The Graph Service is built using NestJS and is divided into two main components:

  1. API: Handles incoming HTTP requests
  2. Worker: Processes jobs that require blockchain interaction

Gateway Graph Service Architecture

🔑 Key Features

  • Fetch Graphs: Retrieve social connection data
  • Update Graph: Modify social connections
  • Watch Graphs: Monitor changes in social graphs

💻 Getting Started

This section will guide you through setting up the Graph Service using either Docker or local development.

Prerequisites

Ensure you have the following installed:

Quick Start with Docker

  1. Clone the repository and navigate to the project directory:

    git clone https://github.com/ProjectLibertyLabs/gateway.git
    cd gateway
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    cp env-files/graph.template.env .env

    Edit the .env file with appropriate values for your environment.

  4. Start all services using Docker Compose:

    docker compose up -d redis frequency graph-service-api graph-service-worker
  5. Set up with account data:

    make setup-account

Local Development (without containers)

If you prefer to run services locally for development:

  1. Start Redis and Frequency:

    docker compose up -d redis frequency
  2. Set up with account data:

    make setup-account
  3. Start the Graph Service API:

    make start-graph-api
  4. Start the Graph Service Worker:

    make start-graph-worker

Verification

Docker Setup

Local Development Setup

For more detailed setup instructions, environment variable configuration, and advanced usage, please refer to our comprehensive documentation.

🚀 API Documentation

Explore our Live API Documentation for detailed information on endpoints and usage.

🛠 Development

This section covers testing, debugging, linting, and information about the technologies used in the Graph Service.

Testing

Run E2E tests:

npm run test:e2e:graph

Linting

To run the linter:

npm run lint

To automatically fix linting issues:

npm run format

Built With

  • 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.

🤝 Contributing

We welcome contributions! Please check our Contributing Guidelines and open issues.

❓ FAQ

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.

📝 License

This project is licensed under the Apache 2.0 License.

(back to top)