Skip to content

Commit eda83e3

Browse files
committed
UI
1 parent 7923048 commit eda83e3

4 files changed

Lines changed: 89 additions & 2 deletions

File tree

ui/.vercelignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules/
2+
.next/
3+
dist/
4+
build/
5+
.git/
6+
.github/
7+
.vscode/
8+
.idea/
9+
.env.local
10+
.env.*.local
11+
*.log
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
.DS_Store
16+
.env

ui/VERCEL_DEPLOYMENT.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# imgshape UI - Vercel Deployment
2+
3+
## Environment Variables
4+
5+
Set these in Vercel project settings:
6+
7+
```
8+
VITE_API_BASE_URL=https://imgshape-947614788790.asia-south1.run.app
9+
```
10+
11+
## Deploy Steps
12+
13+
1. **Connect GitHub Repository**
14+
- Go to [vercel.com](https://vercel.com)
15+
- Click "Add New..." → "Project"
16+
- Select your GitHub repo: `STiFLeR7/imgshape`
17+
- Import the project
18+
19+
2. **Configure Settings**
20+
- Root Directory: `ui`
21+
- Framework: `Vite`
22+
- Build Command: `npm run build`
23+
- Output Directory: `dist`
24+
25+
3. **Add Environment Variable**
26+
- In Vercel project settings → Environment Variables
27+
- Add: `VITE_API_BASE_URL` = `https://imgshape-947614788790.asia-south1.run.app`
28+
29+
4. **Deploy**
30+
- Click "Deploy"
31+
- Vercel will build and deploy automatically
32+
33+
## Live URLs
34+
35+
- **UI**: https://imgshape.vercel.app (or your custom domain)
36+
- **API**: https://imgshape-947614788790.asia-south1.run.app
37+
- Health: `/health`
38+
- Analyze v4: `/v4/analyze`
39+
- Augment: `/augment`
40+
- Report: `/generate_report`
41+
42+
## Local Development
43+
44+
```bash
45+
cd ui
46+
npm install
47+
npm run dev
48+
```
49+
50+
Open [http://localhost:3000](http://localhost:3000)
51+
52+
## Notes
53+
54+
- UI is deployed on free Vercel tier
55+
- Backend API runs on Cloud Run (also cost-efficient)
56+
- Environment variable automatically passed to build
57+
- The API base URL can be overridden at build time

ui/vercel.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "imgshape-ui",
3+
"version": 2,
4+
"buildCommand": "npm run build",
5+
"outputDirectory": "dist",
6+
"framework": "vite",
7+
"nodeVersion": "18.x",
8+
"env": {
9+
"VITE_API_BASE_URL": {
10+
"default": "https://imgshape-947614788790.asia-south1.run.app",
11+
"description": "Backend API base URL"
12+
}
13+
}
14+
}

ui/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default defineConfig(({ mode }) => {
1111
},
1212
plugins: [react()],
1313
define: {
14-
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
15-
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
14+
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY),
15+
'process.env.VITE_API_BASE_URL': JSON.stringify(env.VITE_API_BASE_URL || 'http://localhost:8000')
1616
},
1717
resolve: {
1818
alias: {

0 commit comments

Comments
 (0)