Installation
Installation
Section titled “Installation”This page provides the full installation process for reproducible local and validation environments.
Installation should prioritize reproducibility over speed
Section titled “Installation should prioritize reproducibility over speed”A successful installation is not only “the app runs once”; it is also deterministic across contributors and CI contexts. This guide standardizes tool versions, environment variables, migration behavior, and validation checks.
System requirements are defined by runtime and tooling
Section titled “System requirements are defined by runtime and tooling”Leci currently requires:
- Node.js
>=20.0.0 - npm
>=10.0.0 - PostgreSQL instance reachable via
DATABASE_URL
Recommended verification commands:
node -vnpm -vIf you use nvm, the repository includes:
cat .nvmrc# expected: 20Environment variables are required for database and workflows
Section titled “Environment variables are required for database and workflows”The project ships .env.example with currently recognized variables:
DATABASE_URL=DISCORD_PR_REVIEW_WEBHOOK=Variable purpose and usage
Section titled “Variable purpose and usage”DATABASE_URLis required for local migration and Drizzle tooling.DISCORD_PR_REVIEW_WEBHOOKis used by GitHub Actions and is optional for local app development.
Standard local installation flow
Section titled “Standard local installation flow”Use this flow for developer machines.
# Clone and enter repositorygit clone https://github.com/sensdiego/leci.gitcd leci
# Ensure correct Node version (if using nvm)nvm use || nvm install
# Install dependenciesnpm install
# Prepare envcp .env.example .env
# Edit .env and set DATABASE_URL
# Run migrationsnpx tsx scripts/migrate.ts
# Run baseline checksnpm run lintnpm test
# Start appnpm run devMigration internals and operational implications
Section titled “Migration internals and operational implications”The migration workflow is SQL-file based and currently simple by design.
How migration order is computed
Section titled “How migration order is computed”script/migrate.ts sorts migration files by numeric prefix before execution (e.g., 0001_, 0002_, …).
How migration execution works
Section titled “How migration execution works”For each SQL file in order, the script:
- reads file contents;
- executes SQL against the configured PostgreSQL connection;
- prints
Applied <filename>on success.
Current safety profile
Section titled “Current safety profile”The initial migration (drizzle/0001_init.sql) uses mostly idempotent DDL patterns (IF NOT EXISTS) and ON CONFLICT DO NOTHING for seed values.
Installation mode: CI-like validation
Section titled “Installation mode: CI-like validation”Use this mode to emulate pipeline checks before opening a PR.
npm cicp .env.example .env# set DATABASE_URL for validation environmentnpx tsx scripts/migrate.tsnpm run lintnpm testnpm run buildWhy this mode matters:
npm cicatches lockfile drift.buildcatches production-compile issues not visible in dev mode.
Installation mode: production-like smoke
Section titled “Installation mode: production-like smoke”This mode validates the artifact lifecycle locally.
npm cicp .env.example .env# set DATABASE_URLnpx tsx scripts/migrate.tsnpm run buildnpm run startExpected result:
- server starts successfully;
- homepage loads;
- metadata/title aligns with Leci branding.
Deterministic validation checklist
Section titled “Deterministic validation checklist”Use this checklist to confirm installation quality.
- Node and npm versions satisfy
engines. - Dependencies install without lockfile conflicts.
-
.envexists andDATABASE_URLis valid. - Migration command completes and prints applied files.
-
npm run lintpasses. -
npm testexecutes successfully. -
npm run buildsucceeds. -
npm run devserves the homepage on port 3000.
Upgrade and clean reinstall procedure
Section titled “Upgrade and clean reinstall procedure”Use this when switching branches, resolving dependency drift, or onboarding after major updates.
# Optional cleanuprm -rf node_modules
# Reinstall dependenciesnpm ci
# Re-verify environment variablescp .env.example .env # if needed
# Re-run schema migrationsnpx tsx scripts/migrate.ts
# Re-run quality checksnpm run lintnpm testnpm run build🚧 Planned Feature — Internal API endpoint groups are roadmap-defined but not present in
src/app/apiyet.
🚧 Planned Feature — Source ingestion pipeline is a roadmap workstream and not part of current repository runtime.
Known unknowns requiring owner confirmation
Section titled “Known unknowns requiring owner confirmation”Some installation/operations details need explicit owner decisions.
⚠️ Unverified — Official production deployment topology and secret management platform beyond current repository context.