How tsxcw/mtab works
Project Type and Purpose
• mTab is a full‐stack, self‐hostable bookmarks & notes management web application with optional browser‐extension and online tools.
• The README confirms it uses Docker, supports private deployment, a PHP backend, a JS/Vue front‐end, Redis, and MySQL.
High‐Level Architectural Components
a. Clients
• Web Browser (Vue.js‐based Single Page Application served from public/dist)
• Mobile Browser (responsive web UI)
• Browser Extension (built under extend/browserExt + extend/main.go)
b. Edge/Proxy
• Nginx (reverse proxy, serves static assets + routes PHP requests)
c. Application Layer
• PHP‐FPM process running ThinkPHP (app/ directory):
• Controllers (app/controller)
• Models (app/model)
• Views (app/view for install and error pages)
• Commands (app/command for CLI tasks)
• Custom extensions (extend/ directory for plugins, mail, image, upgrade)
d. Persistence
• MySQL (config/database.php; defaultData.sql; install.sql)
• Redis (session/cache queue; configured via docker/redis.conf)
e. External/Third‐Party Services
• IP Geolocation DB (app/controller/apps/weather/ipLocation)
• OAuth Provider (QQ login via app/view/qq_login.html, network calls in extend/Axios.php)
f. DevOps / Infrastructure
• Docker Compose (docker-compose.yml) orchestrates Nginx, PHP, Redis, MySQL
• Configuration files (docker/, config/, env.php)
Relationships and Data Flow
• Clients issue HTTP(S) requests to Nginx.
• Nginx serves static assets (JS/CSS from public/dist) or proxies API calls to PHP‐FPM.
• PHP‐FPM (ThinkPHP) routes requests (config/route.php) → Controller → Model → Database/Redis → Controller → JSON/HTML Response.
• CLI tools (app/command) run inside the PHP container for maintenance tasks.
• Browser extension communicates with the same API endpoints to sync data.
• OAuth login and IP Geo lookups call external services or use bundled DB.
Architectural Patterns and Design Principles
• Monolithic MVC application using ThinkPHP.
• 12-factor principles in Dockerized deployment.
• Clear separation of concerns:
• Presentation: public/dist (Vue) + app/view (PHP)
• Business Logic: app/controller + app/service
• Data Access: app/model
• Extensions: extend/
• Plugin system: extend/PluginsStaticSystem, PluginsInstall → modular extensibility.