Local run

Quickstart (with Docker)

  1. Clone the repo

    git clone git@github.com:NUTtech/Kesha.git
    cd Kesha
    
  2. Build or download the docker image
    for build

    make build
    

    for download

    docker pull nextuptechnologies/kesha:latest
    
  3. Apply migrations and create a superuser:

    make shell
    # inside the container
    python manage.py migrate  # apply migrations
    python manage.py createsuperuser  # create a superuser
    exit  ## leave from the container
    
  4. Start the app and its dependencies

    make runserver
    
  5. You will be able to access the service at http://127.0.0.1:8042/

Start the project for development without Docker

  1. Clone the repo and go to the project directory

    git clone git@github.com:NUTtech/Kesha.git
    cd Kesha
    
  2. Install dependencies

    poetry install
    
  3. Start databases
    You can start databases in any other way

     # start postgres
    docker run \
        --name postgres \
        -d \
        --rm \
        -e POSTGRES_PASSWORD=kesha \
        -e POSTGRES_USER=kesha \
        --network host \
        -v kesha_db:/var/lib/postgresql/data \
        postgres
    
     # start redis
    docker run \
        --name redis \
        -d \
        --rm \
        --network host \
        redis
    
  4. Setting required environment variables

    export KESHA_DB_HOST=127.0.0.1
    export KESHA_SECRET_KEY=NO_SECRET
    export KESHA_CELERY_BROKER_URL=redis://127.0.0.1
    

    Alternatively, you can create a local .env file with the variables

  5. Build static

    poetry run python manage.py collectstatic --no-input
    
  6. Apply database migrations

    poetry run python manage.py migrate
    
  7. Create a django superuser

    poetry run python manage.py createsuperuser
    
  8. Start the django app

    poetry run python manage.py runserver
    
  9. Start the celery worker
    Run in a separate terminal window

    poetry run celery -A kesha worker -l INFO -c 4