-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from ECN/update-dev-environment-setup-guide
Update dev environment setup guide
- Loading branch information
Showing
5 changed files
with
191 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Making Docs | ||
|
||
The api documentation uses mkdocs to create documenation, which is based in markdown. | ||
|
||
All of the doucmentation can be found in the `docs` directory in the `webqueue2-api` repo, and all of the api specific documentation can be found in the `docs/api` directory. | ||
|
||
|
||
## Mkdocs configuration | ||
|
||
A basic version of mkdocs can be installed by using `pip install mkdocs`, however, this is not recomened as the current implementation makes use of several plugins that enahance the basic features of mkdocs. To install all of the dependencies for this, follow the steps for setting up the dev environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
## API package structure | ||
|
||
The api can be broken down into 4 distinct parts: | ||
1. The logger | ||
2. The api | ||
3. The ECNQueue | ||
4. The initialization scripts | ||
|
||
### Logger | ||
|
||
The logger is its own subpackage and script which is used for outputting log information to both the terminal and a specified file. The logger uses the logging module to create log outputs with specified format. | ||
|
||
### API | ||
|
||
The api is the link between the ECNQueue and the frontend. The api continuously runs in the background, and takes urls matching a specified format from the front end and translates those as functions to be executed in the ECNQueue. The api uses flask and flask restful to do this | ||
|
||
### ECNQueue | ||
|
||
The ECNQueue subpackage is a parser in the backend for all of the items in stored in the queue directory. The ECNQueue parses the text documents in the queue and outputs structured json, which is then transfered to the fronted via the api. | ||
|
||
### The initialization scripts | ||
|
||
The initialization scripts take in user input (either via command line or wrapper script) and initialize the logger, ECNQueue, and API according to the user input. After initializing and implementing all of the necessary configurations, the initialization scripts start the api. These scripts use argparse to get user input and subprocess to launch the api via gunicorn. While not its own subpackage, the scripts are located directly in the `webqueue2_api` directory. | ||
|
||
|
||
## Structure | ||
|
||
```none | ||
webqueue2_api/ # webqueue2_api parent package | ||
│ | ||
├── api/ # api subpackage | ||
│ ├── __init__.py | ||
│ ├── auth.py | ||
│ └── resources/ | ||
│ ├── __init__.py | ||
│ ├── item.py | ||
│ ├── login.py | ||
│ ├── queue.py | ||
│ ├── queue_list.py | ||
│ └── refresh_access_token.py | ||
│ | ||
├── ECNQueue/ # ecnqueue subpackge | ||
│ ├── __init__.py | ||
│ ├── Item.py | ||
│ ├── parser/ | ||
│ │ ├── __init__.py | ||
│ │ └── parser.py | ||
│ ├── Queue.py | ||
│ └── utils.py | ||
│ | ||
├── logger/ # logger subpackage | ||
│ └─── __init__.py | ||
│ | ||
├── utils/ # utils subpackage | ||
│ ├── __init__.py | ||
│ └── tree.py | ||
│ | ||
├── __init__.py | ||
├── __main__.py # parses user input | ||
├── global_configs.py # stores the config file location | ||
├── start.py # returns a flask object ater initializing the user configs | ||
└── validate_arguments.py # validates all of teh user passed arguments | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{{! Google Docstring Template }} | ||
{{summaryPlaceholder}} | ||
|
||
{{extendedSummaryPlaceholder}} | ||
|
||
Example: | ||
[example] | ||
|
||
{{#parametersExist}} | ||
Args: | ||
{{#args}} | ||
{{var}} ({{typePlaceholder}}): {{descriptionPlaceholder}} | ||
{{/args}} | ||
{{#kwargs}} | ||
{{var}} ({{typePlaceholder}}, optional): {{descriptionPlaceholder}}. Defaults to {{&default}}. | ||
{{/kwargs}} | ||
{{/parametersExist}} | ||
|
||
{{#exceptionsExist}} | ||
Raises: | ||
{{#exceptions}} | ||
{{type}}: {{descriptionPlaceholder}} | ||
{{/exceptions}} | ||
{{/exceptionsExist}} | ||
|
||
{{#returnsExist}} | ||
Returns: | ||
{{#returns}} | ||
{{typePlaceholder}}: {{descriptionPlaceholder}} | ||
{{/returns}} | ||
{{/returnsExist}} | ||
|
||
{{#yieldsExist}} | ||
Yields: | ||
{{#yields}} | ||
{{typePlaceholder}}: {{descriptionPlaceholder}} | ||
{{/yields}} | ||
{{/yieldsExist}} |