Skip to content
/ api.grants Public template
forked from NEARFoundation/api.grants

Easy to set up end to end grant application form for DAOs on NEAR Protocol

License

Notifications You must be signed in to change notification settings

Multi-DAO/api.grants

 
 

Repository files navigation

api.grants NEAR License: GPL v3

Easy to set up end to end grant application form for DAOs on NEAR Protocol

Repositories

Technology stack

Guides

Configuration

cp .env.dist .env
# 1. set up variables on .env
# 2. update the template in templates/agreement.docx
# 3. replace the logo in `assets`

Special routes for admin

These special routes should be moved to the admin panel with a better security. They are protected by a secret URL using ADMIN_TOKEN and basic auth using ADMIN_LOGIN and ADMIN_PASSWORD

Invoice downloading

Use this route to download the invoice

  • Route: /admin/:adminToken/accounts/:nearId/grants/:id/invoices/:invoiceId
    • adminToken: ADMIN_TOKEN from the env variable to authorize the request
    • nearId: The near account id of the grant user
    • id: The grant id that can be found in the database
    • invoiceId: The invoice id (0 for the first payment, 1 for milestone 1, ...)
  • Example: /admin/TdgB349TfjpUnOqQMIIMOQoPf2kU/accounts/sound.testnet/grants/6/invoices/0

Agreement signature

This route has been created as a workaround because it seems like the hellosign API doesn't allow to have one signer using the embedded widget and the other using the hello sign website; more info here: NEARFoundation#22 (comment)

  • Route: /admin/:adminToken/accounts/:nearId/grants/:id/agreement/signature
    • adminToken: ADMIN_TOKEN from the env variable to authorize the request
    • nearId: The near account id of the grant user
    • id: The grant id that can be found in the database
  • Example: /admin/TdgB349TfjpUnOqQMIIMOQoPf2kU/accounts/sound.testnet/grants/6/agreement/signature

Installation

npm install

Set up .env

Development

# run mongodb
npm run dev

Open http://localhost:4000 with your browser to see the result.

Deployment

npm install
npm start

Testing

No tests are implemented yet.

Authors

About

Easy to set up end to end grant application form for DAOs on NEAR Protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Dockerfile 0.2%