-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-fullstack.sh
More file actions
61 lines (51 loc) · 1.61 KB
/
start-fullstack.sh
File metadata and controls
61 lines (51 loc) · 1.61 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
# Walmart Smart Perishables Dashboard - Quick Start Script
echo "🚀 Starting Walmart Smart Perishables Dashboard (Full Stack)"
echo "============================================================"
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
exit 1
fi
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "❌ npm is not installed. Please install npm first."
exit 1
fi
echo "✅ Node.js and npm are available"
# Install dependencies if node_modules doesn't exist
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "❌ Failed to install dependencies"
exit 1
fi
else
echo "✅ Dependencies already installed"
fi
# Create .env file if it doesn't exist
if [ ! -f ".env" ]; then
echo "⚙️ Creating environment configuration..."
cp .env.example .env
echo "✅ Created .env file - you can edit it to add your OpenAI API key"
else
echo "✅ Environment configuration found"
fi
# Build the application
echo "🔨 Building application..."
npm run build
if [ $? -ne 0 ]; then
echo "❌ Build failed"
exit 1
fi
echo "✅ Build completed successfully"
# Start the server
echo "🚀 Starting production server..."
echo ""
echo "💾 Database: SQLite (walmart_perishables.db)"
echo "🔐 Default Login: admin@walmart.com / admin123"
echo "🤖 GenAI: Set OPENAI_API_KEY in .env for real AI features"
echo ""
echo "============================================================"
npm start