File size: 1,392 Bytes
4f163ba |
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 |
#!/bin/bash
echo "π Setting up Transcreation Sandbox..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "β Node.js is not installed. Please install Node.js (v16 or higher) 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 installed"
# Install root dependencies
echo "π¦ Installing root dependencies..."
npm install
# Install server dependencies
echo "π¦ Installing server dependencies..."
cd server && npm install && cd ..
# Install client dependencies
echo "π¦ Installing client dependencies..."
cd client && npm install && cd ..
# Create .env file if it doesn't exist
if [ ! -f "server/.env" ]; then
echo "π Creating .env file..."
cp server/.env.example server/.env
echo "β
Created server/.env file. Please update it with your configuration."
fi
echo ""
echo "π Setup complete!"
echo ""
echo "To start the development servers:"
echo " npm run dev"
echo ""
echo "Or start them separately:"
echo " # Terminal 1: Backend server"
echo " cd server && npm run dev"
echo ""
echo " # Terminal 2: Frontend server"
echo " cd client && npm start"
echo ""
echo "Make sure MongoDB is running on localhost:27017"
echo "The application will be available at http://localhost:3000" |