Note: this repository is now archived. Please find this project in active development at https://github.com/choruslabs/chorus
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.
Installation for Windows (instructions are minimally changed for Linux):
cd server
python -m venv venv
venv/Scripts/activate # (in Linux, use source venv/bin/activate)
pip install -r requirements.txtAdd 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):
uvicorn convergent.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 convergent.server .To run it on port 8000:
docker run -p 8000:8000 convergent.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 storybook