Newer
Older
[](https://portal.fachschaft.cl.uni-heidelberg.de)
To run a flask shell inside the container:
sudo docker exec -it portal-app-1 flask shell
```
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
### without docker
```bash
# mkdir yourself into the portal directory
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
export FLASK_APP=portal
alembic upgrade head # to create (and update!) the database
flask run
```
---
#### Wichtig:
Alembic must always be up to date in order to update the database schema.
Please run `alembic upgrade head` after pulling changes from the repository.
---
## How to move around in this repo
## `/portal/`: Main Application
Here are all the important tech-stack related stuff and some Python files for Flask, contained in a cozy space
### `/portal/api/`: API Endpoints (Python)
Here you can find the API endpoints, written in Python
### `/portal/model`: database models (Python)
We use `SQLAlchemy` to interact with the database. The models are defined in this folder.
### `/portal/static`: CSS, JS, images, API documentation
This is giving the frontend some love and, more importantly, its purpose and functionality. The API documentation is also laying around here.
#### `/portal/static/css` (CSS, obviously)
Here you can find the CSS files for the frontend. The main CSS file is `main.css`.
#### `/portal/static/docs`
Here you can find the documentation for the API in its respective versions.
API specifications (`openapi-spec.yaml`) are written in OpenAPI 3.0.0 and are located in the `/api/{version}` folder.
#### `/portal/static/img`: Frag nicht, was für Bilder. Einfach Bilder. I won't translate this.
What did you expect?
#### `/portal/static/js`: JavaScript files
Lol, that should actually .
It contains all the JavaScript files that are responsible for the frontend interactions.
### `/portal/templates`
These are the HTML files that Flask renders. They are written in Jinja2, which is a template engine for Python.
### `.py`-files
+ `__init__.py`: Fortunately, explaining this was not a Prog2 exam question
+ `db_config.py`: [TODO] Have fun, Jakob. Database configuration (arcane magic).
+ `main.py`: The Flask server is in here
+ `problem_details.py`: RFC 7807-compliant problem details responses for the API.