API Give is a project that provide open API for third parties to can work with https://giveth.io (https://github.com/Giveth/impact-graph)
You want to use our API right now?
- Nodejs v16
- Typescript v4.5.2
- DB: postgres v14.2
- DB ORM: TypeORM v0.3.6
- Redis v5.0.9
- API protocol : REST
- Web application: Express v4.17.3
- Deployment: docker-compose v3.3
- API Documentation: Swagger
- Test framework: Mocha v9.2.2
- CI/CD tools : GitHub Actions
git clone [email protected]:Giveth/apiGive.git
cd apiGive
npm ci
- Bringing up database, you can install that in other way, but I suggest
using docker
docker-compose -f docker-compose-local-postgres-redis.ym up -d
- Creat a file named
development.env
based on Env example file and put it in./config
- Run Migrations
npm start
- Now you can browse Swagger
- If you ran migrations successfully then you are able to login in Admin panel username: [email protected] password: 12345
You should have a postgress instance up in order to running tests so you can use Local DB docker-compose
npm run test
In localhost and test we put logs in console and file but in production and staging we just use file for writing logs You can see logs beautifully with this command
npm i -g bunyan
tail -f logs/apiGive.log | bunyan
typeorm migration:create ./migrations/createAccessTokenTable
npm run db:migrate:run:local
npm run db:migrate:revert:local
You can see Entities Diagram to get insight about entities
If you want to use our API in staging ENV, you have to do these steps:
- You can ask us in Discord to create an application for you, and give you the username and secret of your application
- Then you can go to https://staging.apigive.giveth.io/docs/#/Token/GenerateAccessToken and get access token (there is lock icon in right of url section, you should click on that and insert the username and secret that we gave you)
- copy the generated access token and use it in further donations for instance https://staging.apigive.giveth.io/docs/#/Donation/CreateDonation (There is lock icon in right of url section, you should fill it with Bearer {yourAccessToken})
If you are a giveth contributor you can access to admin panel ( for creating application/organizations and viewing logs, ...), so you need to these steps
- Ask us to create a VPN for you in Discord
- Ask us to create an admin user for you, with your email in Discord
- Then you can go to https://staging.apigive.giveth.io/admin (your VPN should be connected otherwise you will get 403 error)
- Login with your email and password ( that you gave use before to create admin user for you)
I used these articles for writing project