Backend Specs
Technical documentation on how I AM HUMAN backend works
Last updated
Technical documentation on how I AM HUMAN backend works
Last updated
The backend for the I-am-human app is built using Node.js deployed to Google Cloud using Firebase-admin and connects to a database.
Link to our source code on GitHub .
API Endpoints
There are 4 endpoints which are pretty much self explanatory : POST /api/select , api/insert , api/delete , api/update
This API helps to retrieve and update the supabase database.
Request Body
/api/insert :
/api/select :
/api/update :
/api/delete :
Response: The API will respond with the data and any error if there is:
Endpoint: POST /api/is-admin
Request body:
Response: The API will respond with a boolean value indicating whether the user with the specified ID is a superadmin or not.
Endpoint: GET /scoreboard
Checkout scoreboard
branch to run the code
This API helps users to fetch data of humans onboarded using a particular community name and vertical.
Query Param: communityName, communityVertical
: Mention the name or vertical of the community you want to receive data.
Response: The API will respond with an object containing data
which is an array of objects and error
which is a string of error message in case any error occurs.
To help non technical users, we have made our scoreboard API open for community usage, following is the curl you can use to fetch data of humans onboarded using communityName=marketingdao
and communityVertical=infrastructure
To install and set up the backend for the I-am-human app, follow these steps:
Clone the repository from GitHub.
Install the required dependencies using NPM.
Set up environment variables by creating a .env
file in the root directory with the Supabase URL and key.
Start the server.
The backend for the I-am-human app uses the following dependencies:
@supabase/supabase-js
: A JavaScript client for interacting with the Supabase API
body-parser
: A middleware for parsing request bodies
cors
: A middleware for enabling CORS
express
: A NODE JS backend server library
firebase-admin and firebase-functions: Used to host the APP on the firebase cloud functions