DalgoT4D / DDP_backend

Django app for the DDP platform
GNU Affero General Public License v3.0
9 stars 34 forks source link

DDP_backend

License: AGPL v3 Code coverage badge DeepSource

Django application for the DDP platform's management backend. Exposes API endpoints for the management frontend to communicate with, for the purposes of

Development conventions

Api end points naming

Ninja api docs

Code style

Setting up your vscode env

Running pylint

Running celery

Setup instructions

Step 1: Create a Python Virtual Environment

Step 2: Create the .env file

Step 3: Create SQL Database

docker run --name postgres-db -e POSTGRES_PASSWORD=<password> -p 5432:5432 -d <db name>
DBNAME=<db name>
DBHOST=localhost
DBPORT=5432
DBUSER=postgres
DBPASSWORD=<password>
DBADMINUSER=postgres
DBADMINPASSWORD=<password>

Step 4: Install Airbyte

AIRBYTE_SERVER_HOST=
AIRBYTE_SERVER_PORT=
AIRBYTE_SERVER_APIVER=
AIRBYTE_API_TOKEN= <token> # base64 encryption of username:password. Default username and password is airbyte:password and token will be YWlyYnl0ZTpwYXNzd29yZA==
AIRBYTE_DESTINATION_TYPES=

Step 5: Install Prefect and Start Prefect Proxy

PREFECT_PROXY_API_URL=

Step 6: Create secrets directory

Step 7: Install DBT

pyenv local 3.10

pyenv exec python -m venv <env-name>

source <env-name>/bin/activate

python -m pip install \
  dbt-core \
  dbt-postgres \
  dbt-bigquery
CLIENTDBT_ROOT=
DBT_VENV=<env-name>/bin/activate

Step 8: Add SIGNUPCODE and FRONTEND_URL

Step 9: Start Backend

DJANGOSECRET=

Step 10: Create first org and user

Using Docker

Follow the steps below:

Step 1: Install Docker and Docker Compose

Step 2: Create .env file

Step 3: Create whitelist.py file

Step 4: Build the image

If using M1-based MacBook run this before building image export DOCKER_DEFAULT_PLATFORM=linux/amd64

Step 5: Start the other applications

Step 5: Start Backend