Skip to content

Commit 8d90c9e

Browse files
feat: Add automated setup scripts for easier onboarding
- Added setup.sh for Unix/Linux/macOS systems - Added setup.bat for Windows systems - Scripts automate dependency installation and verification - Include security vulnerability checking - Provide clear next steps for users Makes it easier for contributors to get started quickly
1 parent c870336 commit 8d90c9e

File tree

2 files changed

+169
-0
lines changed

2 files changed

+169
-0
lines changed

β€Žfrontend/setup.batβ€Ž

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@echo off
2+
REM Splitwiser Frontend Quick Setup Script (Windows)
3+
REM This script automates the setup process documented in EXPO_SETUP_GUIDE.md
4+
5+
echo πŸš€ Splitwiser Frontend Quick Setup
6+
echo ==================================
7+
8+
REM Check if Node.js is installed
9+
node --version >nul 2>&1
10+
if errorlevel 1 (
11+
echo ❌ Node.js is not installed. Please install Node.js v16+ from https://nodejs.org/
12+
pause
13+
exit /b 1
14+
)
15+
16+
echo βœ… Node.js found
17+
node --version
18+
19+
REM Check if npm is installed
20+
npm --version >nul 2>&1
21+
if errorlevel 1 (
22+
echo ❌ npm is not installed. Please install npm.
23+
pause
24+
exit /b 1
25+
)
26+
27+
echo βœ… npm found
28+
npm --version
29+
30+
REM Navigate to frontend directory
31+
if not exist "frontend" (
32+
echo ❌ frontend directory not found. Make sure you're in the splitwiser root directory.
33+
pause
34+
exit /b 1
35+
)
36+
37+
cd frontend
38+
echo πŸ“‚ Navigated to frontend directory
39+
40+
REM Install dependencies
41+
echo πŸ“¦ Installing dependencies...
42+
npm install
43+
44+
if errorlevel 1 (
45+
echo ❌ Failed to install dependencies
46+
pause
47+
exit /b 1
48+
)
49+
50+
echo βœ… Dependencies installed successfully
51+
52+
REM Create assets directory if it doesn't exist
53+
if not exist "assets" (
54+
mkdir assets
55+
echo πŸ“ Created assets directory
56+
)
57+
58+
REM Install Expo CLI globally if not present
59+
expo --version >nul 2>&1
60+
if errorlevel 1 (
61+
echo πŸ”§ Installing Expo CLI globally...
62+
npm install -g @expo/cli
63+
64+
if errorlevel 1 (
65+
echo ⚠️ Failed to install Expo CLI globally. You may need to run this as administrator.
66+
echo Manual installation: npm install -g @expo/cli
67+
) else (
68+
echo βœ… Expo CLI installed successfully
69+
)
70+
) else (
71+
echo βœ… Expo CLI already installed
72+
)
73+
74+
REM Check for security vulnerabilities
75+
echo πŸ” Checking for security vulnerabilities...
76+
npm audit --audit-level=moderate
77+
78+
echo.
79+
echo πŸŽ‰ Setup completed successfully!
80+
echo.
81+
echo πŸ“± Next steps:
82+
echo 1. Start the development server: npx expo start
83+
echo 2. Install Expo Go app on your mobile device
84+
echo 3. Scan the QR code to run the app
85+
echo.
86+
echo πŸ“š For detailed instructions, see: docs/EXPO_SETUP_GUIDE.md
87+
echo πŸ“Š For complete analysis, see: docs/EXECUTIVE_SUMMARY.md
88+
89+
pause

β€Žfrontend/setup.shβ€Ž

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/bash
2+
3+
# Splitwiser Frontend Quick Setup Script
4+
# This script automates the setup process documented in EXPO_SETUP_GUIDE.md
5+
6+
echo "πŸš€ Splitwiser Frontend Quick Setup"
7+
echo "=================================="
8+
9+
# Check if Node.js is installed
10+
if ! command -v node &> /dev/null; then
11+
echo "❌ Node.js is not installed. Please install Node.js v16+ from https://nodejs.org/"
12+
exit 1
13+
fi
14+
15+
echo "βœ… Node.js found: $(node --version)"
16+
17+
# Check if npm is installed
18+
if ! command -v npm &> /dev/null; then
19+
echo "❌ npm is not installed. Please install npm."
20+
exit 1
21+
fi
22+
23+
echo "βœ… npm found: $(npm --version)"
24+
25+
# Navigate to frontend directory
26+
if [ ! -d "frontend" ]; then
27+
echo "❌ frontend directory not found. Make sure you're in the splitwiser root directory."
28+
exit 1
29+
fi
30+
31+
cd frontend
32+
33+
echo "πŸ“‚ Navigated to frontend directory"
34+
35+
# Install dependencies
36+
echo "πŸ“¦ Installing dependencies..."
37+
npm install
38+
39+
if [ $? -ne 0 ]; then
40+
echo "❌ Failed to install dependencies"
41+
exit 1
42+
fi
43+
44+
echo "βœ… Dependencies installed successfully"
45+
46+
# Create assets directory if it doesn't exist
47+
if [ ! -d "assets" ]; then
48+
mkdir assets
49+
echo "πŸ“ Created assets directory"
50+
fi
51+
52+
# Install Expo CLI globally if not present
53+
if ! command -v expo &> /dev/null; then
54+
echo "πŸ”§ Installing Expo CLI globally..."
55+
npm install -g @expo/cli
56+
57+
if [ $? -ne 0 ]; then
58+
echo "⚠️ Failed to install Expo CLI globally. You may need to run this with sudo or as administrator."
59+
echo " Manual installation: npm install -g @expo/cli"
60+
else
61+
echo "βœ… Expo CLI installed successfully"
62+
fi
63+
else
64+
echo "βœ… Expo CLI already installed"
65+
fi
66+
67+
# Check for security vulnerabilities
68+
echo "πŸ” Checking for security vulnerabilities..."
69+
npm audit --audit-level=moderate
70+
71+
echo ""
72+
echo "πŸŽ‰ Setup completed successfully!"
73+
echo ""
74+
echo "πŸ“± Next steps:"
75+
echo "1. Start the development server: npx expo start"
76+
echo "2. Install Expo Go app on your mobile device"
77+
echo "3. Scan the QR code to run the app"
78+
echo ""
79+
echo "πŸ“š For detailed instructions, see: docs/EXPO_SETUP_GUIDE.md"
80+
echo "πŸ“Š For complete analysis, see: docs/EXECUTIVE_SUMMARY.md"

0 commit comments

Comments
Β (0)