Compare commits
2 commits
3a31201c3e
...
e244b9f9fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e244b9f9fd | ||
|
|
d7d3f3211f |
2 changed files with 58 additions and 2 deletions
53
README-COOLIFY.md
Normal file
53
README-COOLIFY.md
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
# 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).
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
const supabase = createClient('https://your-project.supabase.co', 'your-anon-key');
|
import { createClient } from '@supabase/supabase-js';
|
||||||
|
|
||||||
export default supabase;
|
export const supabase = createClient(
|
||||||
|
process.env.VITE_SUPABASE_URL as string,
|
||||||
|
process.env.VITE_SUPABASE_ANON_KEY as string
|
||||||
|
);
|
||||||
Loading…
Reference in a new issue