diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..2cb3c17 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -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 diff --git a/.gitignore b/.gitignore index cd6d4f2..60f3cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,8 @@ static/data/* app/static/gravatar/* temp/* data-uol-thesis-topics/* - +.tox/* +.vscode/* +dist/* +docs/_build/* +generated/* \ No newline at end of file diff --git a/README.md b/README.md index e685764..3c21568 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -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) diff --git a/images/admin-view.png b/docs/_static/images/admin-view.png similarity index 100% rename from images/admin-view.png rename to docs/_static/images/admin-view.png diff --git a/images/user-view.png b/docs/_static/images/user-view.png similarity index 100% rename from images/user-view.png rename to docs/_static/images/user-view.png diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..d3e3515 --- /dev/null +++ b/docs/conf.py @@ -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'] diff --git a/docs/features.md b/docs/features.md new file mode 100644 index 0000000..1389e58 --- /dev/null +++ b/docs/features.md @@ -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) diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..d618a59 --- /dev/null +++ b/docs/index.md @@ -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 +``` diff --git a/docs/license.md b/docs/license.md new file mode 100644 index 0000000..39e5095 --- /dev/null +++ b/docs/license.md @@ -0,0 +1,4 @@ +## License + +* Source Code - MIT +* Datasets - license is found directly inside the import module/dataset itself \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..954237b --- /dev/null +++ b/docs/make.bat @@ -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 diff --git a/docs/quickstart.md b/docs/quickstart.md new file mode 100644 index 0000000..d28b1d7 --- /dev/null +++ b/docs/quickstart.md @@ -0,0 +1 @@ +## Quickstart \ No newline at end of file diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 64d17b6..c2035c2 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,7 +1,11 @@ -#pytest -#pytest-watch -#pytest-env -#tox -#black -#pylint -pypsi \ No newline at end of file +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 \ No newline at end of file diff --git a/requirements/requirements-docs.txt b/requirements/requirements-docs.txt new file mode 100644 index 0000000..712374d --- /dev/null +++ b/requirements/requirements-docs.txt @@ -0,0 +1,4 @@ +Sphinx==7.2.6 +myst-parser==2.0.0 +sphinx-autobuild==2024.2.4 +sphinx-rtd-theme==2.0.0 diff --git a/requirements/requirements-pgsql.txt b/requirements/requirements-pgsql.txt new file mode 100644 index 0000000..33f7a66 --- /dev/null +++ b/requirements/requirements-pgsql.txt @@ -0,0 +1 @@ +psycopg2-binary~=2.9.9 \ No newline at end of file diff --git a/requirements/requirements-prod.txt b/requirements/requirements-prod.txt index 283e130..abf25ef 100644 --- a/requirements/requirements-prod.txt +++ b/requirements/requirements-prod.txt @@ -1 +1 @@ -gunicorn \ No newline at end of file +gunicorn==20.1.0 \ No newline at end of file diff --git a/requirements/requirements.txt b/requirements/requirements.txt index ef29d74..9a5b9ac 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -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 \ No newline at end of file diff --git a/scripts/cmdInitiateEnv.bat b/scripts/cmdInitiateEnv.bat index a0d3a65..7609108 100644 --- a/scripts/cmdInitiateEnv.bat +++ b/scripts/cmdInitiateEnv.bat @@ -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 diff --git a/scripts/cmdStartEnv.bat b/scripts/cmdStartEnv.bat new file mode 100644 index 0000000..f7f86b8 --- /dev/null +++ b/scripts/cmdStartEnv.bat @@ -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