Skip to content

Commit d17ea3d

Browse files
Merge pull request #306 from SheetMetalConnect/claude/supabase-cloudflare-migration-Gwk5i
Prepare project for Supabase and Cloudflare deployment
2 parents d9d8834 + 06da358 commit d17ea3d

File tree

13 files changed

+312
-210
lines changed

13 files changed

+312
-210
lines changed

.env

Lines changed: 0 additions & 7 deletions
This file was deleted.

.env.example

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,9 @@ VITE_SUPABASE_PROJECT_ID="your-project-id"
2828
# =============================================================================
2929
# CAD PROCESSING SERVICE (Optional)
3030
# =============================================================================
31-
# Server-side CAD processing for geometry and PMI extraction
32-
# See services/pmi-extractor/README.md for deployment instructions
3331

3432
# CAD service URL (leave empty to use browser-based processing)
3533
# VITE_CAD_SERVICE_URL="https://your-cad-service.example.com"
3634

37-
# API key for CAD service authentication (optional if service allows anonymous)
35+
# API key for CAD service authentication
3836
# VITE_CAD_SERVICE_API_KEY="your-api-key-here"
39-
40-
# Legacy PMI service URL (falls back to VITE_CAD_SERVICE_URL if not set)
41-
# VITE_PMI_SERVICE_URL="https://your-pmi-service.example.com"
42-
43-
# =============================================================================
44-
# SELF-HOSTED NOTES
45-
# =============================================================================
46-
#
47-
# For self-hosted deployments:
48-
# 1. Create a Supabase project (cloud or self-hosted)
49-
# 2. Apply the database schema from supabase/migrations/
50-
# 3. Deploy edge functions: supabase functions deploy
51-
# 4. Configure storage buckets: parts-images, issues
52-
# 5. Set these environment variables
53-
#
54-
# See docs/SELF_HOSTING_GUIDE.md for complete instructions.
55-
#
56-
# License: BSL 1.1 - Self-hosting is free and unlimited.
57-
# You cannot offer commercial hosted versions that compete with eryxon.eu
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
deployments: write
16+
name: Deploy to Cloudflare Pages
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build
31+
run: npm run build
32+
env:
33+
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
34+
VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }}
35+
36+
- name: Deploy to Cloudflare Pages
37+
uses: cloudflare/pages-action@v1
38+
with:
39+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+
projectName: eryxon-flow
42+
directory: dist
43+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
44+
wranglerVersion: '3'

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,32 @@ __pycache__/
3939
.Python
4040
*.egg-info/
4141
.eggs/
42+
43+
# === Security: Sensitive Files ===
44+
45+
# Supabase configuration (contains project ID)
46+
supabase/config.toml
47+
supabase/.temp/
48+
49+
# Environment files (contains credentials)
50+
.env
51+
.env.local
52+
.env.*.local
53+
# Keep example files
54+
!.env.example
55+
56+
# Secrets and credentials
57+
*.pem
58+
*.key
59+
*.p12
60+
secrets/
61+
credentials/
62+
63+
# IDE settings (may contain sensitive paths)
64+
.vscode/settings.json
65+
.idea/workspace.xml
66+
67+
# Backup files
68+
*.bak
69+
*.backup
70+
*~

DEPLOY.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Deploy Eryxon Flow
2+
3+
## Prerequisites
4+
5+
- Supabase account
6+
- Cloudflare account (free tier)
7+
8+
## Step 1: Create Supabase Project
9+
10+
```bash
11+
# 1. Go to supabase.com → Create project
12+
# 2. Get credentials from Settings → API:
13+
# - Project URL
14+
# - anon key
15+
# - Project Ref
16+
17+
# 3. Apply schema
18+
supabase link --project-ref YOUR_REF
19+
supabase db push
20+
21+
# 4. Create storage
22+
supabase storage create parts-images
23+
supabase storage create issues
24+
25+
# 5. Deploy functions
26+
supabase functions deploy
27+
```
28+
29+
## Step 2: Deploy to Cloudflare Pages
30+
31+
```bash
32+
# 1. Go to dash.cloudflare.com
33+
# 2. Pages → Create → Connect Git
34+
# 3. Select repo
35+
# 4. Build: npm run build
36+
# 5. Output: dist
37+
```
38+
39+
**Environment Variables** (set in Cloudflare):
40+
```
41+
VITE_SUPABASE_URL = https://YOUR_REF.supabase.co
42+
VITE_SUPABASE_PUBLISHABLE_KEY = your-anon-key
43+
VITE_SUPABASE_PROJECT_ID = YOUR_REF
44+
```
45+
46+
## Step 3: Custom Domain
47+
48+
In Cloudflare Pages:
49+
- Custom domains → Add domain
50+
- Enter: app.eryxon.eu
51+
- DNS: CNAME app → eryxon-flow.pages.dev
52+
53+
Done.

0 commit comments

Comments
 (0)