Skip to content

Commit

Permalink
Update documentation to separate some files.
Browse files Browse the repository at this point in the history
  • Loading branch information
UpstreamData committed Aug 27, 2024
1 parent 770c6ff commit 3a3f20d
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
run: poetry install --no-root --with docs

- name: Deploy website
run: poetry run mkdocs gh-deploy
run: poetry run mkdocs gh-deploy --theme material
82 changes: 82 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Development

---

### Installation

Install development dependencies using [Poetry](https://python-poetry.org/):

```shell
poetry install --with dev
```

gooseBit also has dependencies for documentation and tests, you can install them all with:

```shell
poetry install --with dev,docs,tests
```

You can also just install all extras with:

```shell
poetry install --all-extras
```

## Development

### Code formatting and linting

Code is formatted using different tools

- black and isort for `*.py`
- biomejs for `*.js`, `*.json`
- prettier for `*.html`, `*.md`, `*.yml`, `*.yaml`
- djlint for `*.html.jinja`

Code is linted using different tools as well

- flake8 for `*.py`
- biomejs for `*.js`
- djlint for `*.html.jinja`

Best to have pre-commit install git hooks that run all those tools before a commit:

```bash
poetry run pre-commit install
```

To manually apply the hooks to all files use:

```bash
pre-commit run --all-files
```

### Testing

Tests are implemented using pytest. To run all tests

```bash
poetry run pytest
```

### Structure

The structure of gooseBit is as follows:

- `api`: Files for the API.
- `ui`: Files for the UI.
- `bff`: Backend for frontend API.
- `static`: Static files.
- `templates`: Jinja2 formatted templates.
- `nav`: Navbar handler.
- `updater`: DDI API handler and device update manager.
- `updates`: SWUpdate file parsing.
- `realtime`: Realtime API functionality with websockets.
- `auth`: Authentication functions.
- `models`: Database models.
- `db`: Database config and initialization.
- `schema`: Pydantic models used for API type hinting.
- `permissions`: Permission handling and permission enums.
- `settings`: Settings loader and handler.
- `telemetry`: Telemetry data handlers.
- `routes`: Routes for a giving endpoint, including the router.
84 changes: 4 additions & 80 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
# gooseBit

<img src="docs/img/goosebit-logo.png" style="width: 100px; height: 100px; display: block;">
# Home

---

A simplistic, opinionated remote update server implementing hawkBit™'s [DDI API](https://eclipse.dev/hawkbit/apis/ddi_api/).

## Quick Start

### Installation

1. Install dependencies using [Poetry](https://python-poetry.org/):
```bash
poetry install
```
2. Launch gooseBit:
```bash
python main.py
```

### Initial Configuration

Before running gooseBit for the first time, update the default credentials in `settings.yaml`. The default login for testing purposes is:
### What is gooseBit?

- **Username:** `[email protected]`
- **Password:** `admin`
A simplistic, opinionated remote update server implementing hawkBit™'s [DDI API](https://eclipse.dev/hawkbit/apis/ddi_api/),
designed to make remote updates of embedded devices easier.

## Assumptions

Expand Down Expand Up @@ -68,60 +49,3 @@ Devices can be pinned to their current software version, preventing any updates
### Real-time Update Logs

While updates are in progress, gooseBit captures real-time logs, which are accessible through the device repository.

## Development

### Code formatting and linting

Code is formatted using different tools

- black and isort for `*.py`
- biomejs for `*.js`, `*.json`
- prettier for `*.html`, `*.md`, `*.yml`, `*.yaml`

Code is linted using different tools as well

- flake8 for `*.py`
- biomejs for `*.js`

Best to have pre-commit install git hooks that run all those tools before a commit:

```bash
poetry run pre-commit install
```

To manually apply the hooks to all files use:

```bash
pre-commit run --all-files
```

### Testing

Tests are implemented using pytest. To run all tests

```bash
poetry run pytest
```

### Structure

The structure of gooseBit is as follows:

- `api`: Files for the API.
- `ui`: Files for the UI.
- `bff`: Backend for frontend API.
- `static`: Static files.
- `templates`: Jinja2 formatted templates.
- `nav`: Navbar handler.
- `updater`: DDI API handler and device update manager.
- `updates`: SWUpdate file parsing.
- `realtime`: Realtime API functionality with websockets.
- `auth`: Authentication functions.
- `models`: Database models.
- `db`: Database config and initialization.
- `schema`: Pydantic models used for API type hinting.
- `permissions`: Permission handling and permission enums.
- `settings`: Settings loader and handler.
- `telemetry`: Telemetry data handlers.
- `routes`: Routes for a giving endpoint, including the router.
24 changes: 24 additions & 0 deletions docs/quick_start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Quick Start

---

### Installation

#### Install dependencies using [Poetry](https://python-poetry.org/):

```shell
poetry install
```

#### Launch gooseBit:

```shell
python main.py
```

### Initial Configuration

Before running gooseBit for the first time, update the default credentials in `settings.yaml`. The default login for testing purposes is:

- **Username:** `[email protected]`
- **Password:** `admin`
19 changes: 19 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,22 @@ theme:
name: material
logo: img/goosebit-logo.svg
favicon: img/goosebit-logo.svg
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/weather-night
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-sunny
name: Switch to auto mode
nav:
- Home: index.md
- Quick Start: quick_start.md
- Development: development.md

0 comments on commit 3a3f20d

Please sign in to comment.