Commit Graph

7 Commits

Author SHA1 Message Date
M1ngdaXie
9c19769eb0 feat: add guest mode, bug fixes, and self-hosted config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 09:45:17 +00:00
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
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
70a406c73c Refactor API configuration and improve WebSocket handling in frontend and backend 2026-02-03 17:25:11 -08:00
M1ngdaXie
6ba18854bf feat: Improve OAuth handling and user data extraction in authentication flow 2026-01-08 16:35:38 -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