chore: initial commit — monorepo ReadaBook (API NestJS, web PWA, Docker)

This commit is contained in:
Git Agent
2026-08-23 09:56:53 +02:00
commit 8f1140127f
79 changed files with 6456 additions and 0 deletions

View File

@ -0,0 +1,34 @@
import { mkdirSync } from "node:fs";
import { dirname, resolve } from "node:path";
export type AppConfig = {
nodeEnv: string;
host: string;
port: number;
databasePath: string;
storageDir: string;
jwtSecret: string;
cookieName: string;
cookieSecure: boolean;
openLibraryEnabled: boolean;
};
export function loadConfig(): AppConfig {
const databasePath = resolve(process.env.DATABASE_PATH ?? "./data/readabook.sqlite");
const storageDir = resolve(process.env.STORAGE_DIR ?? "./data/storage");
mkdirSync(dirname(databasePath), { recursive: true });
mkdirSync(storageDir, { recursive: true });
return {
nodeEnv: process.env.NODE_ENV ?? "development",
host: process.env.HOST ?? "0.0.0.0",
port: Number(process.env.PORT ?? 3000),
databasePath,
storageDir,
jwtSecret: process.env.JWT_SECRET ?? "dev-change-me-readabook",
cookieName: process.env.AUTH_COOKIE_NAME ?? "readabook_session",
cookieSecure: process.env.COOKIE_SECURE === "true",
openLibraryEnabled: process.env.OPEN_LIBRARY_ENABLED !== "false"
};
}