docs: add instructions on setting up a development environment

This commit is contained in:
Ana Custura 2024-12-02 17:38:11 +00:00 committed by irl
parent 33243b77ba
commit 3fae2365bf

View file

@ -12,7 +12,49 @@ Development Setup
----------------- -----------------
For development, it is possible to use SQLite and a single host. 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 Copyright
--------- ---------