gitcoinco / grants-stack-api

GNU Affero General Public License v3.0
13 stars 2 forks source link

Grants Stack API

Requirements

Getting started

Clone the repo

git clone https://github.com/gitcoinco/grants-stack-api.git && cd grants-stack-api

Create .env from the example template.

cp .env.example .env

Configure the .env.

If you have a fresh postgres database, preform a migration to initialize the necessary tables in the database.

diesel migration run

Run the docker-compose.yml

docker compose up

Endpoints

GET /seed/{chain_id}

This endpoint triggers data seeding for the specified chain ID. It accepts a path parameter chain_id, and returns a response indicating whether the seeding was successful or not.

GET /round

This endpoint fetches round data from the database. It accepts a query parameter round_id specifying the round to fetch data for, and optional boolean parameters indicating which pieces of data to include in the response. Multiple parameters can be used at once.

Parameter - Description

GET /project

This endpoint fetches project data from the database. It accepts a query parameter project_id specifying the project to fetch data for, and optional boolean parameters indicating which pieces of data to include in the response. Multiple parameters can be used at once.

Parameter - Description

GET /ipfs

This endpoint relays an IPFS query. It accepts a query parameter cid specifying the content ID to query. The response returns the queried data in JSON format. Caching is not yet implemented.