Skip to content

Developer Information

SelfhostedPro edited this page Sep 16, 2020 · 2 revisions

Setting up

This assumes you're using vscode and will want to use the debugging tools for the backend. If you're not using vscode then skip the launch.json section.

Clone the repository:

git clone https://github.com/SelfhostedPro/Yacht.git

Checkout the vue branch and make a config directory for the db:

cd Yacht
git checkout vue
mkdir config

Install the backend requirements:

cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Install the frontend requirements:

cd ../frontend
npm install

Setup a launch.json (optional)

in the root directory create a .vscode folder and paste the following launch.json:

cd ..
mkdir .vscode
nano launch.json
{
    "configurations": [
        {
            "name": "Python: Module",
            "type": "python",
            "request": "launch",
            "module": "uvicorn",
            "args": [
                "backend.api.main:app",
                "--reload"
            ]
        }
    ]
}

Run everything

Start the backend using the run button in the debugging tab in vscode or manually run it. Then for the frontend run the following from inside the frontend folder:

npm run serve

Script:

Here is an untested script that basically combines everything except for the launch.json stuff:

#!/bin/bash
git clone https://github.com/SelfhostedPro/Yacht.git
cd Yacht
git checkout vue
mkdir config
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd ../frontend
npm install

Then just use the "Run Everything section above