-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·50 lines (47 loc) · 1.32 KB
/
dev.sh
File metadata and controls
executable file
·50 lines (47 loc) · 1.32 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
#!/bin/bash
#
# Project Echo: Development Script
#
# Usage:
# ./dev.sh [--quick]
#
# Load environment variables from .env
if [ -f .env ]; then
echo "Loading configuration from .env..."
set -o allexport
source .env
set +o allexport
else
echo "Notice: .env file not found."
fi
# 1. Frontend Build (Flutter)
if [[ "$*" == *"--quick"* ]]; then
echo "------------------------------------------------"
echo "⚡ Skipping Frontend build (--quick selected)"
else
echo "------------------------------------------------"
echo "🎨 Building Frontend (Flutter Web)..."
# Using flutter run -d chrome is for hot reload, but for full integration test we build web.
# For dev convenience, maybe we want to run backend and let user run flutter separately?
# But strictly following the 'build and serve' model:
(cd frontend && flutter build web)
if [ $? -ne 0 ]; then
echo "Error: Flutter build failed."
exit 1
fi
fi
# 2. Backend Build & Run (Go)
echo "------------------------------------------------"
echo "📡 Building and Starting Echo Server..."
cd backend
go build -o server
if [ $? -eq 0 ]; then
port="${PORT:-8080}"
echo "✅ Server starting on port $port..."
echo " - Web App: http://localhost:$port"
echo " - WS: ws://localhost:$port/ws"
./server
else
echo "❌ Backend build failed."
exit 1
fi