cmd/server: Go entrypoint wiring config, DB, thumbnail worker, and HTTP router.internal/: domain packages; key folders:config,db(GORM models/store),scanner(directory sync + fingerprinting),server(Gin handlers/router),thumbnail(ffmpeg-backed jobs),logging(shared logger).web/: React + Tailwind frontend (Vite). Components inweb/src/components, state inweb/src/store.js, API helpers inweb/src/api.js.scripts/:cli/stores CLI sources;scripts/cli.shlaunches the bundled CLI fromscripts/cli/build/and auto-builds if missing.data/: runtime DB/thumbnails; keep generated files out of commits.
- Backend:
go run ./cmd/server -addr :17654 -static web/distto serve API (and built frontend when desired). - Dev helper:
scripts/cli.sh dev backend|frontend(flags:WITH_STATIC=1,SKIP_NPM_INSTALL=1, etc.). - Tests:
GOCACHE=$(pwd)/.gocache go test ./...(no Go tests yet—keep it green). - Frontend (in
web/):npm install;npm run devfor Vite,npm run lint,npm run buildfor prod bundle. - CLI build:
cd scripts/cli && npm install && npm run build(outputsscripts/cli/build/pornboss-cli.cjs). - Release:
scripts/cli.sh release linux-x86_64 v0.1.0builds backend +web/distand archives torelease/.
- Go: run
gofmt -wand keep imports/go mod tidy; use context as first arg, return wrapped errors with lower-case messages, and log viainternal/common/logging. Keep package names lowercase and files scoped to their package. - Frontend: functional React components in PascalCase (
VideoGrid.jsx), hooks/helpers camelCase. Keep styles in Tailwind/index.css; prefer colocated component styles. Format withnpm run format/npm run format:check; lint withnpm run lint. - Naming: API routes are RESTful (
/videos,/tags,/directories); keep new endpoints consistent and document query params.
- Go: add table-driven
_test.gofiles near the code under test; prefer integration tests aroundinternal/dband handler tests viahttptest. Use the repo-localGOCACHEpath. - Frontend: no unit tests today; at minimum run
npm run lintandnpm run buildbefore PRs. When adding tests, colocate underweb/srcusing Jest/Vitest conventions and match component names.