-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·39 lines (32 loc) · 1.01 KB
/
dev.sh
File metadata and controls
executable file
·39 lines (32 loc) · 1.01 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
# Check for the .env file; otherwise create one
if [ ! -f .env ]; then
echo "🤖 .env not found. Generating..."
cat >.env <<EOF
APP_NAME="Guess"
APP_WEBSITE_URL="http://localhost:8080" # or https://yourdomain.com
APP_PORT="8080"
DATABASE_URL="sqlite://db/database.db"
JWT_SECRET="SOMETHING-TOP-SECRET"
GOOGLE_CLIENT_ID="ADD_YOUR_CLIENT_ID"
GOOGLE_CLIENT_SECRET="ADD_YOUR_SECRET"
GOOGLE_CALLBACK_URL="http://localhost:8080/auth/google/callback"
COOKIE_URL="localhost:8080" # or .yourdomain.com
STRIPE_SECRET="ADD_YOUR_STRIPE_SECRET"
STRIPE_WEBHOOK_SECRET="ADD_YOUR_STRIPE_WEBHOOK_SECRET"
STRIPE_PRICE_ID="ADD_YOUR_STRIPE_PRICE_ID"
EOF
echo "✅ .env generated."
else
echo "✅ .env file found."
fi
# Check for the database file if it does not exist
if [ ! -f ./db/database.db ]; then
echo "🤖 database not found. Generating..."
mkdir ./db
touch ./db/database.db
echo "✅ database.db generated."
else
echo "✅ database file found."
fi
# Start the development server with cargo watch
cargo watch -x run