A Vue.js + TypeScript frontend application for the Kube Bind project that provides a web interface for binding Kubernetes resources across clusters with SSO authentication.
- SSO Authentication: OAuth2/OIDC-based authentication via
/api/authorizeendpoint - Resource Management: Browse and bind available Kubernetes resources
- Modern Stack: Built with Vue.js 3, TypeScript, and Vite
The frontend integrates with the existing Go backend and provides compatibility for CLI clients through redirect handling:
/api/authorize- SSO authentication endpoint/api/callback- OAuth2 callback handler/api/resources- Fetch available resources/api/bind- Bind resources to cluster/api/clusters/{cluster}/resources- Cluster-specific resources/api/clusters/{cluster}/authorize- Cluster-specific authentication/api/exports- Export binding configuration/api/clusters/{cluster}/exports- Cluster-specific exports
For CLI compatibility, the following routes provide HTTP 302 redirects:
/exports→/api/exports/clusters/{cluster}/exports→/api/clusters/{cluster}/exports
Frontend routes handle browser-based redirects for:
/authorize→/api/authorize/clusters/{cluster}/authorize→/api/clusters/{cluster}/authorize/callback→/api/callback
- Node.js 18+ and npm
- Go 1.19+ for running the backend server
# Terminal 1: Start Go backend
go run ./cmd/backend --listen-port=8080 --frontend http://localhost:3000
# Terminal 2: Start frontend dev server with hot reload
cd web
npm install
npm run dev
### Available Scripts
- `npm run dev` - Start development server
- `npm run build` - Build for production
- `npm run preview` - Preview production build
- `npm run lint` - Lint code
- `npm run type-check` - Run TypeScript type checking
## Authentication Flow
1. User clicks "Login" or accesses protected resource
2. Frontend redirects to `/api/authorize` with session parameters
3. Backend handles OAuth2 flow with configured OIDC provider
4. User is redirected back to frontend with authentication cookie
5. Frontend can now access protected endpoints
## Project Structure
```text
src/
├── main.ts # Application entry point and routing
├── App.vue # Root component
├── services/
│ └── auth.ts # Authentication and API service
└── views/
└── Resources.vue # Resource management interfaceThe frontend automatically detects the backend API through Vite proxy configuration. For production deployments, ensure the frontend is served from the same domain as the backend or configure CORS appropriately.
# Use the build script (builds frontend + Go binary)
./scripts/build-frontend.shcd web
npm run buildThe built files will be in the web/dist/ directory and are automatically embedded into the container image and served from there.