Files
MeBox/Makefile
T
Kiro d5cf5fb4b2 feat: bootstrap MediaStationGo (Go + React rewrite of MediaStation)
Adopt the cropflre/nowen-video tech stack and rebuild the project from
scratch:

  - Backend: Go 1.25 + Gin + GORM + SQLite (WAL) + JWT + WebSocket hub.
    Layered packages config / database / model / repository / service /
    middleware / handler. Default admin (admin/admin123) seeded on first
    run; /api routes for auth, libraries, media, stream and admin
    panels. WebSocket scan-progress events at /api/ws.
  - Frontend: React 18 + Vite 5 + Tailwind 3.4 + Zustand + axios +
    react-router 6 + lucide-react + framer-motion + hls.js. Pages for
    Login / Home / Library / Search / MediaDetail / Player / Admin
    (Library, Users, Settings tabs).
  - Distribution: multi-arch Dockerfile (frontend -> backend -> Alpine
    runtime), docker-compose.yml, GitHub Actions for CI and GHCR
    publish, Makefile, env-prefixed config (MEDIASTATION_*).
  - Docs: README, CONTRIBUTING, .env.example, config.example.yaml.

Backend builds, vets and tests pass. Frontend builds via tsc -b && vite
build (250 kB JS / 16 kB CSS, gzipped 84 / 4 kB).
2026-05-14 15:26:29 +00:00

51 lines
935 B
Makefile

.PHONY: all build build-server build-web dev dev-web run docker docker-stop clean install-web tidy test vet
# ---- 默认目标 ----
all: build
# ---- 全量构建(前端 + 后端) ----
build: build-web build-server
# ---- 后端构建 ----
# 使用纯 Go SQLite,可以 CGO_ENABLED=0 直接交叉编译。
build-server:
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/mediastation-go ./cmd/server
# ---- 前端构建 ----
build-web:
cd web && npm install --silent && npm run build
# ---- 开发模式 ----
dev:
MEDIASTATION_APP_DEBUG=true go run ./cmd/server
dev-web:
cd web && npm run dev
# ---- 一键运行 ----
run: build
./bin/mediastation-go
# ---- Docker ----
docker:
docker compose up --build -d
docker-stop:
docker compose down
# ---- 工具命令 ----
install-web:
cd web && npm install
tidy:
go mod tidy
test:
go test ./...
vet:
go vet ./...
clean:
rm -rf bin/ web/dist/ web/node_modules/