How go-shiori/shiori works
Main Components
a. Client Layer:
• Web Interface (internal/view)
• CLI Interface (internal/cmd)
• Web Extension (external component)
b. Server Layer:
• HTTP Server (internal/http)
• API Routes (internal/http/routes/api/v1)
• Authentication Middleware (internal/http/middleware)
c. Core Business Layer:
• Bookmark Management (internal/domains)
• Account Management (internal/domains)
• Archive Management (internal/domains)
d. Data Layer:
• Database Abstraction (internal/database)
• Multiple Database Support:
• SQLite
• PostgreSQL
• MySQL
e. External Services:
• Pocket API Integration
• Web Page Archival System
[Client Layer] → [Server Layer] → [Core Business Layer] → [Data Layer]
• ↘ [External Services]
Key Relationships to Highlight
a. Client-Server Interaction:
• How the web UI, CLI, and web extension connect to the server
• API routes (v1) as the main entry point
b. Authentication Flow:
• Auth middleware's position in the request pipeline
• Connection to account management
c. Data Flow:
• Demonstrate how bookmarks flow from user input through the system
• Archival process for webpage content
• Database abstraction layer with multiple database support
Technical Details
• Go-specific components (internal packages)
• Database migrations system
• Template rendering system
• Static asset handling
• API versioning (v1)
Implementation Notes
• Authentication flow
• Bookmark CRUD operations
• Archive creation process
• Database interaction layer
Remember to highlight the portable nature of the application and its ability to run as both a web service and CLI tool from a single binary.
This system design should help developers understand how Shiori's components work together to provide bookmark management, webpage archival, and multi-user support across different deployment scenarios.