Skip to content

Latest commit

 

History

History

backend

Backend

The backend is a Django server that exposes graphql APIs to return data from blockchain and database. The backend is connected with Mongo database.

Please refer to doc for more information about the APIs.

Getting Started

  1. Set up a virtual environment (optional but recommended) More info here and here
cd backend
python -m venv yourEnv
  1. Activate the virtual environment

For Windows:

.\yourEnv\Scripts\activate

For macOS and Linux:

source yourEnv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Modify the .env file with the following information:
ALCHEMY_API_KEY=yourAPIKey

Alchemy is the provider used to connect with a blockchain node, to get a free API key, follow this guide: Alchemy Key

  1. If not already done, run the database as explained in main page and deploy the smart contract as explained in blockchain

  2. Run server

python manage.py runserver

Testing

To run the tests:

python manage.py test