44 lines
1.2 KiB
Bash
Executable File
44 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🎯 Setting up Grocery Tracker Frontend"
|
|
echo "======================================"
|
|
|
|
# Check if Node.js is installed
|
|
if ! command -v node &> /dev/null; then
|
|
echo "❌ Node.js is not installed!"
|
|
echo ""
|
|
echo "Please install Node.js first:"
|
|
echo " • Option 1: brew install node"
|
|
echo " • Option 2: Download from https://nodejs.org/"
|
|
echo " • Option 3: Use nvm (Node Version Manager)"
|
|
echo ""
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Node.js found: $(node --version)"
|
|
echo "✅ npm found: $(npm --version)"
|
|
|
|
# Install dependencies
|
|
echo ""
|
|
echo "📦 Installing dependencies..."
|
|
npm install
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo ""
|
|
echo "🎉 Frontend setup complete!"
|
|
echo ""
|
|
echo "🚀 To start the development server:"
|
|
echo " npm start"
|
|
echo ""
|
|
echo "📍 The app will be available at: http://localhost:3000"
|
|
echo "🔗 Make sure the backend is running at: http://localhost:8000"
|
|
echo ""
|
|
echo "🛠️ Other useful commands:"
|
|
echo " npm run build - Build for production"
|
|
echo " npm test - Run tests"
|
|
else
|
|
echo ""
|
|
echo "❌ Failed to install dependencies"
|
|
echo "Please check the error messages above"
|
|
exit 1
|
|
fi |