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
true
the 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 totrue
the 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_MESSAGE_QUEUE_URL |
localhost |
URL of the RabbitMQ message broker used for communication between services. |
BLOCKSEMBLER_MESSAGE_QUEUE_USER |
blocksembler |
Username used to authenticate with the RabbitMQ message broker. |
BLOCKSEMBLER_MESSAGE_QUEUE_PASSWORD |
blocksembler |
Password used to authenticate with the RabbitMQ message broker. |
BLOCKSEMBLER_GRADING_RESPONSE_QUEUE_TTL |
1000*60*15 (15min) |
Time-to-live (TTL) in milliseconds for grading response queues before auto-deletion. |
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