kemono2/docs/develop.md
2024-11-26 00:11:49 +01:00

2.0 KiB
Raw Permalink Blame History

Develop

For now Docker is a primary way of working on the repo. However dependencies are still needed to installed locally for the IDE setup.

Requirements:

Python: 3.12+ NodeJS: 18+

Installation

  1. Check if python 3.12 is installed in the system:

    which python 3.12
    

    If no path returned, follow installation instructions

  2. Install virtualenv package if it's not installed.

    pip install --user virtualenv
    
  3. Create a virtual environment:

    virtualenv python=3.12 venv
    
  4. Activate the virtual environment.

    #   Windows ➞ venv\Scripts\activate
    source venv/bin/activate
    
  5. Install python packages.

    pip install --requirement requirements.txt
    
  6. Installpre-commithooks.

    pre-commit install --install-hooks
    

Build

docker-compose build
docker-compose up --detach

In a browser, visithttp://localhost:8000/

Manual

  1. Run the API dev server:

    pytnon -m src web
    
  2. Run frontend dev server:

    python -m src webpack
    

Git

Configure git to store credentials:

git config credential.helper store

After the next time creds are accepted, they will be saved on hard drive as per rules listed in man git-credential-storeand won't be asked again.

Alternatively they can be stored temporarily in memory:

git config credential.helper cache

The creds are stored as per rules in man git-credential-cache.

IDE

IDE specific instructions.

VSCode

  1. Copy.code-workspacefile.

    cp                                              \
        configs/workspace.code-workspace.example    \
        kemono-2.code-workspace
    
  2. Install the recommended extensions.