Skip to content
Snippets Groups Projects
Commit b4947d0a authored by Victor Löfgren's avatar Victor Löfgren
Browse files

Resolve "Add automatic documentation generation"

parent feaca508
No related branches found
No related tags found
1 merge request!113Resolve "Add automatic documentation generation"
Pipeline #42993 passed
Showing
with 332 additions and 0 deletions
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
basepath = os.path.dirname(__file__)
filepath = os.path.abspath(os.path.join(basepath, "../.."))
sys.path.insert(0, filepath)
# -- Project information -----------------------------------------------------
project = "Teknikattan scoring system"
copyright = "2021, Albin Henriksson, Sebastian Karlsson, Victor Löfgren, Björn Modée, Josef Olsson, Max Rüdinger, Carl Schönfelder, Emil Wahlqvist"
author = "Albin Henriksson, Sebastian Karlsson, Victor Löfgren, Björn Modée, Josef Olsson, Max Rüdinger, Carl Schönfelder, Emil Wahlqvist"
version = "1.0"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "myst_parser"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
autodoc_member_order = "bysource"
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "alabaster"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False
logo_path = os.path.abspath(os.path.join(basepath, "../../app/static/images/t8.jpg"))
html_logo = logo_path
# favicon_path = os.path.abspath(os.path.join(basepath, "../../../client/public/favicon.ico"))
# html_favicon = favicon_path
# Development
In this section we give all the instructions necessary to continue the development of this project.
We also give some recommentations for how to go about it and some ides for how to improve it.
## Working with Python
In this section we briefly describe how to work with Python.
### Virtual environments
Python virtual environments are used to isolate packages for each project from each other.
In the [Installation](installation.md) you installed `virtualenv` and created and activated a virtual environment.
### Pip
Python uses `pip` to manage it's packages.
Here we briefly describe to use it.
All of the following instructions assume you have created and activated a virtual environment.
To install a package, run `pip install <package>`.
To uninstall a package, run `pip uninstall <package>`.
To save a package as a dependency to the project, run `pip freeze > requirements.txt`.
To install all project dependencies, run `pip install -r requirements.txt`.
## Visual Studio Code
The development of this project was mainly done using Visual Studio Code (VSCode).
It is not that surprising, then, that we recommend you use it.
### Tasks
A task in VSCode is a simple action that can be run by pressing `ctrl+shift+p` and selecting `Tasks: Run Task`.
A few such tasks has been setup in this project and tasks related to the server will be described below.
The `Start server` task will start the server.
The `Populate database` task will populate the database with a few competitions, teams, users and such.
The `Test server` task will run the server tests located in the `tests/` folder.
The `Open server coverage` can only be run after running the server tests and will open the coverage report generated by those tests in a webbrowser.
The `Generate server documentation` will generate the server documentation, i.e. this document, in the `docs/build/html/` folder.
The `Open server documentation` can only be run after generating the documentation and will open it in a webbrowser.
## Further development
Because the project was time limited a lot is left to be done.
A few ideas for things to be improved are given here.
### Replacing reqparse
As mention in the [Parsing request](overview.md#Parsing-request), the reqparse module from RestX is deprecated and should be replaced with for example marsmallow.
Parsing is a rather small and simple matter which makes it quite fine not to use the most optimal tool, but it should nevertheless be replaced.
Welcome to Teknikattan scoring system's documentation!
======================================================
This is the documentation for the backend of teknikattans scorings system.
Below you will find an overview of how the backend works.
Then you will find instructions for how to install it and get it up and running.
You will then find instructions for how to continue the development of this project.
Last you will find documentation on all of the modules.
Documentation
=============
.. toctree::
:maxdepth: 2
overview
installation
development
Modules
=======
.. toctree::
:maxdepth: 1
modules/app
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
# Installation
It is recommended to use [Visual Studio Code](https://code.visualstudio.com/) to install and use the server, but it is not necessary.
In order to install the server, you will need to do the following:
Install [Python](https://www.python.org/downloads/).
Clone [teknikattan-scoring-system](https://gitlab.liu.se/tddd96-grupp11/teknikattan-scoring-system).
Open a terminal and navigate to the root of the cloned project.
Install virtualenv and create a virtual environment:
```
pip install virtualenv
cd server
py -m venv env
```
Activate the virtual environment (which is done slightly differently on Windows and Linux/Mac):
On Windows:
```
Set-ExecutionPolicy Unrestricted -Scope Process
./env/Scripts/activate
```
On Linux/Mac:
```
source env/bin/activate
```
Install all project depencies:
```
pip install -r requirements.txt
```
You should now be ready to start the server.
Try it by running `python main.py` and navigate to `localhost:5000`.
If everything worked as it should you should see a list of all available API calls.
Continue to [Development](development.md).
app.apis.alternatives module
============================
.. automodule:: app.apis.alternatives
:members:
:undoc-members:
:show-inheritance:
app.apis.answers module
=======================
.. automodule:: app.apis.answers
:members:
:undoc-members:
:show-inheritance:
app.apis.auth module
====================
.. automodule:: app.apis.auth
:members:
:undoc-members:
:show-inheritance:
app.apis.codes module
=====================
.. automodule:: app.apis.codes
:members:
:undoc-members:
:show-inheritance:
app.apis.competitions module
============================
.. automodule:: app.apis.competitions
:members:
:undoc-members:
:show-inheritance:
app.apis.components module
==========================
.. automodule:: app.apis.components
:members:
:undoc-members:
:show-inheritance:
app.apis.media module
=====================
.. automodule:: app.apis.media
:members:
:undoc-members:
:show-inheritance:
app.apis.misc module
====================
.. automodule:: app.apis.misc
:members:
:undoc-members:
:show-inheritance:
app.apis.questions module
=========================
.. automodule:: app.apis.questions
:members:
:undoc-members:
:show-inheritance:
api
===
.. automodule:: app.apis
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
:maxdepth: 4
app.apis.alternatives
app.apis.answers
app.apis.auth
app.apis.codes
app.apis.competitions
app.apis.components
app.apis.media
app.apis.misc
app.apis.questions
app.apis.slides
app.apis.teams
app.apis.users
app.apis.slides module
======================
.. automodule:: app.apis.slides
:members:
:undoc-members:
:show-inheritance:
app.apis.teams module
=====================
.. automodule:: app.apis.teams
:members:
:undoc-members:
:show-inheritance:
app.apis.users module
=====================
.. automodule:: app.apis.users
:members:
:undoc-members:
:show-inheritance:
codes
=====
.. automodule:: app.core.codes
:members:
:undoc-members:
:show-inheritance:
dto
===
.. automodule:: app.core.dto
:members:
files
=====
.. automodule:: app.core.files
:members:
:undoc-members:
:show-inheritance:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment