SETA Smart Inventory - Static Deployment Guide
This guide explains how to deploy the SETA Smart Inventory app as a static website.
π Quick Deploy
Option 1: Vercel (Recommended)
- Push your code to GitHub
- Connect your repository to Vercel
- Vercel will automatically detect Next.js and deploy
- Your app will be available at
https://your-app.vercel.app
Option 2: Netlify
- Run
npm run buildlocally - Upload the
outfolder to Netlify - Or connect your GitHub repository to Netlify
Option 3: GitHub Pages
- Run
npm run build - Push the
outfolder contents to yourgh-pagesbranch - Enable GitHub Pages in repository settings
π¦ Build Commands
```bash
Install dependencies
npm install
Build for production (static export)
npm run build
The static files will be in the 'out' directory
```
π§ Configuration
The app is configured for static export with:
output: 'export'innext.config.mjstrailingSlash: truefor better static hosting compatibilityimages.unoptimized: truefor static image handling
π File Structure After Build
``` out/ βββ index.html # Dashboard βββ inventory/ β βββ index.html # Inventory page β βββ scanner/ β β βββ index.html # Scanner page β βββ alerts/ β βββ index.html # Alerts page βββ customers/ β βββ index.html # Customers page βββ whatsapp/ β βββ index.html # WhatsApp page βββ analytics/ β βββ index.html # Analytics page βββ finance/ β βββ index.html # Finance page βββ reports/ β βββ index.html # Reports page βββ _next/ # Next.js assets βββ static/ # Static assets ```
π Custom Domain
To use a custom domain:
- Add a
CNAMEfile to thepublicfolder with your domain - Configure DNS to point to your hosting provider
- Enable HTTPS in your hosting provider settings
π± PWA Features (Optional)
To make the app installable on mobile devices, you can add:
- Web App Manifest (
public/manifest.json) - Service Worker for offline functionality
- App icons in various sizes
π Environment Variables
For static deployment, any environment variables must be prefixed with NEXT_PUBLIC_ to be available in the browser.
Example: ```bash NEXT_PUBLIC_SALESFORCE_API_URL=https://your-salesforce-instance.com ```
π Analytics
You can add analytics by including tracking scripts in the app/layout.tsx file or using Next.js built-in analytics.
π¨ Limitations of Static Export
- No server-side API routes
- No server-side rendering (SSR)
- No incremental static regeneration (ISR)
- All data must be fetched client-side
For full Salesforce integration, you'll need to use client-side API calls or a separate backend service. ```
Let's also add a simple build script for easier deployment: