$ nvm use 16.14 && node server.js
it will run on https://localhost:3000
<carefull, http"s". not http>
A computational oracle, driven by crowd-workers, clusters the big data generated from Gitcoin's quadratic funding.
Make sure you have the following installed on your system:
- Python
To set up the project for development or testing, run the following command to install dependencies and generate the .env
file: make setup
This command will:
- Generate a
.env
file in the/backend
directory with placeholder values forSCORER_ID
,AUTH_KEY
,ETHERSCAN_API_KEY
,GITCOIN_API_KEY
,ALCHEMY_API_KEY
. (Make sure to replace these placeholder values with your actual credentials before using the backend.)
To run the project, you can use the following command:
$ python3 backend_app/handlers/handlers.py
Please note:
- Before running the backend, make sure you have properly set up the
.env
file with your correct credentials.
This project is licensed under the [License Name] - see the LICENSE file for details.
This documentation provides an overview of the backend API endpoints and their functionalities that are available for integration with the frontend of the web application.
The backend API provides various endpoints to interact with the application's data and services. These endpoints handle user authentication, data retrieval, and data submission. Frontend developers can use these APIs to build the user interface and user interactions.
The base URL for all API endpoints is: /api
Authentication is required for certain API endpoints. The authentication mechanism may involve using JWT (JSON Web Tokens) obtained after successful login. Refer to the frontend authentication logic for details on obtaining and using authentication tokens.
- URL:
/ping
- Method: GET
- Description: A simple endpoint to check the availability of the API server.
- Authentication: Not required.
- Response: JSON response with a "message" field.
- URL:
/signing-message
- Method: GET
- Description: Retrieves a signing message from the Gitcoin Passport API.
- Authentication: Not required.
- Response: JSON response with the "signing_message" field.
- URL:
/submit-passport
- Method: POST
- Description: Submits a passport to the Gitcoin Passport API.
- Authentication: Required (JWT token).
- Request: JSON request body with "address," "signature," and "nonce" fields.
- Response: JSON response with various passport-related information.
- URL:
/get-txs
- Method: GET
- Description: Fetches Ethereum transactions for a specified address.
- Authentication: Not required.
- Query Parameter: "address" (Ethereum wallet address).
- Response: JSON response with Ethereum transaction data.
- URL:
/get-eth
- Method: GET
- Description: Retrieves the Ether balance for a specified Ethereum address.
- Authentication: Not required.
- Query Parameter: "address" (Ethereum wallet address).
- Response: JSON response with the Ether balance.
- URL:
/get-addresses
- Method: GET
- Description: Retrieves a list of Ethereum wallet addresses.
- Authentication: Required (JWT token).
- Query Parameter: "amount" (number of addresses to retrieve).
- Response: JSON response with an array of Ethereum wallet addresses.
- URL:
/insert-data
- Method: POST
- Description: Inserts data into the database.
- Authentication: Required (JWT token).
- Request: JSON request body with data fields.
- Response: JSON response confirming data insertion.
- URL:
/get-passport-score
- Method: GET
- Description: Retrieves the Gitcoin Passport score of the specified address
- Authentication: Not required.
- Query Parameter: "address" (Ethereum wallet address).
- Response: JSON response with the score.
The API returns appropriate HTTP status codes and error messages in case of errors. Frontend developers should handle errors gracefully and display error messages to users when needed.
For specific error responses and their meanings, refer to the API documentation and handle them accordingly in the frontend code.