I also recommend using the Powershell Preview for use in Visual Studio Code on Windows.
In order to work with JWT authentication, we must generate an RSA key pair. This can be accomplished using OpenSSL:
openssl genpkey -algorithm RSA -out private.pem -aes-256-cbc -pass pass:password123
openssl rsa -in private.pem -pubout -out public.pem
Poetry is a project/package manager for Python-based projects. It is used heavily in this project to manage dependencies and to run the project's server.
To install Poetry, feel free to follow along with installation section in the documentation. I personally used the unsuggested method of installing with pip on my Windows system.
Using Poetry, the only setup requires is running poetry install
. From
there, you can use poetry shell
to open a shell in the virtual environment
or poetry run
to run with the virtual environment.
To run the development server:
poetry run python -m agora_backend dev
Assuming you have set up the agora
database and it is running, the backend
server should start on port 8080.
Running the test requires setting up another database named agora_testing
using the same steps used for the development database. Afterwards, run the
following command (on Windows):
poetry run pytest .\tests
On Windows:
pg_dump -sO -U postgres agora | Out-File -FilePath .\create_schema.sql
pg_dump -a -U postgres agora | Out-File -FilePath .\create_data.sql
On GNU/Linux:
pg_dump -sO -U postgres agora > create_schema.sql
pg_dump -a -U postgres agora > create_data.sql