Skip to content

Commit d1c6d75

Browse files
authored
Merge pull request #4 from MT-superdev/matas/fix/pr-audit
Matas/fix/pr audit
2 parents 759f3f3 + 2f0f015 commit d1c6d75

109 files changed

Lines changed: 16678 additions & 3738 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
1-
# Version control
1+
node_modules
2+
dist
23
.git
34
.gitignore
4-
5-
# CI/CD and deployment
6-
.github
7-
helm-chart
8-
9-
# Docker files
10-
Dockerfile
11-
.dockerignore
12-
13-
# Development files
14-
README.md
155
*.md
16-
17-
# IDE and editor files
18-
.vscode
19-
.idea
20-
*.swp
21-
*.swo
22-
23-
# OS generated files
6+
.env
7+
.env.local
248
.DS_Store
25-
Thumbs.db
26-
27-
# Logs
289
*.log
29-
30-
# Temporary files
31-
tmp/
32-
temp/
10+
coverage
11+
.vscode
12+
.idea

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# API Configuration
2+
# Set the backend API base URL for local development
3+
# This overrides the automatic detection (localhost:8000 for localhost, production URL otherwise)
4+
#
5+
# Examples:
6+
# VITE_API_BASE=http://localhost:8000/api/v1
7+
# VITE_API_BASE=http://localhost:3000/api/v1
8+
# VITE_API_BASE=https://your-ngrok-url.ngrok.io/api/v1
9+
# VITE_API_BASE=https://api.watchflow.dev/api/v1
10+
11+
VITE_API_BASE=

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Environment variables
16+
.env
17+
.env.local
18+
.env.*.local
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
.DS_Store
25+
*.suo
26+
*.ntvs*
27+
*.njsproj
28+
*.sln
29+
*.sw?

COMMIT_MSG.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Major refactor: React/Vite landing, remove legacy scripts and docs
2+
3+
- Replace legacy script/style stack with React 18 + TypeScript + Vite + Tailwind
4+
- Add /analyze route, installation_id-in-URL flow (no PAT when from install link)
5+
- Align example rules and mock YAML with backend parameters-based format
6+
- Example rule cards: tooltip-style cards (no shadow, no rounded corners), updated copy
7+
- Metadata: theme-color, OG/Twitter/canonical; remove temp DEPLOYMENT.md
8+
- Remove legacy code: stars.js, script.js, temp_old_script.js, style.css
9+
- README: deployment section kept; drop broken doc links
10+
- Dockerfile and helm-chart unchanged for deploy

Dockerfile

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
# Multi-stage build for React/Vite app
2+
FROM node:20-alpine AS builder
3+
4+
WORKDIR /app
5+
6+
# Copy package files
7+
COPY package*.json ./
8+
9+
# Install dependencies
10+
RUN npm ci --legacy-peer-deps
11+
12+
# Copy source files
13+
COPY . .
14+
15+
# Build the application
16+
RUN npm run build
17+
18+
# Production stage with nginx
119
FROM nginx:alpine
2-
COPY . /usr/share/nginx/html/
3-
EXPOSE 80
20+
21+
# Copy built files from builder stage
22+
COPY --from=builder /app/dist /usr/share/nginx/html
23+
24+
# Copy nginx configuration for SPA routing
25+
RUN echo 'server { \
26+
listen 80; \
27+
server_name _; \
28+
root /usr/share/nginx/html; \
29+
index index.html; \
30+
\
31+
# Gzip compression \
32+
gzip on; \
33+
gzip_vary on; \
34+
gzip_min_length 1024; \
35+
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/json application/javascript; \
36+
\
37+
# SPA routing - serve index.html for all routes \
38+
location / { \
39+
try_files $uri $uri/ /index.html; \
40+
} \
41+
\
42+
# Cache static assets \
43+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { \
44+
expires 1y; \
45+
add_header Cache-Control "public, immutable"; \
46+
} \
47+
}' > /etc/nginx/conf.d/default.conf
48+
49+
EXPOSE 80
50+
51+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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.

components.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/index.css",
9+
"baseColor": "slate",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
}
20+
}

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
7+
export default tseslint.config(
8+
{ ignores: ["dist"] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ["**/*.{ts,tsx}"],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
"react-hooks": reactHooks,
18+
"react-refresh": reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
23+
"@typescript-eslint/no-unused-vars": "off",
24+
},
25+
},
26+
);

0 commit comments

Comments
 (0)