From 00834dcb7e00f80e318767d93029edff7bd5431e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 10 May 2026 23:55:00 -0400 Subject: [PATCH] fix api production deployment --- .env.docker.production | 66 ++++++++++++++++++++++++++++++++++++ packages/types/package.json | 5 +-- packages/types/tsconfig.json | 8 +---- 3 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 .env.docker.production diff --git a/.env.docker.production b/.env.docker.production new file mode 100644 index 0000000..4c73881 --- /dev/null +++ b/.env.docker.production @@ -0,0 +1,66 @@ +# ── Traefik domains — used in docker-compose labels ────────────────────────── +ACME_EMAIL=rentaldrivego@gmail.com +MARKETPLACE_DOMAIN=rentaldrivego.ma +API_DOMAIN=api.rentaldrivego.ma +DASHBOARD_DOMAIN=dashboard.rentaldrivego.ma +ADMIN_DOMAIN=admin.rentaldrivego.ma +PUBLIC_SITE_DOMAIN=rentaldrivego.ma +PGMANAGE_DOMAIN=pgmanage.rentaldrivego.ma + +DATABASE_URL=postgresql://postgres:change-me@postgres:5432/rentaldrivego +REDIS_URL=redis://redis:6379 + +# ── API ──────────────────────────────────────────────────────────────────────── +API_PORT=4000 +# SSR server-side calls go via the internal Docker network +API_INTERNAL_URL=http://api:4000/api/v1 +# Public-facing API URL visible to browsers — MUST be your real domain, not localhost +API_URL=https://api.rentaldrivego.ma +# Baked into Next.js bundles at build time — MUST be set before running `npm run build` +NEXT_PUBLIC_API_URL=https://api.rentaldrivego.ma/api/v1 + +# ── Frontend public URLs ─────────────────────────────────────────────────────── +NEXT_PUBLIC_MARKETING_URL=https://rentaldrivego.ma +NEXT_PUBLIC_MARKETPLACE_URL=https://rentaldrivego.ma/explore +NEXT_PUBLIC_DASHBOARD_URL=https://dashboard.rentaldrivego.ma +NEXT_PUBLIC_ADMIN_URL=https://admin.rentaldrivego.ma +NEXT_PUBLIC_PUBLIC_SITE_DOMAIN=rentaldrivego.ma +DASHBOARD_URL=https://dashboard.rentaldrivego.ma + +# ── CORS ────────────────────────────────────────────────────────────────────── +# Comma-separated list of allowed browser origins. REQUIRED in production. +CORS_ORIGINS=https://rentaldrivego.ma,https://dashboard.rentaldrivego.ma,https://admin.rentaldrivego.ma + +# ── Auth ────────────────────────────────────────────────────────────────────── +JWT_SECRET=PMPS5k0D7rUeJOk0NkhI5bRtoGjkUqjK +JWT_EXPIRY=8h +RENTER_JWT_EXPIRY=7d + +# ── Database ────────────────────────────────────────────────────────────────── +POSTGRES_PASSWORD=24DY@1u5FLCkNMeiO@p +NODE_ENV=production + +# ── Email (choose one: Resend API or SMTP) ──────────────────────────────────── +# Option A — Resend +RESEND_API_KEY=C8qPDuFwsv5l@KsGhL/V +EMAIL_FROM=noreply@rentaldrivego.ma +EMAIL_FROM_NAME=RentalDriveGo +# Option B — SMTP +# MAIL_HOST=smtp.rentaldrivego.ma +# MAIL_PORT=587 +# MAIL_USERNAME=smtp-user +# MAIL_PASSWORD=smtp-password +# MAIL_SCHEME=smtp +# MAIL_FROM_ADDRESS=noreply@rentaldrivego.ma +# MAIL_FROM_NAME=RentalDriveGo + +# ── Firebase push notifications (optional) ──────────────────────────────────── +# FIREBASE_PROJECT_ID=your-firebase-project-id +# FIREBASE_CLIENT_EMAIL=firebase-adminsdk@your-project.iam.gserviceaccount.com +# FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n" + +# ── Twilio SMS / WhatsApp (optional) ───────────────────────────────────────── +# TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +# TWILIO_AUTH_TOKEN=your_auth_token +# TWILIO_PHONE_NUMBER=+1234567890 +# TWILIO_WHATSAPP_NUMBER=+1234567890 diff --git a/packages/types/package.json b/packages/types/package.json index 8131fdb..44295b0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -2,9 +2,10 @@ "name": "@rentaldrivego/types", "version": "1.0.0", "private": true, - "main": "./src/index.ts", - "types": "./src/index.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "scripts": { + "build": "tsc", "type-check": "tsc --noEmit" }, "devDependencies": { diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index 4d7a5fd..67fbcb5 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,15 +1,9 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", - "module": "ESNext", - "moduleResolution": "Bundler", - "strict": true, - "skipLibCheck": true, - "noEmit": true, "rootDir": "./src", "outDir": "./dist", - "declaration": false, + "declaration": true, "declarationMap": false, "sourceMap": false },