Environment setup - tylergibbs2/Tsundoku GitHub Wiki
The main app consists of a Python/Quart backend with a TypeScript/React frontend. The backend webserver serves the frontend content with HTML templates, CSS, and bundled (via webpack) JavaScript.
I recommend setting up a Python venv
for local development. If you installed from source using the steps I've provided, you should already have a virtual environment setup.
Additional requirements are needed to perform actions such as code formatting, code linting, and testing.
$ uv sync --locked --all-extras
Usage: uv run python -m tsundoku --<command>
Command | Description | Sample usage |
---|---|---|
dbshell |
Spawns an interactive database shell | tsundoku --dbshell |
migrate |
Runs database migrations | tsundoku --migrate |
create-user |
Runs a form to create a user | tsundoku --create-user |
l10n-compat <locale1:string> <locale2:string> |
Checks l10n compatibility between two locales | tsundoku --l10n-compat en ru |
l10n-duplicates <locale:string> |
Checks a locale for duplicate translation keys | tsundoku --l10n-duplicates en |
$ bun dev
The bun dev
command will build the frontend and watch for code changes.
If the app is in debug mode, the bundle file that is built will not be cache-busted. You will likely have to refresh without cache (Ctrl+Shift+R
on Chrome) in order to see JavaScript code changes.
Please format your code manually before opening any pull requests.
$ uv run ruff format # formats Python files
$ uv run ruff check --fix # lints all Python files
$ uv run ty check # runs type-checking on Python files
$ yarn run prettier . -w # formats all other files
All localization files are stored in the l10n
directory. Changes made in these files will not be reflected in the app until the entire frontend is rebuilt.