| echo "π Building SETA Smart Inventory for static deployment..." | |
| # Check if Node.js is installed | |
| if ! command -v node &> /dev/null; then | |
| echo "β Node.js is not installed. Please install Node.js 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 | |
| # Install dependencies | |
| echo "π¦ Installing dependencies..." | |
| npm install | |
| if [ $? -ne 0 ]; then | |
| echo "β Failed to install dependencies" | |
| exit 1 | |
| fi | |
| # Build the application | |
| echo "π¨ Building application..." | |
| npm run build | |
| if [ $? -ne 0 ]; then | |
| echo "β Build failed" | |
| exit 1 | |
| fi | |
| echo "β Build complete! Static files are in the 'out' directory." | |
| echo "" | |
| echo "π You can now deploy the 'out' folder to any static hosting service." | |
| echo "" | |
| echo "π Deployment options:" | |
| echo " - Vercel: Connect your GitHub repo to Vercel" | |
| echo " - Netlify: Drag and drop the 'out' folder to Netlify" | |
| echo " - GitHub Pages: Push 'out' contents to gh-pages branch" | |
| echo " - Any static hosting: Upload 'out' folder contents" | |
| echo "" | |
| echo "π To test locally, you can serve the 'out' directory with any static server" | |
| echo " Example: npx serve out" | |