homescreen-hero
CLAUDE.md198 starsChanged 10 months agoMITView on GitHub
A self-hosted Plex companion app that automatically rotates collections on the homescreen via a FastAPI + React dashboard. Backend: Python 3.9+, FastAPI, SQLite, Pydantic Frontend: React 19, TypeScript, Vite, Tailwind CSS, Recharts Testing: pytest (backend), Vitest (frontend) Deployment: Docker, Docker Compose Prefer # hash comments over docstrings. Keep code readable through good naming and inline # comments where needed. Docstrings ("""...""") are acceptable for: - Public API endpoints that external users consume - Complex utility functions that are reused across…
- Reads credentials
- Installs packages
In this repository2 other files it gives its agents.
- design-engineerSkill
- tautulli-analyticsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 113
Prefer
#hash comments over docstrings: Keep code readable through good naming and inline # comments where needed. - Very specific: line 153
When backend is running: http://localhost:8000/docs (Swagger UI)
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
homescreen-hero
A self-hosted Plex companion app that automatically rotates collections on the homescreen via a FastAPI + React dashboard.
Tech Stack
Backend: Python 3.9+, FastAPI, SQLite, Pydantic Frontend: React 19, TypeScript, Vite, Tailwind CSS, Recharts Testing: pytest (backend), Vitest (frontend) Deployment: Docker, Docker Compose
Project Structure
homescreen-hero/
├── homescreen_hero/ # Python backend (FastAPI)
│ ├── core/ # Business logic
│ │ ├── config/ # YAML config loading & schema
│ │ ├── db/ # SQLite models & database operations
│ │ ├── integrations/ # External API clients (Plex, Trakt, MDBList, Tautulli, Letterboxd)
│ │ ├── auth.py # Authentication
│ │ ├── rotation.py # Collection rotation logic
│ │ ├── scheduler.py # Background task scheduling
│ │ └── service.py # Core service orchestration
│ ├── web/ # FastAPI web layer
│ │ ├── routers/ # API route handlers
│ │ └── app.py # FastAPI app entry point
│ ├── requirements.txt # Production dependencies
│ └── requirements-dev.txt # Test dependencies
├── homescreen-hero-ui/ # React frontend
│ └── src/ # React components, hooks, pages
├── data/ # Runtime data (config.yaml, SQLite DB, logs)
└── docker-compose.ymlCommon Commands
Backend
# Activate venv (from homescreen_hero directory)
.venv\Scripts\activate # Windows
source .venv/bin/activate # Linux/Mac
# Run backend dev server
uvicorn homescreen_hero.web.app:app --reload --port 8000
# Run tests
pytest
# Run tests with coverage
pytest --cov=homescreen_hero --cov-report=htmlFrontend
cd homescreen-hero-ui
# Install dependencies
npm install
# Run dev server (port 5173)
npm run dev
# Run tests
npm test # Watch mode
npm run test:run # Single run
npm run test:ui # With UI
# Build
npm run build
# Lint
npm run lintDocker
# Start app
docker-compose up -d
# View logs
docker-compose logs -f
# Rebuild
docker-compose up -d --buildGit Workflow
- Main branch:
develop - Feature branches:
feature-* - Bugfix branches:
fix-* - PRs target
develop - Releases are tagged from
develop(e.g.,v0.4.0) - Nightly Docker builds from
develop
Code Style
Python
- Type hints preferred
- Pydantic models for request/response schemas
- Config schema defined in
homescreen_hero/core/config/schema.py - Logging via
homescreen_hero/core/logging_config.py
TypeScript/React
- Functional components with hooks
- Tailwind CSS for styling
- Headless UI for accessible components
- Lucide React for icons
Comments
Prefer # hash comments over docstrings. Keep code readable through good naming and inline # comments where needed.
Docstrings ("""...""") are acceptable for:
- Public API endpoints that external users consume
- Complex utility functions that are reused across the codebase
- Functions where IDE hover tooltips would genuinely help
Avoid:
- Docstrings on every function just for the sake of documentation
- Comments that describe what code does (the code should be self-explanatory)
- Redundant comments that repeat the function/variable name
Good:
# Retry up to 3 times because Plex API occasionally drops connections
for attempt in range(3):
...Bad:
def get_collections():
"""Gets the collections.""" # Redundant, adds no value
...Key Integrations
| Integration | Client File | Purpose |
| Plex | core/integrations/plex_client.py | Core functionality - library & collection management |
| Trakt | core/integrations/trakt_client.py | Third-party list sync |
| MDBList | core/integrations/mdblist_client.py | Third-party list sync |
| Tautulli | core/integrations/tautulli_client.py | Analytics & streaming metrics |
| TMDb | core/integrations/tmdb_client.py | Third-party list sync |
| Letterboxd | core/integrations/letterboxd_scraper.py | List scraping |
| AniList | core/integrations/anilist_client.py | Anime list sync |
API Documentation
When backend is running: http://localhost:8000/docs (Swagger UI)
Environment Variables
Sensitive values go in .env (not committed):
HSH_PLEX_TOKEN- Plex auth tokenHSH_PLEX_URL- Plex server URLHSH_AUTH_PASSWORD- Admin passwordHSH_AUTH_SECRET_KEY- JWT secretHSH_TRAKT_CLIENT_ID- Trakt API client IDHSH_MDBLIST_API_KEY- MDBList API keyHSH_TMDB_API_KEY- TMDb API keyHSH_TAUTULLI_API_KEY- Tautulli API keyHSH_TAUTULLI_BASE_URL- Tautulli server URL
Testing Notes
- Backend tests:
homescreen_hero/tests/ - Frontend tests:
homescreen-hero-ui/src/**/*.test.{ts,tsx} - See
TESTING.mdfor detailed testing documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

