|
| 1 | +# Watchflow Landing Page |
| 2 | + |
| 3 | +Modern React/TypeScript implementation of the Watchflow landing page with improved UX, better state management, and type safety. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- ✅ **Repository Analysis**: Analyze any GitHub repository and get agentic guardrail recommendations |
| 8 | +- ✅ **Rule Feasibility Check**: Validate if natural language rules can be implemented |
| 9 | +- ✅ **Token Management**: Optional GitHub token for higher rate limits and private repos |
| 10 | +- ✅ **PR Creation**: One-click PR creation with generated rules |
| 11 | +- ✅ **Mock Analysis**: Example analysis for demonstration |
| 12 | +- ✅ **Responsive Design**: Works on all screen sizes |
| 13 | + |
| 14 | +## Tech Stack |
| 15 | + |
| 16 | +- **React 18** with TypeScript |
| 17 | +- **Vite** for fast builds and HMR |
| 18 | +- **Tailwind CSS** for styling |
| 19 | +- **Lucide Icons** for consistent iconography |
| 20 | +- **shadcn/ui** components |
| 21 | + |
| 22 | +## Development |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +- Node.js 20+ |
| 27 | +- npm or bun |
| 28 | + |
| 29 | +### Setup |
| 30 | + |
| 31 | +```bash |
| 32 | +# Install dependencies |
| 33 | +npm install --legacy-peer-deps |
| 34 | + |
| 35 | +# Start dev server |
| 36 | +npm run dev |
| 37 | + |
| 38 | +# Build for production |
| 39 | +npm run build |
| 40 | + |
| 41 | +# Preview production build |
| 42 | +npm run preview |
| 43 | +``` |
| 44 | + |
| 45 | +The app will be available at `http://localhost:8080` |
| 46 | + |
| 47 | +## API Configuration |
| 48 | + |
| 49 | +The app automatically detects the environment: |
| 50 | + |
| 51 | +- **localhost/127.0.0.1**: Uses `http://localhost:8000/api/v1` (default for local dev) |
| 52 | +- **Production**: Uses `https://api.watchflow.dev/api/v1` (when not on localhost) |
| 53 | +- **Custom**: Override with `VITE_API_BASE` environment variable |
| 54 | + |
| 55 | +### Using .env file |
| 56 | + |
| 57 | +Create a `.env` file in the root directory to set a custom backend URL: |
| 58 | + |
| 59 | +```bash |
| 60 | +# .env |
| 61 | +VITE_API_BASE=http://localhost:8000/api/v1 |
| 62 | +``` |
| 63 | + |
| 64 | +Or for different ports or ngrok: |
| 65 | +```bash |
| 66 | +# .env |
| 67 | +VITE_API_BASE=http://localhost:3000/api/v1 |
| 68 | +# or |
| 69 | +VITE_API_BASE=https://your-ngrok-url.ngrok-free.app/api/v1 |
| 70 | +``` |
| 71 | + |
| 72 | +**Note**: Vite only exposes environment variables prefixed with `VITE_` to the client. See `.env.example` for a template. |
| 73 | + |
| 74 | +## Deployment |
| 75 | + |
| 76 | +The project includes a Helm chart for Kubernetes deployment and a GitHub Actions workflow for automated deployment to EKS. |
| 77 | + |
| 78 | +### Quick Deploy |
| 79 | + |
| 80 | +```bash |
| 81 | +# Build Docker image |
| 82 | +docker build -t watchflow-landing:latest . |
| 83 | + |
| 84 | +# Test locally |
| 85 | +docker run -p 8080:80 watchflow-landing:latest |
| 86 | + |
| 87 | +# Deploy to EKS (see helm-chart/ directory) |
| 88 | +``` |
| 89 | + |
| 90 | +## Project Structure |
| 91 | + |
| 92 | +``` |
| 93 | +watchflow-landing/ |
| 94 | +├── src/ |
| 95 | +│ ├── components/ # React components |
| 96 | +│ ├── hooks/ # Custom React hooks |
| 97 | +│ ├── pages/ # Page components |
| 98 | +│ ├── utils/ # Utility functions |
| 99 | +│ └── lib/ # Shared libraries |
| 100 | +├── public/ # Static assets |
| 101 | +├── helm-chart/ # Kubernetes Helm chart |
| 102 | +├── .github/workflows/ # CI/CD workflows |
| 103 | +└── Dockerfile # Multi-stage Docker build |
| 104 | +``` |
| 105 | + |
| 106 | +## License |
| 107 | + |
| 108 | +See parent repository for license information. |
0 commit comments