Product monorepo.
app/: Next.js web appemail-templates/: MJML sources for transactional emails (built intoapp/).ops-app/,ops-marketing/,ops-certificate/: AWS CDK stacks.
- Node.js 20.x (see
app/package.json->volta.node) - Postgres (for
app/) - Optional:
direnv(the app includes an.envrcthat loads.envand.env.local)
- Install dependencies:
cd app
npm ci- Configure environment:
cd app
cp -n .env.local.example .env.localEdit app/.env.local and set at least:
DB_HOSTNAME(usuallylocalhost)DB_DATABASE(default:auditre)DB_USERDB_PASSWORDAUTH_SECRET(generate one; e.g.openssl rand -hex 32)
- Create/reset the database and run migrations:
cd app
npm run reset- Run the dev server:
cd app
npm run devOpen https://localhost:3000.
Notes:
app/bin/db-reset.jswill create the database if it does not exist, then drops all tables/schemas/extensions and re-runs SQL migrations fromapp/migrations/.- Creating the database requires that
DB_USERcan create databases; if it cannot, createDB_DATABASEmanually first. npm run devusesnext dev --experimental-https; your browser will likely warn about a self-signed cert the first time.
cd app
npm run lint
npm run test
npm run tsEdit MJML in email-templates/, then build to copy compiled HTML into the app:
cd email-templates
npm ci
npm run buildEach ops-* folder is its own CDK TypeScript project.
cd ops-app
npm ci
npm run build
cdk synth


