Skip to content

feat: add PostHog analytics, CI workflow, and deployment docs#7

Merged
diogohudson merged 4 commits intomainfrom
feat/posthog-ci-deployment
Mar 10, 2026
Merged

feat: add PostHog analytics, CI workflow, and deployment docs#7
diogohudson merged 4 commits intomainfrom
feat/posthog-ci-deployment

Conversation

@diogohudson
Copy link
Contributor

Summary

  • PostHog analytics on both UI (posthog-js) and API (posthog-python) — tracks secret creation, retrieval, copy, and error events
  • GitHub Actions CI workflow that runs API + UI tests with 99% coverage enforcement on every PR to main
  • README deployment section explaining Cloud (ooshare.io) vs On-Premise self-hosting

Changes

Area What
UI posthog-js with PostHogProvider, custom events in CreateSecret + ViewSecret
API posthog-python with server-side events, graceful disable when key not set
CI .github/workflows/ci.yaml — parallel API + UI test jobs with Redis service
Docs README updated with Cloud/On-Premise deployment options
Docker VITE_POSTHOG_KEY build arg in UI Dockerfile
Tests 4 new PostHog backend tests (32 total), all 66 UI tests pass

Env vars needed on Render

Service Variable Purpose
UI VITE_POSTHOG_KEY PostHog project API key (build-time)
API POSTHOG_API_KEY PostHog project API key (runtime)

Test plan

  • Verify CI workflow runs on this PR
  • Confirm PostHog events appear in dashboard after deploying with keys set
  • Verify app works normally when PostHog keys are not set (graceful disable)

🤖 Generated with Claude Code

diogohudson and others added 4 commits March 10, 2026 11:42
- Add posthog-js to UI with PostHogProvider and custom event tracking
  (secret_created, secret_viewed, secret_link_copied, etc.)
- Add posthog-python to API with server-side event tracking
  (secret_created, secret_retrieved) with graceful disable when key not set
- Add GitHub Actions CI workflow running API + UI tests on PRs to main
  with 99% coverage threshold enforcement
- Update README with Cloud vs On-Premise deployment section
- Add VITE_API_URL and VITE_POSTHOG_KEY build args to UI Dockerfile
- Add 4 new PostHog-related backend tests (32 total)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `new Uint8Array(raw)` instead of `raw.buffer` to avoid
SharedArrayBuffer issues in Node.js/jsdom environments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@diogohudson diogohudson merged commit 7522dad into main Mar 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant