This is the Blocksembler Backend API powered by FastAPI, designed to handle and store logging events, exercises and automatic grading of exercise submissions.
To get started with the Assembler Programming Learning Environment, follow these steps:
-
Clone the Repository: Clone this repository to your local machine using
git clone https://github.com/Blocksembler/blocksembler-api.git
-
Create and activate a new Virtual Environment: Navigate to the project directory and execute following command
python -m venv .venv source .venv/bin/activate -
Install requirements: Install all python packages required for this application
pip install -r requirements
-
Run the Application: Start the application by running following command:
fastapi run app/main.py --port 8081 --host=0.0.0.0
This will launch the backend locally. In case the DEBUG environment variable is set to
truethe swagger ui can be accessed on http://localhost:8081/docs.
Blocksembler is also available on Docker Hub. To get started, follow these steps:
-
Pull Docker Image: Pull the blocksembler/blocksembler-frontend image
docker pull blocksembler/blocksembler-api:latest -
Run the Container: Start up a new container instance that runs the blocksembler application
docker run blocksembler/blocksembler-api:latest -p 8081:8081 -d. This will launch the application locally. In case the DEBUG environment variable is set totruethe swagger ui can be accessed on http://localhost:8081/docs.
| Name | Default | Description |
|---|---|---|
DEBUG |
True |
Runs the API in debug mode, enabling detailed error logs |
BLOCKSEMBLER_ORIGINS |
* |
Allowed Origins |
BLOCKSEMBLER_API_BASE_URL |
/ |
Base URL path under which this API is served |
| Name | Default | Description |
|---|---|---|
BLOCKSEMBLER_DB_URI |
postgresql+asyncpg://postgres:postgres@localhost:5432/blocksembler |
Host address of the postgres instance (e.g., localhost) |
| Name | Default | Description |
|---|---|---|
BLOCKSEMBLER_MQ_URL |
localhost |
Hostname or URL of the RabbitMQ broker. |
BLOCKSEMBLER_MQ_PORT |
5672 |
Port on which the RabbitMQ broker is listening. |
BLOCKSEMBLER_MQ_USER |
blocksembler |
Username for authenticating with the RabbitMQ broker. |
BLOCKSEMBLER_MQ_PWD |
blocksembler |
Password for authenticating with the RabbitMQ broker. |
BLOCKSEMBLER_MQ_EXCHANGE_NAME |
blocksembler-grading-exchange |
Name of the RabbitMQ exchange used for publishing grading jobs. |
BLOCKSEMBLER_MQ_GRADING_JOB_QUEUE |
grading-jobs |
Name of the RabbitMQ queue that receives grading jobs. |
BLOCKSEMBLER_MQ_GRADING_JOB_ROUTING_KEY |
grading.job.created |
Routing key used to bind the grading job queue to the exchange. |
Contributions to this project are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request.
Florian Wörister | Universität Wien
