-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.sh
47 lines (37 loc) · 850 Bytes
/
startup.sh
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
#!/bin/bash
set -euo pipefail
# Environment setup
source .env
# Define utility functions
log_info() {
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO: $*"
}
log_error() {
echo "$(date +"%Y-%m-%d %H:%M:%S") ERROR: $*" >&2
}
cleanup() {
# Cleanup logic here
}
check_dependencies() {
# Check for required tools
which node || log_error "Node.js is required"
which npm || log_error "npm is required"
which yarn || log_error "yarn is required"
which vite || log_error "vite is required"
which jest || log_error "jest is required"
}
# Start frontend service
start_frontend() {
log_info "Starting frontend service..."
npm run dev
}
# Start backend service (if applicable)
start_backend() {
# Backend startup logic here
}
# Main execution flow
check_dependencies
start_frontend
start_backend
# Trap exit signals
trap cleanup EXIT ERR