Files
ZeptaLab Bot ca775da1f1
CI/CD / lint-and-test (push) Has been cancelled
CI/CD / build-and-push (push) Has been cancelled
CI/CD / deploy (push) Has been cancelled
feat: initial commit - Rust + React URL shortener
2026-05-31 20:45:50 +00:00

68 lines
2.0 KiB
Markdown

# 🔗 Hello Web — URL Shortener
Rust + React URL shortener with analytics dashboard.
## Features
- Create short URLs with optional custom aliases
- Click tracking and analytics
- Beautiful React frontend with dark theme
- RESTful API backend
- Full CI/CD pipeline with Gitea Actions
- Docker multi-stage builds
- Kubernetes deployment with auto-scaling
## Tech Stack
- **Backend**: Rust + Axum
- **Frontend**: React + Vite
- **CI/CD**: Gitea Actions
- **Registry**: Harbor
- **Deployment**: Kubernetes + ArgoCD
- **Monitoring**: VictoriaMetrics
## Local Development
```bash
# Backend
cargo run
# Frontend (separate terminal)
cd frontend
npm install
npm run dev
```
## API Endpoints
- `POST /api/shorten` — Create short URL
- `GET /api/urls` — List all URLs
- `GET /api/stats` — Get analytics
- `GET /api/urls/{id}` — Get URL info
- `GET /{id}` — Redirect to original URL
- `GET /health` — Health check
## Deployment
The project uses Gitea Actions CI/CD:
1. Lint & test on every push
2. Build Docker image on merge to main
3. Push to Harbor registry
4. Deploy to Kubernetes cluster
## Architecture
```
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ React UI │────▶│ Axum API │────▶│ Harbor │
│ (Vite) │ │ (Rust) │ │ Registry │
└─────────────┘ └──────────────┘ └─────────────┘
│ │
▼ ▼
┌──────────────┐ ┌─────────────┐
│ Victoria │ │ Kubernetes │
│ Metrics │ │ Cluster │
└──────────────┘ └─────────────┘
```