Add digital catalog with shareable flipbook and ktg.montzar.ir deploy files.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 14:37:49 +03:30
co-authored by Cursor
commit a8374e7d6c
54 changed files with 8462 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import path from "node:path";
export type Env = {
port: number;
apiPort: number;
publicBaseUrl: string;
storageDir: string;
databasePath: string;
isProduction: boolean;
};
export function loadEnv(overrides: Partial<NodeJS.ProcessEnv> = {}): Env {
const read = (key: string, fallback: string) =>
overrides[key] ?? process.env[key] ?? fallback;
const isProduction =
(overrides.NODE_ENV ?? process.env.NODE_ENV) === "production";
return {
port: Number(read("PORT", "3000")),
apiPort: Number(read("API_PORT", "3010")),
publicBaseUrl: read("PUBLIC_BASE_URL", "http://localhost:3000").replace(
/\/$/,
"",
),
storageDir: path.resolve(read("STORAGE_DIR", "./storage")),
databasePath: path.resolve(read("DATABASE_PATH", "./data/catalogs.sqlite")),
isProduction,
};
}