diff --git a/.env.example b/.env.example index 8443c45..4bab94c 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,71 @@ +# # ============================================================ +# # The Vibe - Fair-Trade Delivery Platform +# # Copy this file to .env and fill in your values +# # ============================================================ + +# # App +# NODE_ENV=development +# PORT=3001 + +# # PostgreSQL + PostGIS +# POSTGRES_HOST=localhost +# POSTGRES_PORT=5433 +# POSTGRES_USER=vibe +# POSTGRES_PASSWORD=vibepass +# POSTGRES_DB=vibe_db +# DATABASE_URL=postgresql://vibe:vibepass@localhost:5433/vibe_db + +# # Redis +# REDIS_HOST=localhost +# REDIS_PORT=6379 +# REDIS_URL=redis://localhost:6379 + +# # JWT +# JWT_SECRET=your-super-secret-jwt-key-change-in-production +# JWT_EXPIRES_IN=7d + +# # Stripe +# STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key +# STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret +# STRIPE_RESTAURANT_PRICE_ID=price_monthly_500 +# STRIPE_DRIVER_DAILY_PRICE_ID=price_daily_20 + +# # Stripe - Public (used in frontend) +# NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key + +# # OSRM Routing +# OSRM_BASE_URL=http://localhost:5000 + +# # Maps (MapTiler - free tier for OSM tiles) +# NEXT_PUBLIC_MAPTILER_KEY=your_maptiler_api_key + +# # Frontend +# NEXT_PUBLIC_API_URL=http://localhost:3001 +# NEXT_PUBLIC_WS_URL=ws://localhost:3001 + +# # Platform Fee Config +# DRIVER_DAILY_FEE=20 +# DRIVER_DELIVERY_FEE=5 +# RESTAURANT_MONTHLY_FEE=500 +# RESTAURANT_PER_ORDER_FEE=0.10 +# PLATFORM_CC_RATE=0.029 +# PLATFORM_CC_FIXED=0.30 + +# # Email (transactional — use Resend, Mailgun, SendGrid, or any SMTP) +# # Leave SMTP_USER empty to disable email (logs to console instead) +# SMTP_HOST=smtp.resend.com +# SMTP_PORT=587 +# SMTP_USER=resend +# SMTP_PASS=re_your_resend_api_key_here +# EMAIL_FROM="The Vibe" + +# # Frontend base URL (used in email links) +# FRONTEND_URL=http://localhost:3000 + +# # Admin +# ADMIN_EMAIL=admin@thevibe.ca + + # ============================================================ # The Vibe - Fair-Trade Delivery Platform # Copy this file to .env and fill in your values @@ -5,15 +73,15 @@ # App NODE_ENV=development -PORT=3001 +PORT=3031 # PostgreSQL + PostGIS POSTGRES_HOST=localhost -POSTGRES_PORT=5432 +POSTGRES_PORT=5433 POSTGRES_USER=vibe POSTGRES_PASSWORD=vibepass POSTGRES_DB=vibe_db -DATABASE_URL=postgresql://vibe:vibepass@localhost:5432/vibe_db +DATABASE_URL=postgresql://vibe:vibepass@localhost:5433/vibe_db # Redis REDIS_HOST=localhost @@ -40,8 +108,8 @@ OSRM_BASE_URL=http://localhost:5000 NEXT_PUBLIC_MAPTILER_KEY=your_maptiler_api_key # Frontend -NEXT_PUBLIC_API_URL=http://localhost:3001 -NEXT_PUBLIC_WS_URL=ws://localhost:3001 +NEXT_PUBLIC_API_URL=http://localhost:3031 +NEXT_PUBLIC_WS_URL=ws://localhost:3031 # Platform Fee Config DRIVER_DAILY_FEE=20 @@ -57,10 +125,10 @@ SMTP_HOST=smtp.resend.com SMTP_PORT=587 SMTP_USER=resend SMTP_PASS=re_your_resend_api_key_here -EMAIL_FROM="The Vibe" +EMAIL_FROM="The Vibe" # Frontend base URL (used in email links) -FRONTEND_URL=http://localhost:3000 +FRONTEND_URL=http://localhost:3032 # Admin ADMIN_EMAIL=admin@thevibe.ca diff --git a/package-lock.json b/package-lock.json index 48cd4d1..404deb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "packages/*" ], "devDependencies": { - "concurrently": "^8.2.2" + "concurrently": "^8.2.2", + "dotenv-cli": "^11.0.0" } }, "node_modules/@alloc/quick-lru": { @@ -9957,6 +9958,64 @@ "url": "https://dotenvx.com" } }, + "node_modules/dotenv-cli": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-11.0.0.tgz", + "integrity": "sha512-r5pA8idbk7GFWuHEU7trSTflWcdBpQEK+Aw17UrSHjS6CReuhrrPcyC3zcQBPQvhArRHnBo/h6eLH1fkCvNlww==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.6", + "dotenv": "^17.1.0", + "dotenv-expand": "^12.0.0", + "minimist": "^1.2.6" + }, + "bin": { + "dotenv": "cli.js" + } + }, + "node_modules/dotenv-cli/node_modules/dotenv": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz", + "integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-cli/node_modules/dotenv-expand": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.3.tgz", + "integrity": "sha512-uc47g4b+4k/M/SeaW1y4OApx+mtLWl92l5LMPP0GNXctZqELk+YGgOPIIC5elYmUH4OuoK3JLhuRUYegeySiFA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dotenv": "^16.4.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-cli/node_modules/dotenv-expand/node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/dotenv-expand": { "version": "11.0.7", "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-11.0.7.tgz", @@ -10866,17 +10925,6 @@ } } }, - "node_modules/expo/node_modules/@types/react": { - "version": "19.2.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", - "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "csstype": "^3.2.2" - } - }, "node_modules/expo/node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", @@ -16473,17 +16521,6 @@ } } }, - "node_modules/nativewind/node_modules/@types/react": { - "version": "19.2.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", - "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "csstype": "^3.2.2" - } - }, "node_modules/nativewind/node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", diff --git a/package.json b/package.json index 4c63b94..ba9906e 100644 --- a/package.json +++ b/package.json @@ -8,15 +8,19 @@ ], "scripts": { "dev": "concurrently \"npm run dev:backend\" \"npm run dev:web\"", + "sdev": "concurrently \"npm run start:backend\" \"npm run dev:web\"","ndev": "dotenv -e .env -- concurrently \"npm run start:backend\" \"npm run dev:web\"", "dev:backend": "npm run dev --workspace=packages/backend", - "dev:web": "npm run dev --workspace=packages/web", - "build": "npm run build --workspaces", + "start:backend": "npm start --workspace=packages/backend", + "dev:web": "PORT=3032 npm run dev --workspace=packages/web", + "build_old": "npm run build --workspaces", + "build": "npm run build --workspace=@vibe/backend && npm run build --workspace=@vibe/web", "db:migrate": "npm run migrate --workspace=packages/backend", "db:seed": "npm run seed --workspace=packages/backend", - "docker:up": "docker-compose up -d", - "docker:down": "docker-compose down" + "docker:up": "docker compose up -d", + "docker:down": "docker compose down" }, "devDependencies": { - "concurrently": "^8.2.2" + "concurrently": "^8.2.2", + "dotenv-cli": "^11.0.0" } } diff --git a/packages/database/reset-dev-passwords.js b/packages/database/reset-dev-passwords.js index c593dfe..f3ac69d 100644 --- a/packages/database/reset-dev-passwords.js +++ b/packages/database/reset-dev-passwords.js @@ -19,7 +19,7 @@ const DEV_USERS = [ async function main() { const client = new Client({ host: process.env.POSTGRES_HOST || 'localhost', - port: parseInt(process.env.POSTGRES_PORT || '5432'), + port: parseInt(process.env.POSTGRES_PORT || '5433'), user: process.env.POSTGRES_USER || 'vibe', password: process.env.POSTGRES_PASSWORD || 'vibepass', database: process.env.POSTGRES_DB || 'vibe_db',