Skip to content
Neil Johnson edited this page Nov 9, 2021 · 8 revisions

Set up venv

This Python repo uses venv. To set up venv, go to the repo root directory and enter:

python -m venv ./venv

This command works on Windows, Mac and Linux (although you may need to use python3 for your platform).

Depending on your platform, you'll need to activate your virtual environment.

Windows 10 with PowerShell

In the repo root directory, enter these commands in PowerShell:

cd .\venv\Scripts\
.\Activate.ps1

Setup: Docker

You'll also need to install docker.

Installing Docker in Windows 10

We recommend using chocolately to install the most current version of the Docker Desktop package.

Installing Docker in Linux

Install the latest docker using snap:

sudo snap install docker

Build and Run Your Own Docker Instance

Once you've installed the packages you need using venv, and have docker installed as well, you can run the app locally on port 8080 using the following Bash commands from the project root:

sudo docker build -t versa .
sudo docker run -it --rm --name versa-app -p 8080:8080 versa

Then you can run the browser app to consume the API endpoints defined in it. Currently only POST /party and GET /parties are defined.

To test the API, you can use curl:

curl http://localhost:8080/party
curl http://localhost:8080/parties

Storage is all in-memory at this point, nothing persisted to or read from disk/DB, so for the time being, you'll need to call POST methods to put data in before getting data out.

Clone this wiki locally