You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`tiklocal/` contains the Flask app; `app.py` wires routes, `run.py` provides the CLI entrypoint, and helper modules live alongside routes.
5
+
-`tiklocal/templates/` holds Jinja templates (`*.html`); match filenames to view names and use lower-case with hyphens when needed.
6
+
-`tiklocal/static/` stores Tailwind sources (`input.css`), compiled `output.css`, and vendor JS.
7
+
-`instance/` is created at runtime for per-machine overrides; keep secrets out of version control.
8
+
9
+
## Build, Test, and Development Commands
10
+
-`poetry install` sets up the Python environment with Flask, Waitress, and PyYAML.
11
+
-`poetry run tiklocal ~/MediaLibrary` launches the server against a local media directory; add `--port 9000` to test alternative ports.
12
+
-`npm run build-css` watches Tailwind sources and regenerates `static/output.css` while you iterate on UI changes.
13
+
-`npm run build-css-prod` minifies Tailwind output for release builds; run before publishing or creating screenshots.
14
+
15
+
## Coding Style & Naming Conventions
16
+
- Follow PEP 8: four-space indentation, snake_case for functions, and PascalCase only for classes or dataclasses.
17
+
- Keep Flask views lightweight; move shared helpers into module-level functions or new files in `tiklocal/` when they grow.
18
+
- Use explicit imports and type hints for new utilities; mirror existing docstring style for user-facing helpers.
19
+
- For templates, stick to descriptive block names (`content`, `sidebar`) and keep inline scripts minimal.
20
+
21
+
## Testing Guidelines
22
+
- No automated suite ships today; add `tests/` with `pytest` fixtures that exercise key routes via Flask’s test client.
23
+
- Run prospective suites with `poetry run pytest`; prefer temporary media directories created under `tmp_path`.
24
+
- Perform manual smoke tests by running `poetry run tiklocal <media_path>` and browsing `/`, `/gallery`, and `/browse`.
25
+
26
+
## Commit & Pull Request Guidelines
27
+
- Match the existing history: short, imperative messages (`fix: 调整视频播放布局`, `Release v0.4.0 …`); include scope prefixes when they clarify intent.
28
+
- Each PR should explain the problem, list functional changes, and link issues; attach screenshots or clips for UI updates.
29
+
- Confirm local testing (`tiklocal` run, Tailwind build, pytest when available) in the PR description and call out config files touched.
30
+
31
+
## Configuration Tips
32
+
- Accept `MEDIA_ROOT`, `TIKLOCAL_HOST`, and `TIKLOCAL_PORT` via env vars or `~/.config/tiklocal/config.yaml`; document defaults in PRs when they change.
33
+
- Keep large media samples out of the repo—reference relative paths (e.g., `~/Videos/demo`) in examples instead.
0 commit comments