diff --git a/PLAN.md b/PLAN.md index abffd94..79c18bc 100644 --- a/PLAN.md +++ b/PLAN.md @@ -10,18 +10,24 @@ A self-hosted error tracking application (inspired by [Bugsink](https://www.bugs | Database | SQLite (dev), easily swappable to Postgres/MySQL | | Frontend | Blade + Tailwind CSS 4 + Vite 8 | | Queue | Database driver (upgrade to Redis for production) | -| Auth | Laravel Breeze (to be installed) | +| Auth | Laravel Breeze (installed) | --- ## Phase 1 — Foundation & Auth ### 1.1 Install Auth Scaffolding -- Install Laravel Breeze (Blade + Tailwind stack) for login, registration, password reset, email verification. -- This gives us the authenticated layout, middleware, and user management out of the box. +- [x] Install Laravel Breeze (Blade + Tailwind stack) for login, registration, password reset, email verification. +- [x] Authenticated layout, middleware, and user management. ### 1.2 Core Data Models & Migrations +- [x] `projects` migration & `Project` model +- [x] `project_user` pivot migration +- [x] `issues` migration & `Issue` model +- [x] `events` migration & `Event` model +- [x] `User` model updated with `projects()` and `ownedProjects()` relationships + #### `projects` table | Column | Type | Notes | |--------|------|-------| @@ -89,13 +95,18 @@ A self-hosted error tracking application (inspired by [Bugsink](https://www.bugs Implement a `/api/{project_id}/store/` endpoint that accepts the Sentry event payload format. This allows using existing Sentry SDKs (for PHP, JS, Python, etc.) as clients without any custom SDK work. -- **Route:** `POST /api/{project_id}/store/` -- **Auth:** Validate DSN public key via `sentry_key` query param or `X-Sentry-Auth` header. -- **Rate limiting:** Per-project throttle (e.g. 100 events/minute). -- **No user auth required** — this is an SDK-to-server API. +- [ ] `POST /api/{project_id}/store/` route +- [ ] Validate DSN public key via `sentry_key` query param or `X-Sentry-Auth` header +- [ ] `AuthenticateDsn` middleware +- [ ] `EventIngestController` ### 2.2 Event Processing Pipeline +- [ ] `ProcessEventJob` (queued) +- [ ] `PayloadNormalizer` service +- [ ] `EventProcessor` service (find or create Issue, store Event, update counters) +- [ ] Regression detection (re-open resolved issues) + ``` Ingest Request → Authenticate DSN key @@ -111,6 +122,8 @@ Ingest Request ### 2.3 Fingerprinting / Grouping Strategy +- [ ] `Fingerprinter` service + Group events into issues using a fingerprint hash built from: 1. Exception type (class name) 2. Exception message (with variable parts stripped, e.g. IDs, numbers) @@ -132,45 +145,45 @@ Clients configure this DSN in their Sentry SDK — no changes needed on the SDK ### 3.1 Layouts & Navigation -- Authenticated layout with sidebar navigation. -- Global project switcher in the sidebar/topbar. -- Sections: **Issues**, **Project Settings**, **Team Members**. +- [ ] Authenticated layout with sidebar navigation +- [ ] Global project switcher in the sidebar/topbar +- [ ] Sections: **Issues**, **Project Settings**, **Team Members** ### 3.2 Issues List Page (`/projects/{project}/issues`) -- Table/list of issues sorted by last seen (most recent first). -- Columns: status badge, title, culprit, event count sparkline, times seen, last seen. -- Filters: status (unresolved/resolved/ignored), level, environment, date range. -- Search: full-text search on title and culprit. -- Bulk actions: resolve, ignore, mute, delete. -- Pagination (cursor-based for performance). +- [ ] Table/list of issues sorted by last seen (most recent first) +- [ ] Columns: status badge, title, culprit, event count sparkline, times seen, last seen +- [ ] Filters: status (unresolved/resolved/ignored), level, environment, date range +- [ ] Search: full-text search on title and culprit +- [ ] Bulk actions: resolve, ignore, mute, delete +- [ ] Pagination (cursor-based for performance) ### 3.3 Issue Detail Page (`/projects/{project}/issues/{issue}`) -- Header: title, status controls (resolve / ignore / unresolve), level badge, first/last seen, times seen. -- **Stacktrace viewer:** collapsible frames, source context (if available), highlighted app frames vs vendor frames. -- **Breadcrumbs timeline:** chronological list of breadcrumb entries. -- **Tags panel:** key-value tag list with links to filter by tag. -- **Context panels:** device, OS, browser, runtime, user info, request details. -- **Events sub-list:** paginated list of individual occurrences with ability to view each one. -- **Activity:** timeline of status changes (resolved, regressed, etc.). +- [ ] Header: title, status controls (resolve / ignore / unresolve), level badge, first/last seen, times seen +- [ ] **Stacktrace viewer:** collapsible frames, source context (if available), highlighted app frames vs vendor frames +- [ ] **Breadcrumbs timeline:** chronological list of breadcrumb entries +- [ ] **Tags panel:** key-value tag list with links to filter by tag +- [ ] **Context panels:** device, OS, browser, runtime, user info, request details +- [ ] **Events sub-list:** paginated list of individual occurrences with ability to view each one +- [ ] **Activity:** timeline of status changes (resolved, regressed, etc.) ### 3.4 Event Detail Page (`/projects/{project}/issues/{issue}/events/{event}`) -- Full event data: raw JSON viewer + structured panels. -- Navigation: previous/next event within the issue. +- [ ] Full event data: raw JSON viewer + structured panels +- [ ] Navigation: previous/next event within the issue ### 3.5 Project Settings Page -- Rename project, change platform. -- DSN display with copy button. -- Regenerate keys. -- Delete project (with confirmation). +- [ ] Rename project, change platform +- [ ] DSN display with copy button +- [ ] Regenerate keys +- [ ] Delete project (with confirmation) ### 3.6 Dashboard / Overview Page -- Summary cards: total unresolved issues, events in last 24h, most active projects. -- Line chart: events over time (last 7/14/30 days). +- [ ] Summary cards: total unresolved issues, events in last 24h, most active projects +- [ ] Line chart: events over time (last 7/14/30 days) --- @@ -178,14 +191,14 @@ Clients configure this DSN in their Sentry SDK — no changes needed on the SDK ### 4.1 Notification Channels -- **Email:** on first occurrence of a new issue (not on every event). -- **Database (in-app):** notification bell with unread count. -- Extensible to Slack/webhooks later. +- [ ] **Email:** on first occurrence of a new issue (not on every event) +- [ ] **Database (in-app):** notification bell with unread count +- [ ] Extensible to Slack/webhooks later ### 4.2 Alert Rules (per project) -- Notify on: new issue, regression, spike (N events in M minutes). -- Per-user mute controls. +- [ ] Notify on: new issue, regression, spike (N events in M minutes) +- [ ] Per-user mute controls --- @@ -193,68 +206,68 @@ Clients configure this DSN in their Sentry SDK — no changes needed on the SDK ### 5.1 Release Tracking -- Parse `release` field from events. -- Show which release introduced an issue. -- Mark issues as resolved-in-release; auto-regress if they appear in a newer release. +- [ ] Parse `release` field from events +- [ ] Show which release introduced an issue +- [ ] Mark issues as resolved-in-release; auto-regress if they appear in a newer release ### 5.2 Environment Filtering -- Global environment selector (production / staging / etc.). -- Filter issues and events by environment. +- [ ] Global environment selector (production / staging / etc.) +- [ ] Filter issues and events by environment ### 5.3 Retention & Cleanup -- Artisan command / scheduled job to delete events older than N days (configurable). -- Keep issue summaries even after events are pruned. +- [ ] Artisan command / scheduled job to delete events older than N days (configurable) +- [ ] Keep issue summaries even after events are pruned ### 5.4 Source Maps / Source Context (optional, stretch) -- Upload source maps for JS projects. -- Store and display source context lines around each stacktrace frame. +- [ ] Upload source maps for JS projects +- [ ] Store and display source context lines around each stacktrace frame ### 5.5 API Tokens & External API -- Personal API tokens for programmatic access. -- REST API for listing/resolving issues (useful for CI/CD integrations). +- [ ] Personal API tokens for programmatic access +- [ ] REST API for listing/resolving issues (useful for CI/CD integrations) --- ## Implementation Order & Milestones ### Milestone 1 — MVP (walking skeleton) -1. Install Breeze, set up auth. -2. Create migrations for `projects`, `issues`, `events`, `project_user`. -3. Build models with relationships. -4. Build the ingest endpoint (`POST /api/{project_id}/store/`). -5. Implement fingerprinting and the `ProcessEventJob`. -6. Build a minimal issues list page and issue detail page. -7. Test with a real Sentry SDK (e.g. `sentry/sentry-laravel` on another app pointing at this tracker). +- [x] 1. Install Breeze, set up auth +- [x] 2. Create migrations for `projects`, `issues`, `events`, `project_user` +- [x] 3. Build models with relationships +- [ ] 4. Build the ingest endpoint (`POST /api/{project_id}/store/`) +- [ ] 5. Implement fingerprinting and the `ProcessEventJob` +- [ ] 6. Build a minimal issues list page and issue detail page +- [ ] 7. Test with a real Sentry SDK (e.g. `sentry/sentry-laravel` on another app pointing at this tracker) ### Milestone 2 — Usable product -8. Project CRUD and settings pages. -9. Team/member management (invite users to projects). -10. Stacktrace viewer with collapsible frames. -11. Breadcrumbs, tags, context panels on issue detail. -12. Filters, search, bulk actions on issues list. -13. Status management (resolve, ignore, mute, auto-regression detection). +- [ ] 8. Project CRUD and settings pages +- [ ] 9. Team/member management (invite users to projects) +- [ ] 10. Stacktrace viewer with collapsible frames +- [ ] 11. Breadcrumbs, tags, context panels on issue detail +- [ ] 12. Filters, search, bulk actions on issues list +- [ ] 13. Status management (resolve, ignore, mute, auto-regression detection) ### Milestone 3 — Notifications & dashboard -14. Email notifications on new issue / regression. -15. In-app notification system. -16. Overview dashboard with charts (events over time). +- [ ] 14. Email notifications on new issue / regression +- [ ] 15. In-app notification system +- [ ] 16. Overview dashboard with charts (events over time) ### Milestone 4 — Production-readiness -17. Rate limiting on ingest. -18. Event retention / cleanup scheduler. -19. Release tracking. -20. Environment filtering. -21. Performance optimization (indexes, query tuning, caching). +- [ ] 17. Rate limiting on ingest +- [ ] 18. Event retention / cleanup scheduler +- [ ] 19. Release tracking +- [ ] 20. Environment filtering +- [ ] 21. Performance optimization (indexes, query tuning, caching) ### Milestone 5 — Advanced (stretch) -22. Source map upload & processing. -23. API tokens & external REST API. -24. Webhook / Slack notifications. -25. CQRS-style read models for heavy dashboards (if needed). +- [ ] 22. Source map upload & processing +- [ ] 23. API tokens & external REST API +- [ ] 24. Webhook / Slack notifications +- [ ] 25. CQRS-style read models for heavy dashboards (if needed) ---