Skip to content

A service to analyze and calculate the average winrate percentage of teams based on the selected dota 2 roster and heroes.

License

Notifications You must be signed in to change notification settings

Segfaul/dotaverse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f738c70 Â· Jun 24, 2024

History

45 Commits
May 30, 2024
Jun 23, 2024
Jun 24, 2024
May 30, 2024
May 30, 2024
May 30, 2024
Jun 8, 2024
May 31, 2024
May 31, 2024
Jun 2, 2024
Jun 2, 2024

Repository files navigation

Dotaverse

Dotaverse is a free web service for predicting Dota 2 pro match results based on open stats.


Project Status

Completed v0.0.1 âś“


Functionality

Technologies and Frameworks


Development

  1. Clone the repository to the local machine

    git clone https://github.com/Segfaul/dotaverse.git
  2. Specify .env (DEBUG=False to use PostgreSQL, SECRET_KEY for JWT AUTH)

    # Global .env (DEBUG, SECRET_KEY)
    cp .env.example .env
    nano .env
    
    # Frontend .env (GA_KEY, BACKEND_URL)
    cp frontend/.env.example frontend/.env
    nano frontend/.env
  3. Build images and run app in dev mode

    docker compose -f docker-compose.dev.yml up -d --build
  4. Checkout http://127.0.0.1:3000 (Vite), http://127.0.0.1:8000 (Uvicorn)

    # Also add new admin user to your app
    docker exec -it dotaverse_app_dev-backend-1 bash
    python -m backend.config.admin --username admin --password password
    Admin ${username} created successfully.
    exit
  5. Stop/Down the app

    # Without removing containers
    docker compose -f docker-compose.dev.yml stop
    
    # Removing containers
    docker compose -f docker-compose.dev.yml down
    
    # Removing containers and docker volumes (not local ones)
    docker compose -f docker-compose.dev.yml down -v

Production

  1. Specify .env

    # Force to use PostgreSQL
    DEBUG=False
    ...
    # Specify proxy to run background tasks for parsing data
    PROXY='http://login:paswword@ip:port'
    ...
    # Specify postgres db_name and db_password
    POSTGRES_DB='dotaverse'
    POSTGRES_USER='postgres'
    POSTGRES_PASSWORD='password'
    POSTGRES_HOST='127.0.0.1'
    POSTGRES_PORT=5432
    ...
    # Specify origins & server params for your own domain
    ALLOWED_ORIGINS='http://localhost:3000,http://127.0.0.1:3000'
    SERVER_NAME=localhost.localdomain
    SERVER_EMAIL=example@example.com
  2. Specify nginx.conf

    # Nginx root for ssl_certificate doesn't support .env variables
    nano nginx/nginx.conf
    
    # Specify those roots strictly with your server_name
    ssl_certificate /etc/letsencrypt/live/${SERVER_NAME}/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/${SERVER_NAME}/privkey.pem;
    
    # Example
    ssl_certificate /etc/letsencrypt/live/lhost.ldomain/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/lhost.ldomain/privkey.pem;
  3. Build images and run app in prod mode

    docker compose -f docker-compose.prod.yml up -d --build
  4. Open ${SERVER_NAME} in your browser

    # In case of any issues also checkout logs
    cat logs-data/dotaverse.log | tail -15
  5. Stop/Down the app

    # Without removing containers
    docker compose -f docker-compose.dev.yml stop
    
    # Removing containers
    docker compose -f docker-compose.dev.yml down
    
    # Removing containers and docker volumes (not local ones)
    docker compose -f docker-compose.dev.yml down -v