-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·61 lines (52 loc) · 1.92 KB
/
setup.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.92 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
#!/bin/bash
echo "🚀 FHIRTogether Setup Script"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Skip Node.js checks and .env creation if running inside a Docker container
if [ -f /.dockerenv ]; then
echo "Running inside Docker. Skipping Node.js checks and .env setup."
else
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js v18+ first."
echo " Visit: https://nodejs.org/"
exit 1
fi
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
echo "⚠️ Node.js version 18+ required. Current version: $(node -v)"
echo " Please upgrade Node.js"
exit 1
fi
echo "✓ Node.js $(node -v) detected"
echo ""
# Install dependencies
echo "📦 Installing dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install dependencies"
exit 1
fi
echo ""
echo "✓ Dependencies installed successfully"
echo ""
# Create .env if it doesn't exist
if [ ! -f .env ]; then
echo "📝 Creating .env file..."
cp .env.example .env
echo "✓ .env file created"
else
echo "✓ .env file already exists"
fi
fi
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo " 1. Generate sample data: npm run generate-data"
echo " 2. Start the server: npm run dev"
echo " 3. Visit Swagger docs: http://localhost:3000/docs"
echo ""
echo "See QUICKSTART.md for detailed instructions."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"