12111a9562
- Backend (api-server): Complete in-memory mock DB with 11 seed cases, 5 eligible beneficiaries, 3 donors, and WhatsApp log. All 14 API routes implemented across requests, donors, stats, and whatsapp-log. OpenClaw integration with OPENCLAW_SIMULATE toggle. UUID-based IDs. Full status machine (new → closed, 10 steps). - Frontend (ehsan-poc): 8 pages fully implemented using all generated API hooks: Home (stats counters, 10-step workflow diagram), Request (form with eligibility result), Opportunities (card grid with progress bars), Donate (case summary + donor form), Admin (full data table with contextual action buttons), Track (10-step visual timeline in green), ThankYou (message form), WhatsApp Log (WhatsApp bubble preview + OpenClaw send button). - Bilingual LanguageContext (AR/EN) with RTL/LTR toggle, localStorage persistence. EHSAN green palette (HSL 143), Tajawal font, fully responsive. TypeScript clean — zero errors.
76 lines
1.7 KiB
TypeScript
76 lines
1.7 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import path from "path";
|
|
import runtimeErrorOverlay from "@replit/vite-plugin-runtime-error-modal";
|
|
|
|
const rawPort = process.env.PORT;
|
|
|
|
if (!rawPort) {
|
|
throw new Error(
|
|
"PORT environment variable is required but was not provided.",
|
|
);
|
|
}
|
|
|
|
const port = Number(rawPort);
|
|
|
|
if (Number.isNaN(port) || port <= 0) {
|
|
throw new Error(`Invalid PORT value: "${rawPort}"`);
|
|
}
|
|
|
|
const basePath = process.env.BASE_PATH;
|
|
|
|
if (!basePath) {
|
|
throw new Error(
|
|
"BASE_PATH environment variable is required but was not provided.",
|
|
);
|
|
}
|
|
|
|
export default defineConfig({
|
|
base: basePath,
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
runtimeErrorOverlay(),
|
|
...(process.env.NODE_ENV !== "production" &&
|
|
process.env.REPL_ID !== undefined
|
|
? [
|
|
await import("@replit/vite-plugin-cartographer").then((m) =>
|
|
m.cartographer({
|
|
root: path.resolve(import.meta.dirname, ".."),
|
|
}),
|
|
),
|
|
await import("@replit/vite-plugin-dev-banner").then((m) =>
|
|
m.devBanner(),
|
|
),
|
|
]
|
|
: []),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(import.meta.dirname, "src"),
|
|
"@assets": path.resolve(import.meta.dirname, "..", "..", "attached_assets"),
|
|
},
|
|
dedupe: ["react", "react-dom"],
|
|
},
|
|
root: path.resolve(import.meta.dirname),
|
|
build: {
|
|
outDir: path.resolve(import.meta.dirname, "dist/public"),
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port,
|
|
strictPort: true,
|
|
host: "0.0.0.0",
|
|
allowedHosts: true,
|
|
fs: {
|
|
strict: true,
|
|
},
|
|
},
|
|
preview: {
|
|
port,
|
|
host: "0.0.0.0",
|
|
allowedHosts: true,
|
|
},
|
|
});
|