Commit Graph

7 Commits

Author SHA1 Message Date
primal
efb246ff1e Add routes.go and main.go - Phase 4 complete
routes.go: HTTP route registration with OAuth middleware
- Converted all handlers from (c *Crawler) to (d *Dashboard)
- Removed url.1440.news short URL handling (belongs in shortener service)
- Removed /internal/crawl endpoint (requires crawler)

main.go: Entry point for standalone dashboard service
- Uses NewDashboard with connection string from DATABASE_URL
- Starts stats update loop and HTTP server
2026-02-02 12:59:22 -05:00
primal
4f9e727571 Add api_domains.go - domain API handlers for standalone dashboard
Migrated from app/api_domains.go with these changes:
- Changed receiver from (c *Crawler) to (d *Dashboard)
- Use shared.ParseSearchPrefix, shared.ParseSearchTerm, shared.SearchQuery
- Use shared.StripTLD, shared.GetTLD, shared.NormalizeHost, shared.StringValue
- handleAPIPriorityCrawl returns NotImplemented (requires crawler)
- handleAPISetDomainStatus for 'skip' returns NotImplemented (requires PDS)
- handleAPIDenyDomain, handleAPIDropDomain, handleAPIUndenyDomain return
  NotImplemented (require PDS operations)
2026-02-02 12:57:46 -05:00
primal
53919fa31e Add OAuth files - authentication system
Migrated from app/:
- oauth.go - OAuthManager, config loading, handle/DID resolution
- oauth_session.go - SessionStore, encrypted cookies, token storage
- oauth_middleware.go - RequireAuth middleware, token refresh
- oauth_handlers.go - Login, callback, logout, JWKS endpoints

Changed *DB to *shared.DB, using shared.StringValue/NullableString helpers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:48:23 -05:00
primal
8a12713221 Add static files - CSS and JS
Copied from app/static/:
- dashboard.css (4.7KB)
- dashboard.js (41KB)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:45:08 -05:00
primal
1a627ea8de Add templates.go - HTML templates and handlers
Migrated from app/templates.go:
- PDSAccount type
- handleAccountsDirectory - public accounts listing page
- handleDashboard - main dashboard page
- handleAPIStats - JSON stats endpoint
- accountsDirectoryHTML and dashboardHTML templates

Note: handleRedirect not migrated - belongs in shortener service.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:44:21 -05:00
primal
a998168c59 Add dashboard.go - stats types and calculation
Migrated from app/dashboard.go:
- Dashboard struct with DB connection and stats caching
- DashboardStats, TLDStat, RecentFeed, DomainStat types
- Stats calculation methods (collectDomainStats, collectFeedStats)
- Background stats update loop

Note: Runtime rates (domains/min, etc.) not available in standalone
dashboard - these are crawler-specific metrics.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:42:17 -05:00
primal
94d2e725f5 Initial dashboard service scaffold
Infrastructure files for standalone dashboard service.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:39:13 -05:00