$ show setube/stb
Stb (εΎεΊ) is a full-stack image hosting service built as a pnpm monorepo. The backend is a Node.js/Express application with MongoDB (Mongoose) providing REST APIs for user authentication, image upload, album management, admin operations, and system configuration. The frontend is a Vue 3 single-page application using Pinia for state management, Vue Router with lazy-loaded views, and a mix of Ant Design Vue and Element Plus UI libraries. The system supports multiple storage backends (local filesystem, S3-compatible, Alibaba OSS, Tencent COS, Qiniu, Upyun, SFTP, FTP, WebDAV, Telegram, GitHub) via a pluggable adapter pattern, and integrates AI-based content moderation (Tencent, Aliyun, NSFWJS). Deployment is Docker-based with a multi-stage build and GitHub Actions CI/CD for multi-architecture images. The application includes a comprehensive admin panel for user, image, log, album, role group, invite code, and configuration management, as well as OAuth login (GitHub, Google, Linux DO), email verification, and a slider captcha component. While the codebase is functional and well-structured with clear separation of concerns, it exhibits some technical debt: mixed UI libraries increase bundle size, the configuration view is monolithic and exposes sensitive credentials to the client, there are no automated tests, and some patterns (e.g., IP detection, Docker entrypoint sed) are fragile. Overall, it is a solid, production-ready image hosting solution with reusable utility modules.
The LLM identified 4 files worth highlighting for reuse:
Implements a unified storage interface with adapters for local filesystem, S3, Alibaba OSS, Tencent COS, Qiniu, Upyun, SFTP, FTP, WebDAV, Telegram, and GitHub. Each adapter exposes `upload`, `delete`, and `getUrl` methods. The module selects the active adapter based on configuration, making it easy to add new backends. This pattern is highly reusable for any application requiring multi-cloud or multi-protocol file storage.
Provides image moderation by integrating with Tencent Cloud, Aliyun, and NSFWJS. The module abstracts the moderation API calls behind a common interface, returning a safety score and violation flags. It can be extracted and reused in any application needing automated image content filtering, with minimal adaptation for different providers.
A slider captcha component that generates a puzzle on the client side and verifies the slide offset with the server. It emits `update:value` and `verify-success` events, making it easy to integrate into any form. Although it uses direct DOM manipulation (not idiomatic Vue), the pattern of client-side puzzle generation with server-side validation is reusable for anti-bot protection in other Vue applications.
A centralized Axios instance with request and response interceptors. It injects JWT tokens, handles 401 redirects, and implements request deduplication by canceling pending duplicate requests. This pattern is reusable across any Vue application needing a robust HTTP client with authentication and deduplication logic.