Documentation

This commit is contained in:
Evan Reichard 2021-03-21 22:22:18 -04:00
parent 5742ac4790
commit 9ff09c23e4

View File

@ -10,35 +10,55 @@ docker-compose build
# Run compose in background. Service accessible via localhost:5000
docker-compose up -d
# Alternatively, in virtualenv
overseer run
```
## Developing
Once you have installed the setup.py and overseer[dev] dependencies, you can
run `pre-commit` to lint all server and client files:
```
pre-commit run --all-files
```
### Server
Ideally from a virtualenv:
```
python setup.py develop
# Setup virtual env
python3 -m venv overseer_venv
. overseer_venv/bin/activate
# Link overseer to working directory & install dev dependencies
python setup.py develop easy_install overseer[dev]
# Can use to run the server
overseer run
```
### Client
At this point, you have to build the client to appropriately populate the static resources for
the Flask server to serve up.
## Building
Overseer consists of a server and client component.
### Server:
Ideally from a virtualenv:
```
python setup.py install
```
# Change directory
cd ./src/overseer_client
### Client:
You must run these commands from the `./src/overseer_client/` directory:
```
# On the fly reloading (no server access)
yarn serve
# Build resources and auto populate in server static / template resources
yarn build
# Lint
yarn lint
```
## Testing
Once the above development steps are completed, the pytest dependency should
be installed:
```
pytest
```
# Notes
In a production environment, it would be ideal to setup something like nginx to properly forward
the `/api/*` routes to the Flask server, and all other endpoints to the static client resources.