Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Adds initial Sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Wilson committed Feb 26, 2019
1 parent db78c6f commit fefc397
Show file tree
Hide file tree
Showing 18 changed files with 622 additions and 95 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Sphinx

import/
*.env
services/db/create.sql
Expand Down Expand Up @@ -80,7 +82,9 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
services/web/docs/_build
services/web/docs/_static
services/web/docs/_templates

# PyBuilder
target/
Expand Down
65 changes: 0 additions & 65 deletions README.md

This file was deleted.

75 changes: 75 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
SIP: Simple Intel Platform
==========================

Run the included setup script to begin configuration.

::

./setup.py

The setup script will walk you through:

- Creating dev/test/production Docker environments
- Setting the MySQL root user password
- Creating a non-root MySQL user and password
- Creating an optional self-signed HTTPS certificate

Once you answer the setup script's questions, it will generate files
containing the environment variables for the MySQL and Flask Docker
containers.

**MAKE SURE TO NOTE THE ADMIN PASSWORD REPORTED BY THE SETUP SCRIPT!**

If you created a dev or a production environment, their containers will
be built and initialized with the default database values specified in
the setup.ini file:

::

services/web/etc/setup.ini

To run the unit/integration tests:
----------------------------------

NOTE: A separate test Docker environment will be automatically built if
you chose to build either a dev or production environment.

::

bin/test.sh

To initialize DB migrations (Flask-Migrate):
--------------------------------------------

Note: This should only be performed for the DEV environment.

::

bin/db-init-DEV.sh

To generate DB migrations (Flask-Migrate):
------------------------------------------

Note: This should only be performed for the DEV environment.

::

bin/db-migrate-DEV.sh

To upgrade the DB (Flask-Migrate):
----------------------------------

Note: This can be performed on either the DEV or PROD environment.

::

bin/db-upgrade-DEV.sh
bin/db-upgrade-PROD.sh

To enter a shell into one of the docker containers:
---------------------------------------------------

::

docker exec -i -t sip_web-dev_1 /bin/sh
docker exec -i -t <container_name> /bin/sh
19 changes: 19 additions & 0 deletions services/web/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
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)
8 changes: 8 additions & 0 deletions services/web/docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API
***

.. toctree::
:maxdepth: 1
:caption: Contents:

Alert <api/alert>
58 changes: 58 additions & 0 deletions services/web/docs/api/alert.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Alerts
******

.. contents::
:backlinks: none

Summary
-------

.. qrefflask:: project:create_app()
:endpoints: api.create_alert, api.read_alert, api.read_alerts, api.update_alert, api.delete_alert
:order: path

Create
------

**JSON Schema**

Required parameters are in **bold**.

.. jsonschema:: ../../project/api/schemas/alert_create.json

|
.. autoflask:: project:create_app()
:endpoints: api.create_alert

Read Single
-----------

.. autoflask:: project:create_app()
:endpoints: api.read_alert

Read Multiple
-------------

.. autoflask:: project:create_app()
:endpoints: api.read_alerts

Update
------

**JSON Schema**

Required parameters are in **bold**.

.. jsonschema:: ../../project/api/schemas/alert_update.json

|
.. autoflask:: project:create_app()
:endpoints: api.update_alert

Delete
------

.. autoflask:: project:create_app()
:endpoints: api.delete_alert

0 comments on commit fefc397

Please sign in to comment.