Skip to content

gitcoinco/impact-metrics

Repository files navigation

Impact Metrics CSV Upload Manager

Setup

Run npm install to install dependencies.

Development

To run the development server:

  • create a .env file in the root directory based on .env.example
  • run npm run dev

The API can be accessed at https://impact-metrics.vercel.app/api or locally at http://localhost:3000/api.

CSV Data

There is one fake CSV data round in the database with id 09445988-cd06-4a90-9c3a-0766650a933f.

To query the fake CSV data round, run:

curl https://impact-metrics.vercel.app/api/csv/rounds?roundId=09445988-cd06-4a90-9c3a-0766650a933f

To query all snapshots for the fake CSV data round, run:

curl https://impact-metrics.vercel.app/api/csv/snapshots?roundId=09445988-cd06-4a90-9c3a-0766650a933f

Note: The allSnapshotData field is a list of all snapshots for the round, one per project, while snapshots is a list of unique snapshots for the round, one per project and snapshot time.

Test Data

There is one test round in the database with id 9921615e-7edd-4569-9b3f-785dcc3aac5e.

To query the test round and project data, run:

# querying with roundId returns the round and project data
curl https://impact-metrics.vercel.app/api/oso/rounds?roundId=9921615e-7edd-4569-9b3f-785dcc3aac5e

To query all rounds, run:

# querying without roundId returns all rounds, but no specific project data
curl https://impact-metrics.vercel.app/api/oso/rounds

To query snapshots for the test round, run:

curl https://impact-metrics.vercel.app/api/oso/snapshots?roundId=9921615e-7edd-4569-9b3f-785dcc3aac5e

To query snapshots with pagination, run:

# the limit refers to the number of individual snapshots returned, one per project and snapshot time
curl https://impact-metrics.vercel.app/api/oso/snapshots?roundId=9921615e-7edd-4569-9b3f-785dcc3aac5e&page=1&limit=100

TODO

  • add auth on cron route
  • figure out how to add dynamic GraphQL API for metrics data

About

impact metrics CSV upload app (for now)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors