Skip to content

Commit 0fe0f65

Browse files
committed
Add Vue 3 + TypeScript frontend with DaisyUI
- Implement modern web control panel for MCPProxy - Add Vue 3 with Composition API and TypeScript - Include DaisyUI + TailwindCSS for responsive UI design - Create reusable components: ServerCard, NavBar, ToastContainer - Build core views: Dashboard, Servers, Tools, Search, Settings - Add Pinia stores for state management - Implement real-time updates via Server-Sent Events - Setup Vitest testing framework with component tests - Add ESLint configuration and GitHub Actions CI - Create production build system with Go embed integration - Support development mode with live reload - Add comprehensive documentation and setup guide
1 parent 95dc3d4 commit 0fe0f65

43 files changed

Lines changed: 2686 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/frontend.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Frontend CI
2+
3+
on:
4+
push:
5+
branches: [ main, next ]
6+
paths:
7+
- 'frontend/**'
8+
- '.github/workflows/frontend.yml'
9+
pull_request:
10+
branches: [ main, next ]
11+
paths:
12+
- 'frontend/**'
13+
- '.github/workflows/frontend.yml'
14+
15+
jobs:
16+
frontend-test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: 'npm'
27+
cache-dependency-path: frontend/package-lock.json
28+
29+
- name: Install dependencies
30+
run: cd frontend && npm ci
31+
32+
- name: Type check
33+
run: cd frontend && npm run type-check
34+
35+
- name: Lint
36+
run: cd frontend && npm run lint
37+
38+
- name: Run tests
39+
run: cd frontend && npm run test
40+
41+
- name: Build frontend
42+
run: cd frontend && npm run build
43+
44+
- name: Upload build artifacts
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: frontend-dist
48+
path: frontend/dist/
49+
retention-days: 7

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@ build/
5757
dist/
5858
bin/
5959

60+
# Frontend dependencies and build artifacts
61+
frontend/node_modules/
62+
frontend/dist/
63+
frontend/.vite/
64+
frontend/.vitest/
65+
66+
# Package manager files
67+
package-lock.json
68+
pnpm-lock.yaml
69+
yarn.lock
70+
71+
# Frontend cache and temp files
72+
frontend/.nuxt/
73+
frontend/.output/
74+
frontend/.cache/
75+
frontend/coverage/
76+
77+
# Embedded frontend assets (auto-generated)
78+
web/frontend/
79+
6080
# Test coverage
6181
coverage.out
6282
coverage.html

Makefile

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# MCPProxy Makefile
2+
3+
.PHONY: help build frontend-build frontend-dev backend-dev clean test lint
4+
5+
# Default target
6+
help:
7+
@echo "MCPProxy Build Commands:"
8+
@echo " make build - Build complete project (frontend + backend)"
9+
@echo " make frontend-build - Build frontend for production"
10+
@echo " make frontend-dev - Start frontend development server"
11+
@echo " make backend-dev - Build backend with dev flag (loads frontend from disk)"
12+
@echo " make clean - Clean build artifacts"
13+
@echo " make test - Run tests"
14+
@echo " make lint - Run linter"
15+
16+
# Build complete project
17+
build: frontend-build
18+
@echo "🔨 Building Go binary with embedded frontend..."
19+
go build -o mcpproxy ./cmd/mcpproxy
20+
@echo "✅ Build completed! Run: ./mcpproxy serve"
21+
@echo "🌐 Web UI: http://localhost:8080/ui/"
22+
23+
# Build frontend for production
24+
frontend-build:
25+
@echo "🎨 Building frontend for production..."
26+
cd frontend && npm install && npm run build
27+
@echo "📁 Copying dist files for embedding..."
28+
rm -rf web/frontend
29+
mkdir -p web/frontend
30+
cp -r frontend/dist web/frontend/
31+
@echo "✅ Frontend build completed"
32+
33+
# Start frontend development server
34+
frontend-dev:
35+
@echo "🎨 Starting frontend development server..."
36+
cd frontend && npm install && npm run dev
37+
38+
# Build backend with dev flag (for development with frontend hot reload)
39+
backend-dev:
40+
@echo "🔨 Building backend in development mode..."
41+
go build -tags dev -o mcpproxy-dev ./cmd/mcpproxy
42+
@echo "✅ Development backend ready!"
43+
@echo "🚀 Run: ./mcpproxy-dev serve"
44+
@echo "🌐 In dev mode, make sure frontend dev server is running on port 3000"
45+
46+
# Clean build artifacts
47+
clean:
48+
@echo "🧹 Cleaning build artifacts..."
49+
rm -f mcpproxy mcpproxy-dev
50+
rm -rf frontend/dist frontend/node_modules web/frontend
51+
go clean
52+
@echo "✅ Cleanup completed"
53+
54+
# Run tests
55+
test:
56+
@echo "🧪 Running Go tests..."
57+
go test ./internal/... -v
58+
@echo "🧪 Running frontend tests..."
59+
cd frontend && npm install && npm run test
60+
61+
# Run tests with coverage
62+
test-coverage:
63+
@echo "🧪 Running tests with coverage..."
64+
go test -coverprofile=coverage.out ./internal/...
65+
go tool cover -html=coverage.out -o coverage.html
66+
cd frontend && npm install && npm run coverage
67+
68+
# Run linter
69+
lint:
70+
@echo "🔍 Running Go linter..."
71+
golangci-lint run ./...
72+
@echo "🔍 Running frontend linter..."
73+
cd frontend && npm install && npm run lint
74+
75+
# Install development dependencies
76+
dev-setup:
77+
@echo "🛠️ Setting up development environment..."
78+
@echo "📦 Installing frontend dependencies..."
79+
cd frontend && npm install
80+
@echo "✅ Development setup completed"

0 commit comments

Comments
 (0)