Native Platforms (Developer)

Installation

We introduce how to install optinist for developer. We have developed optinist python(backend) and typescript(frontend), so you need to make both environment. Please follow instructions below.

1. Make backend environment

Install Tools

Follow the steps in the Install Tools section for each platform below.

  • Unix-like platforms

  • Other platforms

    • Windows Native

      1. Install Tools

      2. Install Unix commands

        • Commands included in “Git for Windows” are available

        • Add {Git for Windows installation path}\usr\bin to the Windows environment variable “PATH”

Install Node.js

  • Node.js Official

    • Get node with v20

  • You can also install node via nvm.

    • Recommended for unix-like platforms.

After install node, install yarn.

npm install -g yarn

Create Conda Environment

conda create -n optinist_dev python=3.9 poetry
conda activate optinist_dev

Clone Repository

git clone https://github.com/oist/optinist.git

setup application config files

cd ./optinist
cp studio/config/.env.example studio/config/.env
cp frontend/.env.example frontend/.env

Install Requirements

poetry install --no-root --with dev

Set Saving Directory

Optinist default saving directory is /tmp/studio. If you reboot your PC, this repogitory content is deleted. And setting the saving directory in environment path.

export OPTINIST_DIR="your_saving_dir"

2. Run Backend

python main.py
  • python main.py log is as blow:

$ run_optinist
INFO:     Will watch for changes in these directories: ['/home/oist/optinist']
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [xxxx] using statreload
INFO:     Started server process [xxxx]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
  • If you won’t develop the frontend code, launch browser and go to http://localhost:8000

3. Run Frontend

Open new terminal window, and go to frontend directory.

# from optinist root directory
cd frontend

Then install packages and run.

yarn install
yarn start
  • Launch browser, and go to http://localhost:3000

Done!

Note

  • By default, frontend in development environment uses port 3000, while production optinist uses 8000.

  • See: optinist startup options

  • If you will make PRs, please see the For Developers section.