aboutsummaryrefslogtreecommitdiffstats
path: root/packages/api/index.ts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* feat: Add automated bookmark backup feature (#2182)Mohamed Bassem2025-11-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: Add automated bookmark backup system Implements a comprehensive automated backup feature for user bookmarks with the following capabilities: Database Schema: - Add backupSettings table to store user backup preferences (enabled, frequency, retention) - Add backups table to track backup records with status and metadata - Add BACKUP asset type for storing compressed backup files - Add migration 0066_add_backup_tables.sql Background Workers: - Implement BackupSchedulingWorker cron job (runs daily at midnight UTC) - Create BackupWorker to process individual backup jobs - Deterministic scheduling spreads backup jobs across 24 hours based on user ID hash - Support for daily and weekly backup frequencies - Automated retention cleanup to delete old backups based on user settings Export & Compression: - Reuse existing export functionality for bookmark data - Compress exports using Node.js built-in zlib (gzip level 9) - Store compressed backups as assets with proper metadata - Track backup size and bookmark count for statistics tRPC API: - backups.getSettings - Retrieve user backup configuration - backups.updateSettings - Update backup preferences - backups.list - List all user backups with metadata - backups.get - Get specific backup details - backups.delete - Delete a backup - backups.download - Download backup file (base64 encoded) - backups.triggerBackup - Manually trigger backup creation UI Components: - BackupSettings component with configuration form - Enable/disable automatic backups toggle - Frequency selection (daily/weekly) - Retention period configuration (1-365 days) - Backup list table with download and delete actions - Manual backup trigger button - Display backup stats (size, bookmark count, status) - Added backups page to settings navigation Technical Details: - Uses Restate queue system for distributed job processing - Implements idempotency keys to prevent duplicate backups - Background worker concurrency: 2 jobs at a time - 10-minute timeout for large backup exports - Proper error handling and logging throughout - Type-safe implementation with Zod schemas * refactor: simplify backup settings and asset handling - Move backup settings from separate table to user table columns - Update BackupSettings model to use static methods with users table - Remove download mutation in favor of direct asset links - Implement proper quota checks using QuotaService.checkStorageQuota - Update UI to use new property names and direct asset downloads - Update shared types to match new schema Key changes: - backupSettingsTable removed, settings now in users table - Backup downloads use direct /api/assets/{id} links - Quota properly validated before creating backup assets - Cleaner separation of concerns in tRPC models * migration * use zip instead of gzip * fix drizzle * fix settings * streaming json * remove more dead code * add e2e tests * return backup * poll for backups * more fixes * more fixes * fix test * fix UI * fix delete asset * fix ui * redirect for backup download * cleanups * fix idempotency * fix tests * add ratelimit * add error handling for background backups * i18n * model changes --------- Co-authored-by: Claude <noreply@anthropic.com>
* feat: add GET /api/version endpoint (#2167)Mohamed Bassem2025-11-231-0/+2
| | | | | | | | | Implements a new API endpoint that returns the server version from serverConfig. This will be used for Home Assistant integration to check for updates. Fixes #2148 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Mohamed Bassem <MohamedBassem@users.noreply.github.com>
* fix: fix move the admin route to the /v1 prefixMohamed Bassem2025-08-271-1/+1
|
* fix(tests): Load plugins on API package entrypointMohamedBassem2025-07-271-0/+3
|
* feat: Support NO_COLOR for logging. Fixes #1778MohamedBassem2025-07-271-2/+7
|
* feat: Add stripe based subscriptionsMohamed Bassem2025-07-131-1/+3
|
* feat(api): Expose the update user API in the openapi specsMohamed Bassem2025-07-121-0/+2
|
* feat: Add support for email verificationMohamed Bassem2025-07-101-6/+8
|
* fix(api): Fix handling for CORS after the trpc move to hono. Fixes #1709Mohamed Bassem2025-07-101-0/+6
|
* feat: Add prometheus monitoring. Fixes #758Mohamed Bassem2025-07-061-1/+4
|
* refactor: Move the health endpoint to hono as wellMohamed Bassem2025-07-041-0/+2
|
* refactor: Move the trpc endpoint to honoMohamed Bassem2025-07-041-0/+2
|
* feat: Add support for public lists (#1511)Mohamed Bassem2025-06-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP: public lists * Drop viewing modes * Add the public endpoint for assets * regen the openapi spec * proper handling for different asset types * Add num bookmarks and a no bookmark banner * Correctly set page title * Add a not-found page * merge the RSS and public list endpoints * Add e2e tests for the public endpoints * Redesign the share list modal * Make NEXTAUTH_SECRET not required * propery render text bookmarks * rebase migration * fix public token tests * Add more tests
* feat: Generate RSS feeds from lists (#1507)Mohamed Bassem2025-05-311-1/+3
| | | | | | | | | | | * refactor: Move bookmark utils from shared-react to shared * Expose RSS feeds for lists * Add e2e tests * Slightly improve the look of the share dialog * allow specifying a limit in the rss endpoint
* refactor: Migrate from NextJs's API routes to Hono based routes for the API ↵Mohamed Bassem2025-05-181-0/+46
(#1432) * Setup Hono and migrate the highlights API there * Implement the tags and lists endpoint * Implement the bookmarks and users endpoints * Add the trpc error code adapter * Remove the old nextjs handlers * fix api key not found handling * Fix trpc error handling * Fix 204 handling * Fix search ordering * Implement the singlefile endpoint * Implement the asset serving endpoints * Implement webauth * Add hono as a catch all route under api * fix tests