-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (87 loc) · 3.31 KB
/
Makefile
File metadata and controls
103 lines (87 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.PHONY: help dev down logs clean \
supabase-start supabase-start-background \
functions functions-background \
ngrok-up ngrok-down ngrok-background \
functions-deploy test_daily_devotional test_slowness fresh
# Default target
help:
@echo "🚀 swiftbible – Development Commands"
@echo ""
@echo "Quick Start:"
@echo " make dev – Start Supabase, Edge Functions, and ngrok"
@echo " make stop – Stop everything"
@echo ""
@echo "Individual Services:"
@echo " make supabase-start – Start local Supabase stack"
@echo " make functions – Serve Supabase Edge Functions (requires Supabase running)"
@echo " make ngrok-up – Start ngrok tunnel for webhooks"
@echo ""
@echo "Utilities:"
@echo " make logs – Show Supabase status"
@echo " make clean – Stop services and clean temp files"
@echo ""
@echo "Deploy:"
@echo " make functions-deploy – Deploy all functions to remote project"
@echo ""
@echo "Tests:"
@echo " make test_daily_devotional"
@echo " make test_slowness"
functions-deploy:
supabase functions deploy daily-devotional --project-ref yvanxjoayoiocwzfpkfm
supabase functions deploy user-self-deletion --project-ref yvanxjoayoiocwzfpkfm
supabase functions deploy create-donation-session --project-ref yvanxjoayoiocwzfpkfm
supabase functions deploy donation-status --project-ref yvanxjoayoiocwzfpkfm
supabase functions deploy donation-history --project-ref yvanxjoayoiocwzfpkfm
supabase functions deploy stripe-donation-webhook --project-ref yvanxjoayoiocwzfpkfm
test_daily_devotional:
curl -X POST 'https://yvanxjoayoiocwzfpkfm.supabase.co/functions/v1/daily-devotional' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $(SWIFTBIBLE_KEY)' \
-H 'SuperSecret: $(SWIFTBIBLE_SUPERSECRET_KEY)' \
-d '{}';
test_slowness:
xcodebuild clean build -project swiftbible.xcodeproj/ OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-expression-type-checking" | grep -Ei '^\d+\.\d+ms\t/.+$' | sort -r
supabase-start:
@echo "🚀 Starting local Supabase..."
supabase stop --all >/dev/null 2>&1 || true
supabase start
supabase-start-background:
@echo "Starting Supabase..."
supabase start
functions:
@echo "🔧 Serving Edge Functions..."
cd supabase && supabase functions serve --env-file .env --no-verify-jwt
functions-background:
@echo "Starting Edge Functions..."
@cd supabase && supabase functions serve --env-file .env --no-verify-jwt
ngrok-up:
@echo "📡 Starting ngrok tunnel..."
./scripts/ngrok-up.sh
ngrok-background:
@make ngrok-up
ngrok-down:
@echo "🛑 Stopping ngrok tunnel..."
./scripts/ngrok-down.sh
dev:
@echo "🚀 Starting swiftbible development environment..."
@echo " • Supabase"
@echo " • Edge Functions"
@echo " • ngrok webhook tunnel"
@echo ""
@echo "Press Ctrl+C to stop all services."
@make -j3 supabase-start-background functions-background ngrok-background
@wait
down:
@echo "🛑 Stopping swiftbible services..."
@make ngrok-down >/dev/null 2>&1 || true
@pkill -f "supabase functions serve" >/dev/null 2>&1 || true
@echo "✅ Services stopped"
logs:
@supabase status
clean:
@echo "🧹 Cleaning up local environment..."
@make stop
@echo "✅ Cleanup complete"
fresh:
@echo "🔄 Resetting Supabase database..."
supabase db reset --debug # && supabase gen types typescript --local > types/database.ts