Updated docs
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Dominic Grimm 2022-02-17 15:38:33 +01:00
parent 32da4f2e66
commit 3a4e7a5b25
13 changed files with 161 additions and 47 deletions

View file

@ -25,3 +25,5 @@ title = "Mentorenwahl"
git-repository-url = "https://git.dergrimm.net/mentorenwahl/mentorenwahl"
git-repository-icon = "fa-code-fork"
no-section-label = true
[preprocessor.plantuml]

View file

@ -1,6 +1,9 @@
# Summary
- [Installation](./installation/README.md)
- [Clone the repository](./installation/clone.md)
- [Build the containers](./installation/build.md)
- [Installation](./installation.md)
- [Configuration](./configuration.md)
- [Stack](./stack/README.md)
- [Backend](./stack/backend.md)
- [Frontend](./stack/frontend.md)
- [API](./api/README.md)
- [Development](./development/README.md)

1
docs/src/api/README.md Normal file
View file

@ -0,0 +1 @@
# API

View file

@ -0,0 +1 @@
# Configuration

40
docs/src/installation.md Normal file
View file

@ -0,0 +1,40 @@
# Installation
## Prerequisites
To install the docker-compose app,
you will need to have the following dependencies installed:
- [Git](https://git-scm.com/)
- [GNU Make](https://www.gnu.org/software/make/)
- [MdBook](https://github.com/rust-lang/mdBook)
- [Docker](https://www.docker.com/products/overview)
- [Docker Compose](https://docs.docker.com/compose/install/)
## Clone the repository
For building the containers from scratch, the repository's packages are required.
```bash
git clone https://git.dergrimm.net/mentorenwahl/mentorenwahl.git
cd mentorenwahl/
```
After that you will need to create an environment configuration file.
```bash
cp .example.env .env
```
## Build the containers
Building the project is as simple as invoking the `make` command
according to following options:
```bash
# Production build
make prod
# Development build
make dev
```

View file

@ -1,10 +0,0 @@
# Installation
To install the docker-compose app,
you will need to have the following dependencies installed:
- [Git](https://git-scm.com/)
- [GNU Make](https://www.gnu.org/software/make/)
- [MdBook](https://github.com/rust-lang/mdBook)
- [Docker](https://www.docker.com/products/overview)
- [Docker Compose](https://docs.docker.com/compose/install/)

View file

@ -1,20 +0,0 @@
# Build the containers
Building the project is as simple as invoking the `make` command
according to following options:
```bash
# All: documentation + production build
make
# Documentation
make docs
# Production build
make prod
# -----
# Development build
make dev
```

View file

@ -1,14 +0,0 @@
# Clone the repository
For building the containers from scratch, the repository's packages are required.
```bash
git clone https://git.dergrimm.net/mentorenwahl/mentorenwahl.git
cd mentorenwahl/
```
After that you will need to create an environment configuration file.
```bash
cp .example.env .env
```

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="528px" preserveAspectRatio="none" style="width:653px;height:528px;background:#FFFFFF;" version="1.1" viewBox="0 0 653 528" width="653px" zoomAndPan="magnify"><defs><filter height="300%" id="f1jbg0kb33thgd" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--MD5=[4947a6a0a9f8e7a5f793e72a2d6cfab0]
class MicrateDbVersion--><rect codeLine="2" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="100.7996" id="MicrateDbVersion" style="stroke:#A80036;stroke-width:1.5;" width="130" x="7" y="7"/><ellipse cx="22" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M17,24.1563 C17,26.6563 19.1406,28.4688 22.0625,28.4688 C23.2969,28.4688 24.4688,28.1719 25.2188,27.6563 C25.8281,27.2344 26.1563,26.8125 26.1563,26.4063 C26.1563,25.9375 25.7344,25.5313 25.2344,25.5313 C25,25.5313 24.7813,25.6094 24.5781,25.8125 C24.1406,26.25 24.1406,26.25 23.9688,26.3438 C23.5156,26.5781 22.875,26.7188 22.1094,26.7188 C20.1094,26.7188 18.8281,25.7031 18.8281,24.125 L18.8281,23.0781 C18.8281,21.375 20.0469,20.1719 21.75,20.1719 C22.3281,20.1719 22.9063,20.3125 23.375,20.5625 C23.8438,20.8281 24.0156,21.0156 24.0781,21.375 C24.2031,22.0469 24.4531,22.2969 24.9844,22.2969 C25.2656,22.2969 25.5469,22.1563 25.7344,21.9375 C25.8594,21.7656 25.9063,21.5938 25.9063,21.1563 L25.9063,19.7969 C25.9063,19.375 25.8906,19.2344 25.7656,19.0625 C25.5938,18.8125 25.3125,18.6563 24.9844,18.6563 C24.6719,18.6563 24.4688,18.7656 24.25,19.0313 C23.0781,18.5313 22.6406,18.4219 21.6875,18.4219 C19.0156,18.4219 17,20.4375 17,23.0625 L17,24.1563 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="98" x="36" y="26.948">MicrateDbVersion</text><line style="stroke:#A80036;stroke-width:1.5;" x1="8" x2="136" y1="39" y2="39"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="13" y="53.2189">id : Int32</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="83" x="13" y="66.4188">version_id : Int64</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="78" x="13" y="79.6187">is_applied : Bool</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="72" x="13" y="92.8186">tstamp : Time?</text><line style="stroke:#A80036;stroke-width:1.5;" x1="8" x2="136" y1="99.7996" y2="99.7996"/><!--MD5=[45d42ff7800d812d5f83c7d3273eb427]
class UserRole--><rect codeLine="9" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="74.3998" id="UserRole" style="stroke:#A80036;stroke-width:1.5;" width="84" x="67" y="169"/><ellipse cx="82" cy="185" fill="#EB937F" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M80.8594,186.0625 L82.1719,186.0625 L82.1719,186.1094 C82.1719,186.5156 82.1875,186.6719 82.2969,186.8281 C82.4688,187.0781 82.7656,187.25 83.0781,187.25 C83.3594,187.25 83.6563,187.1094 83.8281,186.8906 C83.9531,186.7031 84,186.5625 84,186.1094 L84,184.2656 C84,183.9375 83.9844,183.8281 83.9219,183.6563 C83.8125,183.3594 83.4531,183.1094 83.0781,183.1094 C82.7813,183.1094 82.5156,183.25 82.3438,183.4688 C82.2031,183.6563 82.1719,183.8281 82.1719,184.2656 L82.1719,184.3281 L80.8594,184.3281 L80.8594,182.1563 L84.7031,182.1563 L84.7031,182.9063 C84.7031,183.2969 84.7344,183.4844 84.8438,183.6406 C85.0156,183.8906 85.3125,184.0625 85.625,184.0625 C85.9219,184.0625 86.1875,183.9375 86.375,183.7031 C86.5156,183.5156 86.5469,183.375 86.5469,182.9063 L86.5469,180.4063 L78.8438,180.4063 C78.3906,180.4063 78.2656,180.4219 78.0938,180.5313 C77.8281,180.7031 77.6563,180.9688 77.6563,181.2813 C77.6563,181.5625 77.7813,181.8281 78.0313,182 C78.2188,182.125 78.4063,182.1563 78.8438,182.1563 L79.0313,182.1563 L79.0313,188.25 L78.8438,188.25 C78.4219,188.25 78.2656,188.2813 78.0938,188.375 C77.8281,188.5313 77.6563,188.8125 77.6563,189.1094 C77.6563,189.6875 78.0625,190 78.8438,190 L86.9219,190 L86.9219,187.4688 C86.9219,187.0625 86.8906,186.8906 86.7813,186.7344 C86.6094,186.4688 86.3281,186.3125 86,186.3125 C85.7188,186.3125 85.4375,186.4531 85.25,186.6719 C85.1094,186.8594 85.0781,187.0156 85.0781,187.4688 L85.0781,188.25 L80.8594,188.25 L80.8594,186.0625 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="52" x="96" y="188.948">UserRole</text><line style="stroke:#A80036;stroke-width:1.5;" x1="68" x2="150" y1="201" y2="201"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="73" y="215.2189">Teacher</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="37" x="73" y="228.4188">Student</text><line style="stroke:#A80036;stroke-width:1.5;" x1="68" x2="150" y1="235.3998" y2="235.3998"/><!--MD5=[3fd616f346a44cd59a91eb10b19e157c]
class User--><rect codeLine="14" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="100.7996" id="User" style="stroke:#A80036;stroke-width:1.5;" width="98" x="172" y="7"/><ellipse cx="205" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M200,24.1563 C200,26.6563 202.1406,28.4688 205.0625,28.4688 C206.2969,28.4688 207.4688,28.1719 208.2188,27.6563 C208.8281,27.2344 209.1563,26.8125 209.1563,26.4063 C209.1563,25.9375 208.7344,25.5313 208.2344,25.5313 C208,25.5313 207.7813,25.6094 207.5781,25.8125 C207.1406,26.25 207.1406,26.25 206.9688,26.3438 C206.5156,26.5781 205.875,26.7188 205.1094,26.7188 C203.1094,26.7188 201.8281,25.7031 201.8281,24.125 L201.8281,23.0781 C201.8281,21.375 203.0469,20.1719 204.75,20.1719 C205.3281,20.1719 205.9063,20.3125 206.375,20.5625 C206.8438,20.8281 207.0156,21.0156 207.0781,21.375 C207.2031,22.0469 207.4531,22.2969 207.9844,22.2969 C208.2656,22.2969 208.5469,22.1563 208.7344,21.9375 C208.8594,21.7656 208.9063,21.5938 208.9063,21.1563 L208.9063,19.7969 C208.9063,19.375 208.8906,19.2344 208.7656,19.0625 C208.5938,18.8125 208.3125,18.6563 207.9844,18.6563 C207.6719,18.6563 207.4688,18.7656 207.25,19.0313 C206.0781,18.5313 205.6406,18.4219 204.6875,18.4219 C202.0156,18.4219 200,20.4375 200,23.0625 L200,24.1563 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="26" x="223" y="26.948">User</text><line style="stroke:#A80036;stroke-width:1.5;" x1="173" x2="269" y1="39" y2="39"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="178" y="53.2189">id : Int64</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="86" x="178" y="66.4188">username : String</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="73" x="178" y="79.6187">role : UserRole</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="59" x="178" y="92.8186">admin : Bool</text><line style="stroke:#A80036;stroke-width:1.5;" x1="173" x2="269" y1="99.7996" y2="99.7996"/><!--MD5=[61a83f88cb8b7d3a80bc8c481f3736bf]
class Teacher--><rect codeLine="27" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="87.5997" id="Teacher" style="stroke:#A80036;stroke-width:1.5;" width="114" x="294" y="304"/><ellipse cx="325.65" cy="320" fill="#ADD1B2" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M320.65,321.1563 C320.65,323.6563 322.7906,325.4688 325.7125,325.4688 C326.9469,325.4688 328.1188,325.1719 328.8688,324.6563 C329.4781,324.2344 329.8063,323.8125 329.8063,323.4063 C329.8063,322.9375 329.3844,322.5313 328.8844,322.5313 C328.65,322.5313 328.4313,322.6094 328.2281,322.8125 C327.7906,323.25 327.7906,323.25 327.6188,323.3438 C327.1656,323.5781 326.525,323.7188 325.7594,323.7188 C323.7594,323.7188 322.4781,322.7031 322.4781,321.125 L322.4781,320.0781 C322.4781,318.375 323.6969,317.1719 325.4,317.1719 C325.9781,317.1719 326.5563,317.3125 327.025,317.5625 C327.4938,317.8281 327.6656,318.0156 327.7281,318.375 C327.8531,319.0469 328.1031,319.2969 328.6344,319.2969 C328.9156,319.2969 329.1969,319.1563 329.3844,318.9375 C329.5094,318.7656 329.5563,318.5938 329.5563,318.1563 L329.5563,316.7969 C329.5563,316.375 329.5406,316.2344 329.4156,316.0625 C329.2438,315.8125 328.9625,315.6563 328.6344,315.6563 C328.3219,315.6563 328.1188,315.7656 327.9,316.0313 C326.7281,315.5313 326.2906,315.4219 325.3375,315.4219 C322.6656,315.4219 320.65,317.4375 320.65,320.0625 L320.65,321.1563 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="45" x="343.35" y="323.948">Teacher</text><line style="stroke:#A80036;stroke-width:1.5;" x1="295" x2="407" y1="336" y2="336"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="300" y="350.2189">id : Int64</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="102" x="300" y="363.4188">max_students : Int32</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="47" x="300" y="376.6187">skif : Bool</text><line style="stroke:#A80036;stroke-width:1.5;" x1="295" x2="407" y1="383.5997" y2="383.5997"/><!--MD5=[d6181cb537bdc20c0a3007a98a56832d]
class Student--><rect codeLine="35" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="74.3998" id="Student" style="stroke:#A80036;stroke-width:1.5;" width="74" x="565" y="169"/><ellipse cx="580" cy="185" fill="#ADD1B2" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M575,186.1563 C575,188.6563 577.1406,190.4688 580.0625,190.4688 C581.2969,190.4688 582.4688,190.1719 583.2188,189.6563 C583.8281,189.2344 584.1563,188.8125 584.1563,188.4063 C584.1563,187.9375 583.7344,187.5313 583.2344,187.5313 C583,187.5313 582.7813,187.6094 582.5781,187.8125 C582.1406,188.25 582.1406,188.25 581.9688,188.3438 C581.5156,188.5781 580.875,188.7188 580.1094,188.7188 C578.1094,188.7188 576.8281,187.7031 576.8281,186.125 L576.8281,185.0781 C576.8281,183.375 578.0469,182.1719 579.75,182.1719 C580.3281,182.1719 580.9063,182.3125 581.375,182.5625 C581.8438,182.8281 582.0156,183.0156 582.0781,183.375 C582.2031,184.0469 582.4531,184.2969 582.9844,184.2969 C583.2656,184.2969 583.5469,184.1563 583.7344,183.9375 C583.8594,183.7656 583.9063,183.5938 583.9063,183.1563 L583.9063,181.7969 C583.9063,181.375 583.8906,181.2344 583.7656,181.0625 C583.5938,180.8125 583.3125,180.6563 582.9844,180.6563 C582.6719,180.6563 582.4688,180.7656 582.25,181.0313 C581.0781,180.5313 580.6406,180.4219 579.6875,180.4219 C577.0156,180.4219 575,182.4375 575,185.0625 L575,186.1563 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="42" x="594" y="188.948">Student</text><line style="stroke:#A80036;stroke-width:1.5;" x1="566" x2="638" y1="201" y2="201"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="571" y="215.2189">id : Int64</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="47" x="571" y="228.4188">skif : Bool</text><line style="stroke:#A80036;stroke-width:1.5;" x1="566" x2="638" y1="235.3998" y2="235.3998"/><!--MD5=[fa8a72b0b94b71ef7235634ef31b1a3b]
class TeacherVote--><rect codeLine="48" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="61.1999" id="TeacherVote" style="stroke:#A80036;stroke-width:1.5;" width="102" x="300" y="453"/><ellipse cx="315" cy="469" fill="#ADD1B2" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M310,470.1563 C310,472.6563 312.1406,474.4688 315.0625,474.4688 C316.2969,474.4688 317.4688,474.1719 318.2188,473.6563 C318.8281,473.2344 319.1563,472.8125 319.1563,472.4063 C319.1563,471.9375 318.7344,471.5313 318.2344,471.5313 C318,471.5313 317.7813,471.6094 317.5781,471.8125 C317.1406,472.25 317.1406,472.25 316.9688,472.3438 C316.5156,472.5781 315.875,472.7188 315.1094,472.7188 C313.1094,472.7188 311.8281,471.7031 311.8281,470.125 L311.8281,469.0781 C311.8281,467.375 313.0469,466.1719 314.75,466.1719 C315.3281,466.1719 315.9063,466.3125 316.375,466.5625 C316.8438,466.8281 317.0156,467.0156 317.0781,467.375 C317.2031,468.0469 317.4531,468.2969 317.9844,468.2969 C318.2656,468.2969 318.5469,468.1563 318.7344,467.9375 C318.8594,467.7656 318.9063,467.5938 318.9063,467.1563 L318.9063,465.7969 C318.9063,465.375 318.8906,465.2344 318.7656,465.0625 C318.5938,464.8125 318.3125,464.6563 317.9844,464.6563 C317.6719,464.6563 317.4688,464.7656 317.25,465.0313 C316.0781,464.5313 315.6406,464.4219 314.6875,464.4219 C312.0156,464.4219 310,466.4375 310,469.0625 L310,470.1563 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="70" x="329" y="472.948">TeacherVote</text><line style="stroke:#A80036;stroke-width:1.5;" x1="301" x2="401" y1="485" y2="485"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="306" y="499.2189">id : Int64</text><line style="stroke:#A80036;stroke-width:1.5;" x1="301" x2="401" y1="506.1999" y2="506.1999"/><!--MD5=[6987bc66bd8845192e2addfb47d98466]
class Vote--><rect codeLine="42" fill="#FEFECE" filter="url(#f1jbg0kb33thgd)" height="61.1999" id="Vote" style="stroke:#A80036;stroke-width:1.5;" width="57" x="508.5" y="317.5"/><ellipse cx="523.5" cy="333.5" fill="#ADD1B2" rx="11" ry="11" style="stroke:#A80036;stroke-width:1.0;"/><path d="M518.5,334.6563 C518.5,337.1563 520.6406,338.9688 523.5625,338.9688 C524.7969,338.9688 525.9688,338.6719 526.7188,338.1563 C527.3281,337.7344 527.6563,337.3125 527.6563,336.9063 C527.6563,336.4375 527.2344,336.0313 526.7344,336.0313 C526.5,336.0313 526.2813,336.1094 526.0781,336.3125 C525.6406,336.75 525.6406,336.75 525.4688,336.8438 C525.0156,337.0781 524.375,337.2188 523.6094,337.2188 C521.6094,337.2188 520.3281,336.2031 520.3281,334.625 L520.3281,333.5781 C520.3281,331.875 521.5469,330.6719 523.25,330.6719 C523.8281,330.6719 524.4063,330.8125 524.875,331.0625 C525.3438,331.3281 525.5156,331.5156 525.5781,331.875 C525.7031,332.5469 525.9531,332.7969 526.4844,332.7969 C526.7656,332.7969 527.0469,332.6563 527.2344,332.4375 C527.3594,332.2656 527.4063,332.0938 527.4063,331.6563 L527.4063,330.2969 C527.4063,329.875 527.3906,329.7344 527.2656,329.5625 C527.0938,329.3125 526.8125,329.1563 526.4844,329.1563 C526.1719,329.1563 525.9688,329.2656 525.75,329.5313 C524.5781,329.0313 524.1406,328.9219 523.1875,328.9219 C520.5156,328.9219 518.5,330.9375 518.5,333.5625 L518.5,334.6563 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="25" x="537.5" y="337.448">Vote</text><line style="stroke:#A80036;stroke-width:1.5;" x1="509.5" x2="564.5" y1="349.5" y2="349.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="514.5" y="363.7189">id : Int64</text><line style="stroke:#A80036;stroke-width:1.5;" x1="509.5" x2="564.5" y1="370.6999" y2="370.6999"/><!--MD5=[95db05b050baef27771ec21d480edb9f]
reverse link User to UserRole--><path codeLine="21" d="M170.62,124.4 C158.93,139.7 146.9,155.42 136.61,168.88 " fill="none" id="User-backto-UserRole" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="none" points="165.37,119.74,183.08,108.1,176.5,128.24,165.37,119.74" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[fdf4e2e47968818a7567d47f28253cd3]
link User to Teacher--><path codeLine="23" d="M216.56,108.1 C215.22,146.8 218.15,200.89 239,243 C250.76,266.74 270.38,287.78 289.94,304.62 " fill="none" id="User-to-Teacher" style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><polygon fill="#A80036" points="293.85,307.93,289.5484,299.0702,290.0277,304.7067,284.3911,305.1859,293.85,307.93" style="stroke:#A80036;stroke-width:1.0;"/><path d="M244,191.5 L244,216.5 L539,216.5 L539,201.5 L529,191.5 L244,191.5 " fill="#FBFB77" filter="url(#f1jbg0kb33thgd)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M529,191.5 L529,201.5 L539,201.5 L529,191.5 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="274" x="250" y="208.577">Has either Teacher or Student according to role</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="46" x="239.9602" y="300.3736">has one</text><!--MD5=[fcfd5c763dab8fc7552ec2d555f438c6]
link User to Student--><path codeLine="25" d="M270.1,72.65 C333.31,91.54 445.96,127.47 538,169 C545.31,172.3 552.9,176.15 560.18,180.09 " fill="none" id="User-to-Student" style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><polygon fill="#A80036" points="564.67,182.55,558.6951,174.7206,560.2838,180.1497,554.8546,181.7385,564.67,182.55" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="46" x="510.9402" y="175.6744">has one</text><!--MD5=[14c2bd3aec6ceabf842701ac8cc796fa]
link Teacher to TeacherVote--><path codeLine="33" d="M338.97,392.34 C337.82,410.28 338.05,430.8 339.65,447.73 " fill="none" id="Teacher-to-TeacherVote" style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><polygon fill="#A80036" points="340.19,452.86,343.216,443.4875,339.6614,447.888,335.2609,444.3333,340.19,452.86" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="57" x="274.5909" y="441.6376">has many</text><!--MD5=[ba80ff4c3d6f94ecf5fa8424fdacc200]
link TeacherVote to Teacher--><path codeLine="52" d="M362.44,452.86 C364.46,436.61 364.99,416.04 364.04,397.51 " fill="none" id="TeacherVote-to-Teacher" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="363.73,392.34,360.2762,401.5634,364.0295,397.331,368.2618,401.0843,363.73,392.34" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="46" x="316.2858" y="411.7773">has one</text><!--MD5=[583188c21a0d856b6daecb06e2a57f7e]
link Student to Vote--><path codeLine="40" d="M585.26,243.05 C575.33,264.44 562.81,291.42 553.01,312.52 " fill="none" id="Student-to-Vote" style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><polygon fill="#A80036" points="550.83,317.21,558.245,310.7279,552.9335,312.674,550.9874,307.3624,550.83,317.21" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="46" x="502.8241" y="305.9548">has one</text><!--MD5=[7a9e7a1523848558179a93b537889586]
link Vote to TeacherVote--><path codeLine="46" d="M508.35,369.57 C478.48,391 431.25,424.9 396.32,449.97 " fill="none" id="Vote-to-TeacherVote" style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><polygon fill="#A80036" points="392.12,452.99,401.7633,450.9881,396.1809,450.073,397.0961,444.4907,392.12,452.99" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="57" x="408.2196" y="441.3235">has many</text></g></svg>

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.6 KiB

1
docs/src/stack/README.md Normal file
View file

@ -0,0 +1 @@
# Stack

93
docs/src/stack/backend.md Normal file
View file

@ -0,0 +1,93 @@
# Backend
The backend is the core of the application.
It is responsible for managing the database and API.
## Database
The database is running on Postgres with this schema:
```plantuml
@startuml
class MicrateDbVersion {
id : Int32
version_id : Int64
is_applied : Bool
tstamp : Time?
}
enum UserRole {
Teacher
Student
}
class User {
id : Int64
username : String
role : UserRole
admin : Bool
}
User <|-- UserRole
User ..> "has one" Teacher
note on link: Has either Teacher or Student according to role
User ..> "has one" Student
class Teacher {
id : Int64
max_students : Int32
skif : Bool
}
Teacher ..> "has many" TeacherVote
class Student {
id : Int64
skif : Bool
}
Student ..> "has one" Vote
class Vote {
id : Int64
}
Vote ..> "has many" TeacherVote
class TeacherVote {
id : Int64
}
TeacherVote --> "has one" Teacher
@enduml
```
## API
An example request being handled is shown below.
```plantuml
@startuml
start
:Request;
:Generate GraphQL context;
if (API requires authentication?) then (true)
if (Not authenticated?) then (true)
#pink:Unauthorized;
kill
endif
endif
:Execute method;
:Response;
end
@enduml
```

View file

@ -0,0 +1 @@
# Frontend