You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/dkv204p/GigShield-AI.git
cd GigShield-AI
cp .env.example .env
Edit .env with your values:
DATABASE_URL=postgresql://gigshield:password@localhost:5432/gigshieldJWT_SECRET=your_strong_random_secretWEATHER_API_KEY=your_openweathermap_key# Get free at openweathermap.orgAQI_API_KEY=your_waqi_key# Get free at aqicn.org/data-platform/token
cd server
npm install
# Run migrations (alternative to psql method)
npm run migrate
# Seed initial data
npm run seed
# Start dev server (with auto-reload)
npm run dev
# → API running at http://localhost:5000# → Health check: http://localhost:5000/api/health
cd client
npm install
# Start dev server
npm run dev
# → http://localhost:5173
6. Trigger Engine (Optional)
cd server
npm run trigger-engine
# Runs cron jobs: 10m scan, 30m AQI, 1h policy expiry
7. Demo Data
cd server
# Seed demo workers, zones, and policies
npm run demo:seed
# Run the full end-to-end demo
npm run demo:run
# Simulate specific disruptions
npm run demo:simulate -- --type heavy_rain --zone "Andheri West"
npm run demo:simulate -- --type monsoon --zone all
Demo Credentials
Role
Phone
Password
Admin
9999999999
admin123
Worker (Zomato)
9876543210
worker123
Workers (Others)
9876543211–15
worker123
Docker Setup
# Start everything with one command
docker compose up -d --build
# Seed demo data
docker compose exec server npm run demo:seed
# View logs
docker compose logs -f server
# Stop all
docker compose down
Service Ports
Service
Port
Frontend (Nginx)
80
Backend API
5000
Premium AI
8001
Fraud AI
8002
PostgreSQL
5432
Redis
6379
Troubleshooting
Issue
Solution
ECONNREFUSED :5432
Start PostgreSQL: sudo systemctl start postgresql
JWT_SECRET not set
Add JWT_SECRET to your .env file
Vite build fails
Use Node.js ≥ 20.19 or 22.12+, or Vite 5
Python pip fails
Use python3 -m pip install or create a venv
AI service connection refused
Ensure AI services are running on ports 8001/8002
CORS errors
Backend CORS is configured for localhost:5173 and localhost:3000