Commit Graph

18 Commits

Author SHA1 Message Date
M1ngdaXie
731bd67334 Add self-hosted deployment configuration
- Add backend entry point (cmd/server/main.go)
- Add prompt=select_account to Google OAuth flow
- Add combined init.sql for self-hosted PostgreSQL
- Update docker-compose to include backend service with memory limits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 01:38:15 +00:00
M1ngdaXie
50822600ad feat: implement Redis Streams support with stream checkpoints and update history
- Added Redis Streams operations to the message bus interface and implementation.
- Introduced StreamCheckpoint model to track last processed stream entry per document.
- Implemented UpsertStreamCheckpoint and GetStreamCheckpoint methods in the Postgres store.
- Created document_update_history table for storing update payloads for recovery and replay.
- Developed update persist worker to handle Redis Stream updates and persist them to Postgres.
- Enhanced Docker Compose configuration for Redis with persistence.
- Updated frontend API to support fetching document state with optional share token.
- Added connection stability monitoring in the Yjs document hook.
2026-03-08 17:13:42 -07:00
M1ngdaXie
81855a144e feat(logger): update logger configuration to set log level to Fatal to eliminate IO lock contention
fix(redis): silence Redis internal logging and optimize connection pool settings to reduce mutex contention

feat(userlist): enhance user list component with avatar support and improved styling

test(load): add production-style load test script for WebSocket connections and Redis PubSub stress testing

chore(loadtest): create script to run load tests with pprof profiling for performance analysis
2026-02-08 12:31:30 -08:00
M1ngdaXie
6fac2f7997 feat: enhance frontend with new UI components and Tailwind CSS integration
- Added CreateButton and DocumentCard components for document management.
- Implemented tabbed interface for owned and shared documents in Home page.
- Integrated Tailwind CSS for styling and layout improvements.
- Introduced utility functions for class name management.
- Updated package.json with new dependencies for UI components and styling.
- Created PostCSS configuration for Tailwind CSS.
- Refactored Navbar and button components for better usability and design.
- Enhanced document API to include owner_id for document sharing functionality.
2026-02-05 15:06:34 -08:00
M1ngdaXie
c84cbafb2c Refactor and improve code consistency across multiple files
- Enhanced SQL queries in `session.go` and `share.go` for clarity and consistency.
- Updated comments for better understanding and maintenance.
- Ensured consistent error handling and return statements across various methods.
2026-02-04 22:01:47 -08:00
M1ngdaXie
0f4cff89a2 feat: implement Redis-based message bus and awareness management
- Added RedisMessageBus for message distribution using Redis Pub/Sub.
- Introduced LocalMessageBus as a no-op implementation for single-server mode.
- Created messagebus interface for abstraction of message distribution.
- Implemented awareness management methods: SetAwareness, GetAllAwareness, DeleteAwareness, and ClearAllAwareness.
- Added logger utility for structured logging with zap.
- Refactored SniffYjsClientIDs and MakeYjsDeleteMessage functions for improved readability.
2026-02-04 22:00:55 -08:00
M1ngdaXie
70a406c73c Refactor API configuration and improve WebSocket handling in frontend and backend 2026-02-03 17:25:11 -08:00
M1ngdaXie
35c4aa2580 k6 pressure test 2026-02-03 16:13:59 -08:00
M1ngdaXie
0ec58ca866 feat: Add landing page and version history functionality
- Implemented ConditionalHome component to show LandingPage for guests and Home for authenticated users.
- Created LandingPage with login options for Google and GitHub.
- Added VersionHistoryPanel component for managing document versions.
- Integrated version history functionality into EditorPage.
- Updated API client to handle FormData correctly.
- Added styles for LandingPage and VersionHistoryPanel.
- Created version management API methods for creating, listing, restoring, and fetching document versions.
2026-01-19 16:14:56 -08:00
M1ngdaXie
e363b99966 fix: Update environment variable examples in .env files for clarity and completeness 2026-01-12 17:45:15 -08:00
M1ngdaXie
1058299933 fix: Add production fallbacks for API and WebSocket URLs 2026-01-12 01:19:29 -08:00
M1ngdaXie
819760662a set up for deployment 2026-01-12 00:16:55 -08:00
M1ngdaXie
6b1ed8d11c feat: Implement document permission handling and sharing features 2026-01-10 21:19:12 -08:00
M1ngdaXie
6ba18854bf feat: Improve OAuth handling and user data extraction in authentication flow 2026-01-08 16:35:38 -08:00
M1ngdaXie
0a5e6661f1 feat: Implement Share Modal for document sharing functionality
- Added ShareModal component to manage user and link sharing for documents.
- Created AuthContext to handle user authentication state and token management.
- Updated useYjsDocument hook to support sharing via tokens.
- Enhanced Yjs document creation to include user information and authentication tokens.
- Introduced AuthCallback page to handle authentication redirects and token processing.
- Modified EditorPage and KanbanPage to include share functionality.
- Created LoginPage with Google and GitHub authentication options.
- Added styles for LoginPage.
- Defined types for authentication and sharing in respective TypeScript files.
2026-01-06 22:03:07 -08:00
M1ngdaXie
8ae7fd96e8 feat: Implement error handling and response structure for API
- Added standardized error response structure in `errors.go` for consistent error handling across the API.
- Implemented specific response functions for various HTTP status codes (400, 401, 403, 404, 500) to enhance error reporting.
- Introduced validation error handling to provide detailed feedback on input validation issues.

test: Add comprehensive tests for share handler functionality

- Created a suite of tests for share handler endpoints, covering scenarios for creating, listing, deleting shares, and managing share links.
- Included tests for permission checks, validation errors, and edge cases such as unauthorized access and invalid document IDs.

chore: Set up test utilities and database for integration tests

- Established a base handler suite for common setup tasks in tests, including database initialization and teardown.
- Implemented test data seeding to facilitate consistent testing across different scenarios.

migration: Add public sharing support in the database schema

- Modified the `documents` table to include `share_token` and `is_public` columns for managing public document sharing.
- Added constraints to ensure data integrity, preventing public documents from lacking a share token.
2026-01-05 15:25:46 -08:00
M1ngdaXie
7f5f32179b feat: Enhance real-time collaboration features with user awareness and document sharing
- Added user information (UserID, UserName, UserAvatar) to Client struct for presence tracking.
- Implemented failure handling in the broadcastMessage function to manage send failures and disconnect clients if necessary.
- Introduced document ownership and sharing capabilities:
  - Added OwnerID and Is_Public fields to Document model.
  - Created DocumentShare model for managing document sharing with permissions.
  - Implemented functions for creating, listing, and managing document shares in the Postgres store.
- Added user management functionality:
  - Created User model and associated functions for user management in the Postgres store.
  - Implemented session management with token hashing for security.
- Updated database schema with migrations for users, sessions, and document shares.
- Enhanced frontend Yjs integration with awareness event logging for user connections and disconnections.
2026-01-03 12:59:53 -08:00
M1ngdaXie
37d89b13b9 first commit 2025-12-29 16:29:24 -08:00