# Coolify Deployment Guide for Internal Freight App ## Prerequisites - Supabase project URL & anon key (set in `.env`) - Node.js >= 18 (handled via Docker build) - Your VPS has Docker + Coolify installed ## File Structure ``` internal-freight-app/ ├── Dockerfile # Docker build for Coolify ├── .dockerignore # Ignore unwanted files ├── .env.example # Environment variables template ├── nginx.conf # Nginx reverse proxy config (default Coolify) ├── vite.config.ts # Vite config (for asset handling) ├── src/ │ └── ... # React + TypeScript source └── package.json ``` ## Deployment Steps on Coolify 1. **Create Application in Coolify** - Source: **Git Repository** → URL = `http://forgejo-vil3xyowqk0qsh4hiqy77e3h.187.127.178.110.sslip.io/iamcoolvivek007/internal-freight-app.git` - Build Pack: **Dockerfile** - Port: `5173` (Vite dev) or `3000` (if using a different server) 2. **Environment Variables** - In **Coolify > Application > Environment**, set these: - `VITE_SUPABASE_URL` = your Supabase project URL (e.g., `https://xyz.supabase.co`) - `VITE_SUPABASE_ANON_KEY` = your Supabase anon/public key 3. **Deploy** - Click **Save & Deploy**. Coolify will push every commit to main automatically (or via webhook). 4. **Database** - Apply the Supabase schema from `supabase-schema.sql` in Supabase SQL Editor: ```sql -- (schema content) ``` ## Local Development (Optional) ```bash git clone cp .env.example .env # Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY npm install npm run dev ``` ## Notes - All data stored in Supabase (no local database required). - For production, swap `npm run dev` with `npm run preview` or add a Nginx server in Coolify (Dockerfile handles this automatically).