The official skills microservice of Bootstrap Academy.
If you would like to submit a bug report or feature request, or are looking for general information about the project or the publicly available instances, please refer to the Bootstrap-Academy repository.
- Install Python 3.11, Poetry and poethepoet.
- Clone this repository and
cdinto it. - Run
poe setupto install the dependencies. - Start a PostgreSQL database, for example using Docker or Podman:
podman run -d --rm \ --name postgres \ -p 127.0.0.1:5432:5432 \ -e POSTGRES_HOST_AUTH_METHOD=trust \ postgres:alpine - Create the
academy-skillsdatabase:podman exec postgres \ psql -U postgres \ -c 'create database "academy-skills"'
- Start a Redis instance, for example using Docker or Podman:
podman run -d --rm \ --name redis \ -p 127.0.0.1:6379:6379 \ redis:alpine - Run
poe migrateto run the database migrations. - Run
poe apito start the microservice. You can find the automatically generated swagger documentation on http://localhost:8001/docs.
poe setup # setup dependencies, .env file and pre-commit hook
poe api # start api locally
poe test # run unit tests
poe pre-commit # run pre-commit checks
poe lint # run linter
poe format # run auto formatter
poe isort # sort imports
poe black # reformat code
poe ruff # check code style
poe mypy # check typing
poe flake8 # check code style
poe coverage # run unit tests with coverage
poe alembic # use alembic to manage database migrations
poe migrate # run database migrations
poe env # show settings from .env file
poe jwt # generate a jwt with the given payload and ttl in seconds
poe check # check course definitions
poe sync_skills # push local skills to backend (deprecated)Configure the Python interpreter:
- Open PyCharm and go to
Settings➔Project➔Python Interpreter - Open the menu
Python Interpreterand click onShow All... - Click on the plus symbol
- Click on
Poetry Environment - Select
Existing environment(setup the environment first by runningpoe setup) - Confirm with
OK
Setup the run configuration:
- Click on
Add Configuration...➔Add new...➔Python - Change target from
Script pathtoModule nameand choose theapimodule - Change the working directory to root path ➔
Edit Configurations➔Working directory - In the
EnvFiletab add your.envfile - Confirm with
OK