Skip to content

Commit 0d537c8

Browse files
authored
Merge pull request #5 from mbsantiago/dev
Fix authentication issue raised at #4.
2 parents cd0b393 + 3be9f98 commit 0d537c8

33 files changed

+1278
-963
lines changed

.gitignore

+4-5
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,11 @@ front/src/old_hooks
166166
old
167167

168168
site
169+
back/user_guide
169170

170171
whombat.db
171172
.pdm-python
172-
back/src/whombat/statics
173-
back/src/whombat/statics
173+
back/src/whombat/statics/*
174+
back/src/whombat/user_guide/*
174175
back/.build_venv
175-
back/user_guide
176-
back/src/whombat/user_guide
177-
.bumpversion.cfg
176+
.bumpversion.cfg

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ COPY back/app.py /code/app.py
5959
COPY back/pyproject.toml /code/pyproject.toml
6060
COPY back/alembic.ini /code/alembic.ini
6161
COPY back/README.md /code/README.md
62+
COPY back/LICENSE /code/LICENSE
6263

6364
# Install Whombat
6465
RUN pip install --no-deps .

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ build-guide:
1111

1212
bundle-pyinstaller:
1313
bash scripts/bundle_linux.sh
14+
15+
publish:
16+
bash scripts/publish_pypi.sh

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Whombat
22

3+
![GitHub License](https://img.shields.io/github/license/mbsantiago/whombat)
4+
![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmbsantiago%2Fwhombat%2Fdev%2Fback%2Fpyproject.toml)
5+
![Static Badge](https://img.shields.io/badge/formatting-black-black)
6+
[![codecov](https://codecov.io/gh/mbsantiago/whombat/graph/badge.svg?token=WMzUfSXIyL)](https://codecov.io/gh/mbsantiago/whombat)
7+
![build](https://github.com/mbsantiago/whombat/actions/workflows/bundle.yml/badge.svg)
8+
![lint](https://github.com/mbsantiago/whombat/actions/workflows/lint.yml/badge.svg)
9+
![docs](https://github.com/mbsantiago/whombat/actions/workflows/docs.yml/badge.svg)
10+
![tests](https://github.com/mbsantiago/whombat/actions/workflows/test.yml/badge.svg)
11+
312
**Whombat** is an open-source, web-based audio annotation tool designed to streamline audio data labeling and annotation, with a particular focus on supporting machine learning model development.
413

514
## Installation

back/Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export PRINT_HELP_PYSCRIPT
2727

2828
BROWSER := python -c "$$BROWSER_PYSCRIPT"
2929

30-
help:
30+
help: ## show this help message and exit
3131
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
3232

33-
clean: clean-build clean-pyc clean-test clean-docs
33+
clean: clean-build clean-pyc clean-test clean-docs ## remove all build, test, coverage and Python artifacts
3434

3535
clean-build:
3636
rm -fr build/
@@ -73,35 +73,35 @@ lint/pyright:
7373

7474
lint: lint/flake8 lint/black lint/pycodestyle lint/pydocstyle lint/pylint lint/pyright ## check style
7575

76-
format:
76+
format: ## format code
7777
isort src tests
7878
black src tests
7979

80-
test:
80+
test: ## Run all tests
8181
pytest -n auto
8282

83-
install: clean
83+
install: clean ## install the package to the active Python's site-packages
8484
pip install .
8585

86-
coverage:
86+
coverage: ## check code coverage
8787
coverage run --source whombat -m pytest
8888
coverage report -m
8989
coverage html
9090
$(BROWSER) htmlcov/index.html
9191

92-
build-docs:
92+
build-docs: ## build documentation
9393
mkdocs build
9494

95-
build-guide:
95+
build-guide: ## build user guide
9696
mkdocs build -f mkdocs-guide.yml -d src/whombat/user_guide
9797

98-
serve-docs:
98+
serve-docs: ## serve documentation
9999
URL="http://localhost:8000/whombat/"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL
100100
@$(ENV_PREFIX)mkdocs serve
101101

102-
serve-guide:
102+
serve-guide: ## serve user guide
103103
URL="http://localhost:8000/whombat/"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL
104104
@$(ENV_PREFIX)mkdocs serve -f mkdocs-guide.yml
105105

106-
serve-dev:
106+
serve-dev: ## serve development backend
107107
WHOMBAT_DEV=true python -m whombat

back/README.md

+66-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,84 @@
1-
# Whombat
1+
# Whombat - Python Backend
22

3-
> [!TIP]
4-
> Read the latest [documentation](https://mbsantiago.github.io/whombat/)
3+
**whombat** is an open-source web-based audio annotation tool designed to
4+
facilitate audio data labeling and annotation, with a special focus on aiding
5+
machine learning model development.
56

6-
> [!IMPORTANT]
7-
> Whombat is in beta mode. Most features are implemented but probably buggy.
8-
> Expect many changes before a first release.
7+
For additional details on installing the entire application and its usage, refer
8+
to the main [README](https://github.com/mbsantiago/whombat).
99

10-
**whombat** is an open-source web-based audio annotation tool designed to facilitate
11-
audio data labeling and annotation, with a special focus on aiding machine
12-
learning model development.
10+
For the latest updates and detailed documentation, check out the official
11+
[documentation](https://mbsantiago.github.io/whombat/).
1312

1413
## Installation
1514

16-
To use whombat, follow these steps:
15+
### With Pip
16+
17+
The most straightforward method to set up the backend and Whombat Python API is
18+
using pip. Execute the following command:
19+
20+
```bash
21+
pip install whombat
22+
```
23+
24+
### From Source Code
1725

1826
Clone the repository:
1927

20-
```shell
28+
```bash
2129
git clone https://github.com/mbsantiago/whombat.git
2230
```
2331

24-
Install the required dependencies:
32+
Install the package:
2533

26-
```shell
27-
bash scripts/install.sh
34+
```bash
35+
cd whombat/backend
36+
pip install .
2837
```
2938

30-
Run the application:
39+
### With Docker
3140

32-
```shell
33-
bash scripts/run.sh
41+
Run Whombat inside a Docker container. Build the container by cloning the repository and executing:
42+
43+
44+
```bash
45+
git clone https://github.com/mbsantiago/whombat.git
46+
docker build -t whombat .
3447
```
3548

36-
Access whombat in your web browser at <http://localhost:5000>.
49+
Once the build is complete, run the container with:
50+
51+
```bash
52+
docker run -p 5000:5000 whombat
53+
```
54+
55+
### Development Environment
56+
57+
We manage Whombat's development with `pdm`.
58+
59+
1. Follow the official [installation instructions](https://pdm-project.org/latest/#installation) to get `pdm` on your machine.
60+
61+
2. Clone the repository:
62+
63+
```bash
64+
git clone https://github.com/mbsantiago/whombat.git
65+
```
66+
67+
3. Navigate to the backend directory and install dependencies:
68+
69+
```bash
70+
cd whombat/back
71+
pdm install --dev
72+
```
73+
74+
4. Start the development server:
75+
76+
```bash
77+
pdm run make serve-dev
78+
```
79+
80+
or
81+
82+
```bash
83+
WHOMBAT_DEV=true pdm run python -m whombat
84+
```

back/docs/developer_guide/cli.md

Whitespace-only changes.

back/docs/developer_guide/design_principles.md

-1
This file was deleted.

back/docs/developer_guide/index.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Developer Guide
22

3-
Thank you for your patience as we craft this documentation! We're diligently
4-
working to provide you with valuable insights and instructions. Stay tuned for
5-
updates!
3+
Welcome to the Whombat Developer Guide. This comprehensive resource covers a
4+
variety of topics essential for developers:
5+
6+
1. [Quickstart](quickstart.md): Learn how to set up a development environment on
7+
your machine quickly.
8+
2. [Architecture](architecture.md): Gain insight into the high-level structure
9+
of Whombat, its main components, and how they come together to form the final
10+
application.
11+
3. [Database Layer](database.md): Explore information about the data stored by
12+
Whombat, its storage configuration, and ways to tailor it to meet specific
13+
requirements.
14+
4. [Python API](api.md): Discover the convenient Python API provided by Whombat
15+
for interacting with stored data. Use this API to integrate Whombat's outputs
16+
into your Python scripts or create custom annotation workflows.
17+
5. [HTTP REST API](rest_api.md): Explore the HTTP REST API that all Whombat
18+
instances provide. This allows third parties to safely interact with Whombat
19+
data, enabling the development of alternative frontends or other web
20+
applications for working with annotation data.
21+
6. [Front End](front_end.md): Delve into the details of how the Whombat frontend
22+
is constructed.
23+
7. [Plugins](plugins.md): Stay tuned for updates on the integration of a plugin
24+
system, offering an easy way to incorporate third-party code into Whombat.
25+
Check here for the latest information.
26+
8. [Contributing](../CONTRIBUTING.md): Find instructions on how to contribute to
27+
this project and become part of the Whombat community.
28+
9. [Code of Conduct](../CODE_OF_CONDUCT.md): Familiarize yourself with our code
29+
of conduct to maintain a friendly and collaborative environment.
+94
Original file line numberDiff line numberDiff line change
@@ -1 +1,95 @@
11
# Quickstart
2+
3+
## Pre-requisites
4+
5+
Before setting up your Whombat development environment, ensure you have the
6+
following tools installed:
7+
8+
1. **Python 3.11**: We developed Whombat using this version, but any newer
9+
version should be compatible. Download Python 3.11
10+
[here](https://www.python.org/downloads/release/python-3117/).
11+
12+
2. **PDM**: PDM is a Python package dependency manager that we use to manage
13+
dependencies for the Python part of Whombat. Download PDM
14+
[here](https://pdm-project.org/latest/#installation).
15+
16+
3. **Node.js**: We use Node.js to develop and bundle the final JavaScript code
17+
for the Whombat frontend. Download the latest version
18+
[here](https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz).
19+
20+
## Set Up a Development Environment
21+
22+
After confirming that you have all the prerequisites ready, follow these steps
23+
to set up a development environment on your machine.
24+
25+
1. Clone the repository:
26+
27+
```bash
28+
git clone https://github.com/mbsantiago/whombat.git
29+
```
30+
31+
2. Navigate to the backend directory and install dependencies:
32+
33+
```bash
34+
cd whombat/back
35+
pdm install --dev
36+
```
37+
38+
3. Move to the frontend directory and install all dependencies:
39+
40+
```bash
41+
cd ../front
42+
npm install
43+
```
44+
45+
These instructions ensure you have the necessary tools and dependencies to
46+
kickstart Whombat development on your local machine.
47+
48+
## Running the Development Server
49+
50+
Once installed, you can start the backend server by navigating to the `back`
51+
directory and running:
52+
53+
```bash
54+
pdm run make serve-dev
55+
```
56+
57+
You can also start the frontend development server by navigating to the `front`
58+
directory and running:
59+
60+
```bash
61+
npm run dev
62+
```
63+
64+
These commands initiate the development servers for both the backend and
65+
frontend components of Whombat. Navigate to [localhost:3000](localhost:3000) to
66+
access the development front end.
67+
68+
## Our Standards
69+
70+
At Whombat, we emphasize code quality and employ various tools to streamline
71+
development.
72+
73+
### Code Formatting
74+
75+
We follow the black style for Python to maintain consistent formatting
76+
throughout the project. Additionally, we use isort to organize imports neatly.
77+
For the Typescript project, prettier serves as the primary code formatter.
78+
79+
### Linting
80+
81+
We utilize the following tools for linting and error checking:
82+
83+
1. Python:
84+
- **Ruff** for fast overall error checking
85+
- **Pyright** for type checking
86+
87+
2. Typescript:
88+
- **Eslint** for linting
89+
- **Tsc** for checking Typescript code
90+
91+
### Documentation
92+
93+
We adhere to the Numpy docstring format for documenting Python code. Our
94+
documentation is built using mkdocs, providing a clear and organized structure
95+
for users and contributors.

back/mkdocs.yml

-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ nav:
1414
- developer_guide/index.md
1515
- Quickstart: developer_guide/quickstart.md
1616
- Architecture: developer_guide/architecture.md
17-
- Design Principles: developer_guide/design_principles.md
1817
- Database Layer: developer_guide/database.md
1918
- Python API: developer_guide/api.md
2019
- HTTP REST API: developer_guide/rest_api.md
21-
- Command Line Interface: developer_guide/cli.md
2220
- Front End: developer_guide/front_end.md
2321
- Plugins: developer_guide/plugins.md
2422
- Contributing: CONTRIBUTING.md

0 commit comments

Comments
 (0)