This is an open-source web application implementing a polis-like algorithm for mapping high-dimensional opinion spaces.
The web API is written in FastAPI, a web framework for Python. You need to install Python before running the API.
You also need to install Poetry for Python, which is used for dependency management. Find installation instructions at https://python-poetry.org/docs/.
After installing poetry, install the project.
cd server
poetry installAdd an environment file .env in the server directory in the same format as sample.env, but
replace:
DATABASE_URLwith the URL of your Postgres database (e.g.,postgresql://user:password@localhost/dbname)SECRET_KEYwith a random string (you can useopenssl rand -hex 32to generate one)ALLOWED_ORIGINSwith a comma-separated list of allowed origins (e.g.,http://localhost:5173if you use the default Vite port)
To run the API (in auto-reload mode):
poetry run uvicorn chorus.main:app --reloadGo to http://localhost:8000/docs to check if it works: you should see a Swagger page.
To build & run locally via docker compose:
docker-compose build engine
docker-compose up --buildOr, to build the server image using Docker:
cd server
docker build -t chorus.server .To run it on port 8000:
docker run -p 8000:8000 chorus.serverGo to http://localhost:8000/docs to check if it works: you should see a Swagger page.
The frontend requires https://nodejs.org/en to run and is written in Vite.
Installation using Node:
cd client
npm installTo run the frontend (in development mode):
npm run devTo run in storybook mode:
npm run storybookThere is also an online storybook instance at https://choruslabs.github.io/chorus.