Skip to content

Commit

Permalink
add readme, remove printlns, fix pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Haaroon committed Jun 3, 2024
1 parent 13ae52c commit f3a834f
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 180 deletions.
132 changes: 6 additions & 126 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ raphtory-arrow = { version = "0.8.1", path = "raphtory-arrow" }
# raphtory-arrow = { path = "raphtory-arrow-private", package = "raphtory-arrow-private" }
async-graphql = { version = "7.0.5", features = ["dynamic-schema"] }
async-graphql-poem = "7.0.5"
dynamic-graphql = { path = "/Users/haaroony/Documents/dev/dynamic-graphql" }
dynamic-graphql = "0.9.0"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] }
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
Expand Down
108 changes: 108 additions & 0 deletions raphtory-graphql/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@

# Raphtory-GraphQL

## Overview

Raphtory-GraphQL is part of the Raphtory project, an in-memory vectorized graph database designed for high performance and scalability. This module provides GraphQL support for Raphtory, allowing users to interact with their graph data through GraphQL queries.

## Features

- **In-Memory Graph Database:** Offers high-speed data processing and querying capabilities.
- **GraphQL Integration:** Allows seamless integration of graph data with web applications through a GraphQL API.
- **Authentication Support:** Includes options to run the server with authentication, ensuring secure access to the graph data.

## Installation

Clone the repository and navigate to the `raphtory-graphql` directory:
```bash
git clone https://github.com/Pometry/Raphtory.git
cd Raphtory/raphtory-graphql
```

## Configuration

Ensure you have the required environment variables set up. For example, set the `GRAPH_DIRECTORY` environment variable:
```bash
export GRAPH_DIRECTORY=/path/to/your/graph_directory
```

Create a `config.toml` file with your specific configuration settings.

## Running the Server

By default, the server runs without authentication. To run the server, use the following command:
```bash
cargo run
```

This command starts the Raphtory server using `from_directory.run`.

## Running the Server with Authentication (Microsoft)

### Setting up Authentication

To enable authentication for the Raphtory-GraphQL server, you need to set up a `.env` file with specific properties from Microsoft. This file should include the following properties:

- `CLIENT_ID`
- `CLIENT_SECRET`
- `TENANT_ID`
- `AUTHORITY`

#### Steps

1. **Azure Portal Registration:**
- Go to the [Azure Portal](https://portal.azure.com/).
- Navigate to "Azure Active Directory" in the left-hand menu.

2. **Register a New Application:**
- Click on "App registrations" and then "New registration."
- Enter a name for your application.
- Select the supported account types (typically "Accounts in this organizational directory only").
- Click "Register."

3. **Get the Client ID and Tenant ID:**
- After registration, you will be taken to the application's overview page.
- Copy the `Application (client) ID` and `Directory (tenant) ID` values. These are your `CLIENT_ID` and `TENANT_ID`, respectively.

4. **Create a Client Secret:**
- In the left-hand menu, select "Certificates & secrets."
- Click on "New client secret."
- Provide a description and set an expiry period.
- Click "Add."
- Copy the value of the client secret. This is your `CLIENT_SECRET`.

5. **Set the Authority:**
- The `AUTHORITY` is typically in the format `https://login.microsoftonline.com/{TENANT_ID}`.

#### Example .env File

Create a `.env` file in the root directory of your project and add the obtained properties:

```env
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
TENANT_ID=your_tenant_id
AUTHORITY=https://login.microsoftonline.com/your_tenant_id
```

Ensure that this file is included in your `.gitignore` to prevent sensitive information from being exposed.

With these settings configured, your Raphtory-GraphQL server will be able to use Microsoft authentication.

### Running the Auth server

To run the server with authentication, pass the `--server` argument:
```bash
cargo run -- --server
```

This command starts the Raphtory server using `run_with_auth`, which includes authentication mechanisms to secure access.




## Conclusion

Raphtory-GraphQL offers powerful graph data management capabilities with the added benefit of GraphQL integration and optional authentication. By following the steps above, you can set up and run your Raphtory server to manage and query your graph data efficiently.

For more detailed information and examples, you can visit the [Raphtory GitHub repository](https://github.com/Pometry/Raphtory/tree/feature/gql-auth/raphtory-graphql).
Loading

0 comments on commit f3a834f

Please sign in to comment.