64 lines
2.8 KiB
Markdown
64 lines
2.8 KiB
Markdown
# Study Dashboard
|
|
|
|
PySide6 based dashboard to keep track of study progress, built with a lightweight MVVM architecture, dependency injection and a local SQLite database that bootstraps itself with example data.
|
|
|
|
> **Copilot agents:** read `.github/copilot-instructions.md` before making changes for a condensed list of mandatory workflows.
|
|
|
|
## Stack Overview
|
|
- PySide6 for the GUI (widgets, signals/slots, Designer integration)
|
|
- dependency-injector for composing services, repositories and view models
|
|
- SQLite (local file `study.db` inside the repo) for persistence
|
|
- pytest, mypy, flake8 and black for TDD-inspired workflows and quality gates
|
|
|
|
## Development Environment (`venv`)
|
|
```bash
|
|
# Clone the project
|
|
git clone https://git.ghostnet.selfhost.eu/spektr/study-dashboard.git
|
|
cd study-dashboard
|
|
|
|
# Create/refresh the virtual environment and install requirements
|
|
bash scripts/bootstrap.sh
|
|
```
|
|
|
|
The script creates `.venv` if necessary, upgrades `pip`, and installs everything from `requirements.txt`. Re-run it whenever dependencies change.
|
|
|
|
## Running the Application
|
|
Run the dashboard (the script takes care of `PYTHONPYCACHEPREFIX` and `PYTHONPATH`):
|
|
|
|
```bash
|
|
bash scripts/run-app.sh
|
|
```
|
|
|
|
On startup the app ensures the SQLite database exists, creates the schema if required and seeds demo modules, exams and calendar entries.
|
|
|
|
## Tests & Quality
|
|
```bash
|
|
# optional pytest args are forwarded, e.g. "-k view_model"
|
|
bash scripts/run-qa.sh
|
|
```
|
|
`run-qa.sh` executes pytest, mypy, flake8 and black (check mode) with the correct environment so caches stay under `bin/`.
|
|
|
|
## Cleanup
|
|
If another agent or IDE command ran outside the helper scripts and created `__pycache__` folders inside `src/` or `tests/`, clean them up with:
|
|
|
|
```bash
|
|
bash scripts/clean.sh
|
|
```
|
|
|
|
The script removes any stray bytecode caches or `*.pyc` files under the tracked source tree without touching other temporary files in the project root.
|
|
|
|
## Generated Files & Deployment
|
|
|
|
- All temporary build artefacts live under `bin/`, which is ignored by git. The helper scripts (and `scripts/activate-pycache.sh` for manual setups) automatically create `bin/pycache` and set `PYTHONPYCACHEPREFIX` so no `__pycache__` folders appear in `src/` or `tests/`.
|
|
- PySide deployment can be prepared with the spec at `deploy/pysidedeploy.spec`. A typical run looks like:
|
|
|
|
```bash
|
|
bash scripts/build.sh
|
|
```
|
|
|
|
Pass additional flags after the script name if you need to tweak the deploy call. The spec already points `exec_directory` to `bin/deploy`, keeping executables outside the tracked source tree.
|
|
- Avoid installing the project in editable mode to keep `*.egg-info` files out of `src/`. Use `pip install -r requirements.txt` instead.
|
|
|
|
## Architecture Notes
|
|
See `docs/architecture.md` for the MVVM layer diagram, DI wiring and database bootstrap details.
|