docs: add basic install docs for server component
This commit is contained in:
parent
17d0099429
commit
f60d6e7516
12 changed files with 251 additions and 3 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
docs/_build/
|
||||
20
docs/Makefile
Normal file
20
docs/Makefile
Normal file
|
|
@ -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)
|
||||
0
docs/_static/.keepme
vendored
Normal file
0
docs/_static/.keepme
vendored
Normal file
6
docs/api/wuttapos.rst
Normal file
6
docs/api/wuttapos.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttapos``
|
||||
============
|
||||
|
||||
.. automodule:: wuttapos
|
||||
:members:
|
||||
6
docs/api/wuttapos.server.rst
Normal file
6
docs/api/wuttapos.server.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttapos.server``
|
||||
===================
|
||||
|
||||
.. automodule:: wuttapos.server
|
||||
:members:
|
||||
6
docs/api/wuttapos.terminal.rst
Normal file
6
docs/api/wuttapos.terminal.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttapos.terminal``
|
||||
=====================
|
||||
|
||||
.. automodule:: wuttapos.terminal
|
||||
:members:
|
||||
41
docs/conf.py
Normal file
41
docs/conf.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# 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
|
||||
|
||||
from importlib.metadata import version as get_version
|
||||
|
||||
project = "WuttaPOS"
|
||||
copyright = "2026, Lance Edgar"
|
||||
author = "Lance Edgar"
|
||||
release = get_version("WuttaPOS")
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
extensions = [
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx.ext.viewcode",
|
||||
"sphinx.ext.todo",
|
||||
"sphinxcontrib.programoutput",
|
||||
]
|
||||
|
||||
templates_path = ["_templates"]
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3/", None),
|
||||
"wutta-continuum": ("https://docs.wuttaproject.org/wutta-continuum/", None),
|
||||
"wuttjamaican": ("https://docs.wuttaproject.org/wuttjamaican/", None),
|
||||
}
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||
|
||||
html_theme = "furo"
|
||||
html_static_path = ["_static"]
|
||||
35
docs/index.rst
Normal file
35
docs/index.rst
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
WuttaPOS
|
||||
========
|
||||
|
||||
This is an old idea but a new effort, for a Python-based point of sale system.
|
||||
|
||||
This project includes two primary components:
|
||||
|
||||
- web app and related daemons, to run on the server
|
||||
- standalone GUI app, to run on the lanes
|
||||
|
||||
This project is in the very early stages and is not yet documented.
|
||||
It is based on an earlier effort, which used Rattail:
|
||||
`rattail/wuttapos`_
|
||||
|
||||
.. _rattail/wuttapos: https://forgejo.wuttaproject.org/rattail/wuttapos
|
||||
|
||||
However this project uses `Wutta Framework
|
||||
<https://wuttaproject.org>`_, has no Rattail dependencies, and "starts
|
||||
over" for (mostly) everything.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Documentation
|
||||
|
||||
narr/install
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Package API
|
||||
|
||||
api/wuttapos
|
||||
api/wuttapos.server
|
||||
api/wuttapos.terminal
|
||||
35
docs/make.bat
Normal file
35
docs/make.bat
Normal file
|
|
@ -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
|
||||
89
docs/narr/install.rst
Normal file
89
docs/narr/install.rst
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
|
||||
==============
|
||||
Installation
|
||||
==============
|
||||
|
||||
For now this only describes a *development* setup, which assumes the following:
|
||||
|
||||
* Linux OS
|
||||
* Python 3.11 or newer
|
||||
* database in PostgreSQL or MySQL
|
||||
|
||||
These steps will setup both the server and terminal in a shared
|
||||
virtual environment.
|
||||
|
||||
|
||||
Virtual Environment
|
||||
-------------------
|
||||
|
||||
Obviously you should make a virtual environment.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
python3 -m venv wuttapos
|
||||
cd wuttapos
|
||||
source bin/activate
|
||||
|
||||
|
||||
Install Package
|
||||
---------------
|
||||
|
||||
Install the WuttaPOS package within your virtual environment:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
bin/pip install WuttaPOS
|
||||
|
||||
|
||||
Install Server
|
||||
--------------
|
||||
|
||||
**Please note, you must create your database before running the installer.**
|
||||
|
||||
Run the WuttaPOS installer to setup the server app:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
bin/wuttapos install
|
||||
|
||||
Now you can run the server app via command line:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
bin/wutta -c app/web.conf webapp -r
|
||||
|
||||
And browse it (by default) at http://localhost:9080
|
||||
|
||||
The first time you browse to it, you must enter details for the
|
||||
(first) admin user. That can all be changed later, just needs an
|
||||
account to get things started.
|
||||
|
||||
After that you must login using the credentials you gave it.
|
||||
|
||||
At this point the app is fully functional.
|
||||
|
||||
Don't forget you can "become root" (via user menu in top right of
|
||||
screen) to bypass all permission checks. This shows all menu options,
|
||||
tool buttons etc. no matter what your normal permissions are.
|
||||
(Only users in the Administrator role can become root.)
|
||||
|
||||
|
||||
Sample Data
|
||||
~~~~~~~~~~~
|
||||
|
||||
You may also want to install sample data, to get some basic tables
|
||||
populated and avoid that headache. As of now the sample data is very
|
||||
minimal, and obviously not "real" so it's only a small convenience.
|
||||
|
||||
To install sample data, first "become root" (via user menu in top
|
||||
right of screen) and then go to Admin -> App Info and click Install
|
||||
Sample Data.
|
||||
|
||||
Eventually the sample data, and/or data import options in general,
|
||||
should be improved - but that will come later.
|
||||
|
||||
|
||||
Install Terminal
|
||||
----------------
|
||||
|
||||
TODO: this is not yet documented
|
||||
|
|
@ -27,9 +27,10 @@ classifiers = [
|
|||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
# TODO: decide what we actually want to support
|
||||
# "Programming Language :: Python :: 3.8",
|
||||
# "Programming Language :: Python :: 3.9",
|
||||
# "Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Topic :: Office/Business",
|
||||
]
|
||||
|
|
@ -44,6 +45,8 @@ dependencies = [
|
|||
server = ["WuttaWeb[continuum]"]
|
||||
# terminal = ["flet[all]<0.80.0"]
|
||||
terminal = ["flet[all]<0.21"]
|
||||
docs = ["Sphinx", "sphinxcontrib-programoutput", "furo"]
|
||||
tests = ["tox"]
|
||||
|
||||
|
||||
[project.scripts]
|
||||
|
|
|
|||
6
tox.ini
Normal file
6
tox.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[testenv:docs]
|
||||
basepython = python3.11
|
||||
extras = docs
|
||||
changedir = docs
|
||||
commands = sphinx-build -b html -d {envtmpdir}/doctrees -W -T . {envtmpdir}/docs
|
||||
Loading…
Add table
Add a link
Reference in a new issue