Skip to content

Commit

Permalink
ADD: intial docs setup with sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
vdmitriyev committed Mar 7, 2024
1 parent 543d030 commit a5ee14e
Show file tree
Hide file tree
Showing 19 changed files with 226 additions and 34 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: documentation

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install -r requirements/requirements-docs.txt
- name: Sphinx build
run: |
sphinx-build docs docs/_build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/_build/
force_orphan: true
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ static/data/*
app/static/gravatar/*
temp/*
data-uol-thesis-topics/*

.tox/*
.vscode/*
dist/*
docs/_build/*
generated/*
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
+ Details in ```requirements/requirements.txt```
* Docker + Docker Compose

## Documentation

Documentation is available [here](https://vdmitriyev.github.io/mta-system/)

## Architecture

## Setup
Expand All @@ -31,12 +35,11 @@

* User view. It is user by an user user to get access to the features of the system such as - services credentials, datasets imports, start/stop for services

![](./images/user-view.png)
![](./docs/_static/images/user-view.png)

* Admin view. It is used by an admin to monitor various parameters of a server - CPU usage, RAM usage, amount of containers running, logs, etc.

![](./images/admin-view.png)

![](./docs/_static/images/admin-view.png)

## License

Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes
File renamed without changes
35 changes: 35 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'mta-system'
copyright = '2024, vdmitriyev'
author = 'vdmitriyev'
release = '1.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"myst_parser",
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

#html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']
15 changes: 15 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Features

## System UI

##### User view

It is user by an user user to get access to the features of the system such as - services credentials, datasets imports, start/stop for services

![](./_static/images/user-view.png)

##### Admin view

It is used by an admin to monitor various parameters of a server - CPU usage, RAM usage, amount of containers running, logs, etc.

![](./_static/images/admin-view.png)
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## About

**mta-system** (**m**odular **t**eaching **a**ssistance **system**) was designed to help students to acquire new hands-on software experience. The solution was designed to be modular by design and to be hosted by a lecturer/faculty member for students.

```{toctree}
:maxdepth: 3
quickstart
features
license
```

```{toctree}
:hidden:
changelog
```
4 changes: 4 additions & 0 deletions docs/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## License

* Source Code - MIT
* Datasets - license is found directly inside the import module/dataset itself
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 1 addition & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Quickstart
18 changes: 11 additions & 7 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#pytest
#pytest-watch
#pytest-env
#tox
#black
#pylint
pypsi
tox==4.11.3

pytest==7.3.1
pytest-watch==4.2.0
pytest-env==0.8.1
isort==5.12.0
snakeviz==2.2.0

pre-commit==3.6.2
black==24.2.0
pypsi==1.4.6
4 changes: 4 additions & 0 deletions requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sphinx==7.2.6
myst-parser==2.0.0
sphinx-autobuild==2024.2.4
sphinx-rtd-theme==2.0.0
1 change: 1 addition & 0 deletions requirements/requirements-pgsql.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
psycopg2-binary~=2.9.9
2 changes: 1 addition & 1 deletion requirements/requirements-prod.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gunicorn
gunicorn==20.1.0
56 changes: 35 additions & 21 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
requests
psycopg2
requests==2.30.0
#psycopg2
#psycopg2-binary
numpy==1.19.3; platform_system == "Windows"
numpy==1.19.4; platform_system == "linux"
pandas
sqlalchemy
email_validator
beautifulsoup4
Pillow
#numpy==1.19.3; platform_system == "Windows"
#numpy==1.19.4; platform_system == "linux"
pandas==1.5.3
sqlalchemy==1.4.50
email_validator==1.3.1
beautifulsoup4==4.12.2
Pillow==9.5.0

# workarround
#Jinja2==3.1.2
#MarkupSafe==2.1.3
#Werkzeug==2.3.0

# flask
Flask
flask-cors
flask-restful
Flask-HTTPAuth
flask-login
Flask-SQLAlchemy
Flask==2.3.2
flask-cors==3.0.10
flask-restful==0.3.9
flask-HTTPAuth==4.8.0
flask-login==0.6.3
flask-SQLAlchemy==3.0.3
flask-Migrate==4.0.4

#python-decouple==3.7
python-dotenv==0.21.1

docker==6.1.2
passlib==1.7.4
bcrypt==4.0.1
python-crontab==2.7.1
psutil==5.9.5

#python-decouple
python-dotenv
markdown==3.4.1

docker
passlib
python-crontab
psutil
#
pymysql==1.0.3

rq==1.14.1
redis==4.5.5
3 changes: 2 additions & 1 deletion scripts/cmdInitiateEnv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ pip install --upgrade pip
pip install --upgrade uv

uv pip install -r requirements/requirements.txt
uv pip install -r requirements/requirements-pgsql.txt
REM pip install -r requirements/requirements-dev.txt
uv pip install -r requirements/requirements-docs.txt
uv pip install -r requirements/requirements-pgsql.txt

:END
endlocal
7 changes: 7 additions & 0 deletions scripts/cmdStartEnv.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
cd ..
SET PATH=C:\Compilers\Python311\Scripts\;C:\Compilers\Python311\;%PATH%
set PYTHONUTF8=1
set PYTHONDONTWRITEBYTECODE=1
call .venv\Scripts\activate.bat
cmd

0 comments on commit a5ee14e

Please sign in to comment.