Compare commits

..

No commits in common. "e244b9f9fd6aa4091010819d97569c5ab68957a6" and "3a31201c3e7876e4043db7456363ecad79139d96" have entirely different histories.

2 changed files with 2 additions and 58 deletions

View file

@ -1,53 +0,0 @@
# 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 <repo-url>
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).

View file

@ -1,6 +1,3 @@
import { createClient } from '@supabase/supabase-js'; const supabase = createClient('https://your-project.supabase.co', 'your-anon-key');
export const supabase = createClient( export default supabase;
process.env.VITE_SUPABASE_URL as string,
process.env.VITE_SUPABASE_ANON_KEY as string
);