This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
IMPORTANT: All communication and responses must be in Chinese (中文). Claude must use Chinese for all interactions with the user, including:
- 所有回复必须使用中文
- 代码注释和文档说明使用中文
- 错误信息和提示使用中文
- 任何交流都必须用中文进行
make build- Build both frontend and backendmake build-frontend- Build frontend only (Vue.js)make build-backend- Build backend only (Go binary)make build-multi-arch- Build for multiple architectures (Linux, Windows, macOS)
make dev- Start development server (backend only)go run ./cmd/main.go- Direct backend development- Frontend development:
cd fe && npm run dev(starts Vite dev server on port 5173)
make test- Run Go testsmake lint- Run golangci-lint- Frontend linting:
cd fe && npm run lint(ESLint + stylelint) - Frontend formatting:
cd fe && npm run format(Prettier)
make docker-build- Build Docker imagemake docker-run- Run Docker containermake docker-stop- Stop Docker container
make swag-init- Generate Swagger documentationmake swag-fmt- Format Swagger comments
This is a Go-based web application that provides WebDAV access to Cloud189 (天翼云盘) shared files with a Vue.js frontend.
Entry Point: cmd/main.go - Main application entry
Core Structure:
internal/- All internal packagesbootstrap/- Application bootstrap and service contextconfigs/- Configuration managementframework/- Custom framework components (HTTP context, task context)handler/- Request handlershttp/- HTTP API handlersconsumer/- Message consumers for background tasks
models/- Data models and database entitiesrouter/- Route definitionsservices/- Business logic layertypes/- Type definitions and constants
Key Services:
cloudtoken- Cloud189 authentication token managementcloudbridge- Cloud189 API integrationvirtualfile- Virtual file system for Cloud189 sharesmediafile- Media file STRM generationmountpoint- Storage mount point managementuser/usergroup- User and group managementautoingestplan- Automated file ingestion scheduling
Framework: Built on Gin with custom framework abstractions for HTTP and task contexts.
Location: fe/ directory
Tech Stack:
- Vue 3 + TypeScript
- Vite build tool
- Pinia state management
- Naive UI component library
- Vue Router for navigation
Structure:
src/api/- API client functionssrc/components/- Reusable Vue componentssrc/stores/- Pinia storessrc/views/- Page componentssrc/utils/- Utility functions
- SQLite (via GORM) as primary database
- Supports MySQL and PostgreSQL as alternatives
- Database file location:
data/share.db
- WebDAV Interface - Provides standard WebDAV access to Cloud189 files
- Virtual File System - Maps Cloud189 share links to directory structure
- Media STRM Generation - Creates STRM files for media server compatibility
- Multi-tenant Architecture - Supports users and groups with permissions
- Background Processing - Automated file ingestion and sync tasks
- Media Streaming - Built-in media player with HLS support
Configuration files in etc/ directory:
- Main config:
etc/config.yaml - Database file:
data/share.db - Media directory:
media_dir/ - Logs:
logs/share.log
- Go tests use standard testing package
- Test files follow
*_test.gopattern - Example:
internal/services/cloudbridge/fetch_files_test.go
/api/user/*- User management/api/cloudtoken/*- Token management/api/storage/*- Storage management/api/setting/*- System settings/api/media/*- Media management/dav/*- WebDAV interface
- The project uses Go 1.25+ with modern Go features
- Frontend uses modern ES6+ and TypeScript
- Docker support for easy deployment
- Multi-architecture builds available
- Swagger documentation generation for APIs