Expert guidance for developing and maintaining the DH-Blog full-stack application with Go backend and Vue 3 frontend
Expert assistant for working with DH-Blog, a full-stack personal content management platform built with Go (Gin framework), Vue 3, TypeScript, and SQLite. Supports blog functionality, file management via WebDAV, and Markdown content.
```
internal/
├── wire/app.go # Manual dependency injection hub
├── config/ # Viper configuration (YAML)
├── router/ # Gin route definitions
├── handler/ # HTTP controllers
├── service/ # Business logic layer
├── repository/ # GORM data access (SQLite)
├── model/ # Domain models & DB entities
├── middleware/ # JWT auth, IP tracking
├── dhcache/ # In-memory caching
├── task/ # Background AI task processing
├── frontend/ # Embedded static files (go:embed)
└── response/ # Standardized HTTP responses
```
```
src/
├── api/ # Axios API clients
├── views/ # Page components
├── components/ # Reusable components
├── router/ # Vue Router config
├── store/ # Pinia state management
├── types/ # TypeScript definitions
└── utils/ # Helper utilities
```
**Key Dependencies:**
**Start development server (hot reload with air):**
```bash
cd blog-backend && air
```
**Build production binary:**
```bash
cd blog-backend && go build -ldflags="-s -w" -o dhblog ./cmd/blog-backend
```
**Compile for testing (required after every change):**
```bash
cd blog-backend && go build -ldflags="-s -w" -o /Users/danyhug/GolandProjects/DH-Blog/blog-deploy/backend/dhblog ./cmd/blog-backend
```
**Install dependencies:**
```bash
cd blog-front && pnpm install
```
**Development server:**
```bash
cd blog-front && pnpm dev
```
**Production build:**
```bash
cd blog-front && pnpm build
```
**Build with type checking:**
```bash
cd blog-front && pnpm build:type-check
```
**Build for all platforms (embeds frontend into backend binary):**
```bash
cd blog-deploy && ./build.sh
```
Produces self-contained executables for:
1. **Always compile after changes** - Every file modification must be compiled to `/Users/danyhug/GolandProjects/DH-Blog/blog-deploy/backend` for validation
2. **Compile per task** - Compile after completing each discrete task
3. **Never run test binaries** - Compile for verification only; do not execute
4. **Clean up after completion** - Delete test binaries after all tasks are done
5. **Research before use** - For unfamiliar frameworks/libraries, use `@context7` to fetch official documentation or search for resources before implementation
6. **Minimal changes only** - Make the smallest necessary updates; do not refactor unrelated code
1. **No style changes unless requested** - Never modify CSS/styling unless explicitly asked
2. **Use pnpm exclusively** - Replace all `npm` commands with `pnpm`
3. **No custom CSS** - Use Tailwind CSS utility classes and Element Plus components only; do not write custom CSS rules
4. **Minimal scope** - Only modify code directly related to the task
**Location:** `data/config.yaml` (auto-created on first run)
**Default Settings:**
**First Run:**
If no admin user exists, the application prompts via stdin to create an admin account with username and password.
The backend uses **manual dependency injection** in `internal/wire/app.go`:
1. Initialize configuration
2. Create database connection (GORM + SQLite)
3. Instantiate repositories with DB
4. Instantiate services with repositories
5. Instantiate handlers with services
6. Wire handlers to Gin router
7. Register middleware (JWT, IP tracking)
**No code generation required** - all wiring is explicit in `app.go`.
The frontend is embedded into the Go binary using `//go:embed` directives in `internal/frontend/`:
1. **Understand requirements** - Clarify the task scope and expected outcome
2. **Research dependencies** - Use `@context7` for unfamiliar libraries/frameworks
3. **Implement changes** - Make minimal, targeted modifications
4. **Backend: Compile & verify** - Compile to deploy directory after each task
5. **Frontend: Test locally** - Run `pnpm dev` to verify changes
6. **Final cleanup** - Delete test binaries, verify no unrelated code changed
7. **Communicate in Chinese** - Explain changes and outcomes in Chinese
**Task: Add a new API endpoint for exporting articles to PDF**
1. Research Go PDF libraries using `@context7`
2. Create new service method in `internal/service/article_service.go`
3. Add handler in `internal/handler/article_handler.go`
4. Wire route in `internal/router/router.go`
5. Compile backend:
```bash
cd blog-backend && go build -ldflags="-s -w" -o /Users/danyhug/GolandProjects/DH-Blog/blog-deploy/backend/dhblog ./cmd/blog-backend
```
6. Verify compilation succeeds (do not run)
7. Test via Postman/curl (if air dev server is running)
8. Delete test binary after validation
9. Communicate completion in Chinese with details of changes
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/dh-blog-development-assistant/raw