From 3fae2365bf42c386b268a1ce85d943b27a9ce1f3 Mon Sep 17 00:00:00 2001 From: Ana Custura Date: Mon, 2 Dec 2024 17:38:11 +0000 Subject: [PATCH] docs: add instructions on setting up a development environment --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index de519d4..a190a28 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,49 @@ Development Setup ----------------- For development, it is possible to use SQLite and a single host. -More documentation to follow on this later. + +Create and activate a Python virtual environment: + +``` +python3 -m venv venv +source ./venv/bin/activate +``` + +Install the Python packages needed by the application: + +``` +pip install -r requirements.txt +pip install psycopg2-binary +``` + +Set up the database: + +``` +flask db init +flask db upgrade +``` + +Before the application can be run, it will need to be configured. +Run `cp config.yaml.example config.yaml`, and edit it accordingly. Note that at least one could provider must be configured for the application to run. +To run the application: + +``` +flask run --host=0.0.0.0 --port=5000 +``` + +### New frontend +To use the new portal frontend: + +```bash +git clone https://gitlab.com/guardianproject-ops/bypass-censorship/portal-frontend.git frontend +cd frontend +npm install +npm run build + +mkdir -p ../app/static/ui +cp -r dist/* ../app/static/ui +``` + Copyright ---------