Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
e58f4f97
Commit
e58f4f97
authored
3 years ago
by
Victor Löfgren
Browse files
Options
Downloads
Patches
Plain Diff
Add libraries section to backend
parent
ef15108e
Branches
Branches containing commit
No related tags found
1 merge request
!164
Resolve "Update documentation"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/source/overview/server.md
+14
-3
14 additions, 3 deletions
docs/source/overview/server.md
with
14 additions
and
3 deletions
docs/source/overview/server.md
+
14
−
3
View file @
e58f4f97
...
@@ -6,6 +6,17 @@ It also needs to make sure that only authorized people can access these.
...
@@ -6,6 +6,17 @@ It also needs to make sure that only authorized people can access these.
The other responsibility is to sync slides, timer and answers between clients in an active competition.
The other responsibility is to sync slides, timer and answers between clients in an active competition.
Both of these will be described in more detail below.
Both of these will be described in more detail below.
## Libraries
The server is built in
[
Flask
](
https://flask.palletsprojects.com/en/2.0.x/
)
.
A few extensions to Flask are also used.
[
flask-smorest
](
https://flask-smorest.readthedocs.io/en/latest/
)
is used to defined the API routes.
It is this libray that automatically documents the API on
`localhost:5000`
using Swagger.
[
marshmallow
](
https://marshmallow.readthedocs.io/en/stable/
)
is used to convert database objects in JSON and to parse JSON back into Python objects.
[
SQLAlchemy
](
https://www.sqlalchemy.org/
)
is used to interface with the SQL database that is used.
More specifically
[
Flask-SQLAlchemy
](
https://flask-sqlalchemy.palletsprojects.com/en/2.x/
)
is used to integrate it with Flask.
[
Flask-Bcrypt
](
https://flask-bcrypt.readthedocs.io/en/latest/
)
is used to encrypt passwords.
## Receiving API calls
## Receiving API calls
An API call is a way for the client to communicate with the server.
An API call is a way for the client to communicate with the server.
...
@@ -65,14 +76,14 @@ In this way, for example, an entire competition with its teams, codes, slides an
...
@@ -65,14 +76,14 @@ In this way, for example, an entire competition with its teams, codes, slides an
## Active competitions
## Active competitions
Slides, timers, and answers needs to be synced during an active presentation.
Slides, timers, and answers needs to be synced during an active presentation.
This is done using SocketIO together with flask
_
socketio.
This is done using SocketIO together with flask
*
socketio.
Sent events are also authorized via JWT, basically the same way as the for the API calls.
Sent events are also authorized via JWT, basically the same way as the for the API calls.
But for socket events, the decorator that is used to authenticate them is
`@authorize_user()`
.
But for socket events, the decorator that is used to authenticate them is
`@authorize_user()`
.
Whenever a client joins a competition they will connect via sockets.
Whenever a client joins a competition they will connect via sockets.
A single competition cannot be active more than once at the same time.
A single competition cannot be active more than once at the same time.
This means that you will need to make a copy of a competition if you want to run the same competition at several locations at the same time.
This means that you will need to make a copy of a competition if you want to run the same competition at several locations at the same time.
All of the functionality related to an active competition and sockets can be found in the file
`app/core/sockets.py`
.
All of the functionality related to an active competition and sockets can be found in the file
`app/core/sockets.py`
.
The terms
*
active competition*
and
*
presentation
*
are equivalent.
The terms
\_
active competition
*
and
_
presentation
_
are equivalent.
### Starting and joing presentations
### Starting and joing presentations
...
@@ -84,7 +95,7 @@ The server can see what is stored in the JWT and do different things depending o
...
@@ -84,7 +95,7 @@ The server can see what is stored in the JWT and do different things depending o
### Syncing between clients
### Syncing between clients
[
comment
]:
#
(
What does `sync` mean? It isn't explained
)
[
comment
]:
#
"
What does `sync` mean? It isn't explained
"
The operator will emit the
`sync`
event and provide either a slide or a timer to update it on the server.
The operator will emit the
`sync`
event and provide either a slide or a timer to update it on the server.
The server will then send
`sync`
to all connected clients with the updated values, regardless of what was actually updated.
The server will then send
`sync`
to all connected clients with the updated values, regardless of what was actually updated.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment