Files
portfolioJournalWeb/AGENTS.md
T
alexandrev-tibco 63cfbcdee1 GA integration
2026-02-04 14:07:00 +01:00

2.2 KiB

Repository Guidelines

Project Structure & Module Organization

  • Root HTML: index.html, about.html, privacy.html, terms.html, etc.
  • assets/: site resources
    • assets/js/main.js, assets/js/config.js
    • assets/css/style.css
    • assets/images/, assets/icons/
  • og-service/: Go service generating Open Graph share pages (/share) and images (/og) with a Makefile and README.md.

Build, Test, and Development Commands

  • Static site (serve locally): python3 -m http.server 8000 in repo root, then open http://localhost:8000/.
  • OG service:
    • cd og-service && make run — run on PORT (default 8090).
    • cd og-service && make build — build to og-service/bin/portfoliojournal-og.
    • cd og-service && make clean — remove build artifacts.

Coding Style & Naming Conventions

  • HTML/CSS: 2-space indent; semantic markup; class names kebab-case.
  • JavaScript: 2-space indent, semicolons, camelCase for variables/functions; avoid new globals (use CONFIG and module patterns).
  • Go: follow gofmt; keep functions small, cohesive; prefer explicit names.

Testing Guidelines

  • No unit tests in repo; validate manually.
  • Static site: verify navigation highlighting, dark mode toggle, cookie notice, and lazy-loaded images.
  • OG service quick check:
    • DATA='{"n":"Car","r":12500,"g":20000,"c":"USD","td":"2026-12-31"}'
    • ENC=$(python3 - <<'PY'\nimport base64,sys;print(base64.urlsafe_b64encode(sys.stdin.read().encode()).decode().rstrip('='))\nPY <<< "$DATA")
    • curl "http://localhost:8090/share?data=$ENC"
    • curl -o og.png "http://localhost:8090/og?data=$ENC"

Commit & Pull Request Guidelines

  • Commits: concise, imperative subjects (e.g., fix: correct dark mode label). Conventional Commits encouraged.
  • PRs: clear description, linked issues, before/after screenshots for UI, local test steps (site + OG endpoints), and any config changes noted.

Security & Configuration Tips

  • Edit assets/js/config.js for site metadata; keep ENABLE_ANALYTICS false unless configured.
  • og-service reads PORT; deploy behind a reverse proxy (see og-service/README.md).
  • Do not commit secrets; use system service file og-service/portfoliojournal-og.openrc for Alpine/OpenRC setups.