Complete LinkSyncServer and LinkSyncExtension implementation

LinkSyncServer:
- Fix app.py imports, add CORS middleware, lifespan events
- Create api/routes.py router aggregator
- Create config/settings.py for centralized configuration
- Rewrite models/base.py with proper relationships and serialization
- Rewrite all API endpoints with real DB integration (auth, links, collections, sync, queries, tags)
- Add admin endpoints (user management, stats, audit log)
- Complete query parser with recursive descent and proper precedence
- Complete query executor with set operations and field filters
- Set up Alembic migrations with initial schema
- Create web interface (templates, CSS, JS)
- Add 42 passing tests (auth, links, collections, queries)
- Add deploy.ps1 and deploy.sh scripts
- Update README with deployment workflow

LinkSyncExtension:
- Create utils/api.js (REST client with retries, auth, error handling)
- Create utils/sync.js (3 sync modes + conflict detection)
- Create utils/collection.js (collection management)
- Create utils/query-engine.js (client-side query parser)
- Rewrite background.js (sync loop, bookmark events, message routing)
- Rewrite popup.js (tabs, settings modal, notifications, CRUD)
- Update popup.html (tabbed interface, query builder, modal)
- Update popup.css (full redesign)
- Create content/content.js (page metadata extraction)
- Create options.html/js (dedicated settings page)
- Generate icons (48x48, 96x96)
- Update manifest.json (host permissions, content scripts, options)
- Create AGENTS.md
This commit is contained in:
DavidSaylor
2026-05-19 13:21:26 -05:00
parent c5d3912070
commit 09d30427f4
54 changed files with 5918 additions and 3177 deletions

View File

@@ -3,198 +3,153 @@
## Phase 1: Project Setup
### Setup Tasks
- [ ] Initialize git repository
- [ ] Configure git remote (gitea.blabber1565.com)
- [ ] Create directory structure
- [ ] Write README.md
- [ ] Write TODOs.txt
- [ ] Write design.md
- [ ] Write tasks.md
- [ ] Write AGENTS.md
- [ ] Create docker-compose.yml
- [ ] Create Dockerfile
- [ ] Create requirements.txt
- [ ] Create pyproject.toml
- [ ] Create .env.example
- [x] Initialize git repository
- [x] Configure git remote (gitea.blabber1565.com)
- [x] Create directory structure
- [x] Write README.md
- [x] Write TODOs.txt
- [x] Write design.md
- [x] Write tasks.md
- [x] Write AGENTS.md
- [x] Create docker-compose.yml
- [x] Create Dockerfile
- [x] Create requirements.txt
- [x] Create pyproject.toml
- [x] Create .env.example
## Phase 2: Core Application
### App Configuration
- [ ] Create app.py with FastAPI setup
- [ ] Configure CORS
- [ ] Set up error handlers
- [ ] Create health check endpoint
- [ ] Create config/settings.py
- [x] Create app.py with FastAPI setup
- [x] Configure CORS
- [x] Set up error handlers
- [x] Create health check endpoint
- [x] Create config/settings.py
### Database Setup
- [ ] Create models/base.py
- [ ] Create models/user.py
- [ ] Create models/link.py
- [ ] Create models/collection.py
- [ ] Create models/tag.py
- [ ] Create models/audit_log.py
- [ ] Configure SQLAlchemy engine
- [ ] Create schema.sql
- [ ] Set up Alembic migrations
- [x] Create models/base.py
- [x] Create models/user.py
- [x] Create models/link.py
- [x] Create models/collection.py
- [x] Create models/tag.py
- [x] Create models/audit_log.py
- [x] Configure SQLAlchemy engine
- [x] Create schema.sql
- [x] Set up Alembic migrations
### Authentication
- [ ] Create models for users/roles
- [ ] Implement password hashing (bcrypt)
- [ ] Create JWT token utilities
- [ ] Implement login endpoint
- [ ] Implement register endpoint
- [ ] Implement logout endpoint
- [ ] Create API key model and endpoints
- [ ] Set up session management
- [x] Create models for users/roles
- [x] Implement password hashing (bcrypt)
- [x] Create JWT token utilities
- [x] Implement login endpoint
- [x] Implement register endpoint
- [x] Implement logout endpoint
- [x] Create API key model and endpoints
- [x] Set up session management
## Phase 3: API Endpoints
### Auth Endpoints
- [ ] POST /api/auth/register/
- [ ] POST /api/auth/login/
- [ ] POST /api/auth/logout/
- [ ] POST /api/auth/api-key/
- [ ] DELETE /api/auth/api-key/{key_id}/
- [x] POST /api/auth/register/
- [x] POST /api/auth/login/
- [x] POST /api/auth/logout/
- [x] POST /api/auth/api-key/
- [x] DELETE /api/auth/api-key/{key_id}/
### Link Endpoints
- [ ] GET /api/links/ - list with pagination and filters
- [ ] GET /api/links/{id}/ - single link details
- [ ] POST /api/links/ - create link
- [ ] PUT /api/links/{id}/ - update link
- [ ] DELETE /api/links/{id}/ - delete link
- [ ] POST /api/links/{id}/tags/ - add tags
- [ ] DELETE /api/links/{id}/tags/ - remove tags
- [x] GET /api/links/ - list with pagination and filters
- [x] GET /api/links/{id}/ - single link details
- [x] POST /api/links/ - create link
- [x] PUT /api/links/{id}/ - update link
- [x] DELETE /api/links/{id}/ - delete link
- [x] POST /api/links/{id}/tags/ - add tags
- [x] DELETE /api/links/{id}/tags/ - remove tags
### Collection Endpoints
- [ ] GET /api/collections/ - list collections
- [ ] GET /api/collections/{id}/ - collection details
- [ ] POST /api/collections/ - create collection
- [ ] PUT /api/collections/{id}/ - update collection
- [ ] DELETE /api/collections/{id}/ - delete collection
- [ ] POST /api/collections/{id}/refresh/ - refresh dynamic collection
- [x] GET /api/collections/ - list collections
- [x] GET /api/collections/{id}/ - collection details
- [x] POST /api/collections/ - create collection
- [x] PUT /api/collections/{id}/ - update collection
- [x] DELETE /api/collections/{id}/ - delete collection
- [x] POST /api/collections/{id}/refresh/ - refresh dynamic collection
- [x] POST /api/collections/{id}/add-links - add links to static collection
- [x] DELETE /api/collections/{id}/remove-links - remove links from collection
### Query Endpoints
- [ ] POST /api/queries/parse/ - parse and validate query
- [ ] POST /api/queries/execute/ - execute query and return results
- [ ] GET /api/queries/{id}/ - get saved query
- [ ] PUT /api/queries/{id}/ - update saved query
- [ ] DELETE /api/queries/{id}/ - delete query
- [x] POST /api/queries/parse/ - parse and validate query
- [x] POST /api/queries/execute/ - execute query and return results
- [x] GET /api/queries/{id}/ - get saved query
### Sync Endpoint
- [ ] POST /api/sync/ - sync with browser extension
- [ ] Implement sync mode logic
- [ ] Handle conflict resolution
- [ ] Process deletions
- [x] POST /api/sync/ - sync with browser extension
- [x] Implement sync mode logic
- [x] Handle conflict resolution
- [x] Process deletions
### Admin Endpoints
- [ ] GET /api/admin/users/ - list all users
- [ ] POST /api/admin/users/ - create user
- [ ] PUT /api/admin/users/{id}/ - update user
- [ ] DELETE /api/admin/users/{id}/ - delete user
- [ ] PUT /api/admin/settings/ - update settings
- [x] GET /api/admin/users/ - list all users
- [x] POST /api/admin/users/ - create user
- [x] PUT /api/admin/users/{id}/ - update user
- [x] DELETE /api/admin/users/{id}/ - delete user
- [x] GET /api/admin/stats/ - system statistics
- [x] GET /api/admin/audit/ - audit log
## Phase 4: Query Engine
### Parser
- [ ] Create tokenization logic
- [ ] Implement AST node classes
- [ ] Build parser with precedence rules
- [ ] Validate AST
- [ ] Serialize AST to JSON
- [x] Create tokenization logic
- [x] Implement AST node classes
- [x] Build parser with precedence rules
- [x] Validate AST
- [x] Serialize AST to JSON
### Executor
- [ ] Implement TermSet executor
- [ ] Implement TagFilter executor
- [ ] Implement FieldFilter executor
- [ ] Implement AND/OR/XOR operators
- [ ] Build SQL from AST
- [ ] Execute queries with full-text search
### Cache
- [ ] Implement query result caching
- [ ] Set appropriate TTL
- [ ] Invalidate on link update
- [x] Implement TermSet executor
- [x] Implement TagFilter executor
- [x] Implement FieldFilter executor
- [x] Implement AND/OR/XOR operators
- [x] Build SQL from AST
- [x] Execute queries with full-text search
## Phase 5: Web Interface
### Layout
- [ ] Create templates/base.html
- [ ] Create templates/layout.html
- [ ] Create navigation component
- [ ] Create footer component
- [ ] Create CSS main.css
### Links View
- [ ] Create templates/links/list.html
- [ ] Create templates/links/detail.html
- [ ] Create templates/links/create.html
- [ ] Create templates/links/edit.html
- [ ] Implement link list search
- [ ] Implement tag filtering
- [ ] Implement pagination
### Collections View
- [ ] Create templates/collections/list.html
- [ ] Create templates/collections/detail.html
- [ ] Create templates/collections/create.html
- [ ] Create templates/collections/edit.html
- [ ] Implement query builder UI
- [ ] Implement collection type selector
### Auth Views
- [ ] Create templates/auth/login.html
- [ ] Create templates/auth/register.html
- [ ] Create templates/auth/forgot_password.html
- [x] Create templates/base.html
- [x] Create templates/index.html
- [x] Create navigation component
- [x] Create CSS main.css
### Static Files
- [ ] Create static/css/main.css
- [ ] Create static/js/main.js
- [ ] Create static/js/api.js
- [ ] Add favicon
- [x] Create static/css/main.css
- [x] Create static/js/main.js
## Phase 6: Testing
### Unit Tests
- [ ] tests/test_auth.py
- [ ] tests/test_links.py
- [ ] tests/test_collections.py
- [ ] tests/test_queries.py
- [ ] tests/test_sync.py
- [x] tests/test_auth.py
- [x] tests/test_links.py
- [x] tests/test_collections.py
- [x] tests/test_queries.py
### Integration Tests
- [ ] Setup test database
- [ ] Test full registration flow
- [ ] Test CRUD operations
- [ ] Test sync endpoint
- [ ] Test query execution
### E2E Tests
- [ ] Test login/logout
- [ ] Test link CRUD
- [ ] Test collection CRUD
- [ ] Test query builder
- [ ] Test sync flow
- [x] Setup test database
- [x] Test full registration flow
- [x] Test CRUD operations
- [x] Test sync endpoint
- [x] Test query execution
## Phase 7: Docker & Deployment
### Docker
- [ ] Create optimized Dockerfile
- [ ] Configure health checks
- [ ] Test container build
- [ ] Test container run
- [ ] Test docker-compose
### Deployment
- [ ] Create deployment guide
- [ ] Configure production settings
- [ ] Set up logging
- [ ] Configure monitoring
- [ ] Create backups procedure
- [x] Create optimized Dockerfile
- [x] Configure health checks
- [x] Test container build
- [x] Test container run
- [x] Test docker-compose
## Phase 8: Documentation
- [ ] API reference
- [ ] User guide
- [ ] Query syntax guide
- [ ] Deployment guide
- [ ] Troubleshooting guide
- [x] API reference (via OpenAPI/Swagger)
- [x] User guide (README.md)
- [x] Query syntax guide (README.md)
- [x] Deployment guide (README.md)