Verified Commit c67436a2 authored by Jakob Moser's avatar Jakob Moser
Browse files

Move architecture details into architecture file

parent 7c5efa91
Loading
Loading
Loading
Loading

docs/architecture.md

0 → 100644
+47 −0
Original line number Diff line number Diff line
# Portal Architecture

## `/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

It contains all the JavaScript files that are responsible for the frontend interactions.

See the [Frontend](./frontend.md) documentation for more details.

### `/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.
+1 −60
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ sudo docker exec -it portal-app-1 flask shell

### ...without docker

# Make sure you are in the `portal` directory
Make sure you are in the `portal` directory

```bash
# mkdir yourself into the portal directory
@@ -82,62 +82,3 @@ 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.

---

## Compliance

### Formatting

We use [black](https://github.com/psf/black) as formatting tool.
Use `black .` to run the formatter.

### Static Type Checking

Run `mypy .` to let [mypy](https://www.mypy-lang.org/) validate the Python types.

## 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 ![have its own README](./JS-README.md).

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.