Markdown-first reading with built-in vocabulary highlights, annotations, and authenticated share links.
- Copy
.env.exampleto.envif you do not already have one. - Set
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETin.env. - Set
NEXTAUTH_SECRETin.env. - Use the local Postgres credentials from
docker-compose.yml:- database:
eng_copilot - username:
eng_copilot - password:
eng_copilot DATABASE_URL="postgresql://eng_copilot:eng_copilot@localhost:5432/eng_copilot?schema=public"
- database:
- Keep
NEXTAUTH_URL="http://localhost:3000"unless your Google OAuth redirect URI is configured differently. - Start Postgres with
docker compose up -d postgres. - Install dependencies with
npm install. - Generate the Prisma client with
npm run db:generate. - Push the schema into the local database with
npm run db:push. - Seed the built-in word lists with
npm run db:seed. - Start the app with
npm run dev.
This project is a single Next.js application. Running npm run dev starts both the frontend and the server-side backend routes locally.
Built-in lists are loaded from vendor/word-lists/*.txt into PostgreSQL by the seed script. The app does not read those text files on each request.
If you update vendor/word-lists/cet4.txt, vendor/word-lists/cet6.txt, or vendor/word-lists/exclusion.txt:
- Run
npm run db:seedto sync the updated list into the database. - You do not need to restart the app.
- Existing documents will not change automatically. To apply the new list contents to an existing document, open the document and toggle the relevant built-in list off and on again so the highlights are recomputed.
- Open Google Cloud Console and create or select a project.
- Configure the OAuth consent screen for the Google accounts you want to use in development.
- Create an
OAuth 2.0 Client IDwith application typeWeb application. - Add the local origin:
http://localhost:3000
- Add the local redirect URI:
http://localhost:3000/api/auth/callback/google
- Copy the generated client id and client secret into
.envasGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. - Keep
NEXTAUTH_URLaligned with the same host used in the OAuth client. If you switch to127.0.0.1, update both the Google OAuth client and.env.
- Unit tests:
npm test - E2E:
npm run test:e2e -- tests/e2e/owner-upload-and-share.spec.ts
The Playwright E2E seeds Auth.js database sessions directly for owner and viewer contexts. It does not run real Google OAuth.
The spec expects the built-in word lists to exist in the database, so run npm run db:seed before E2E.
When DATABASE_URL or NEXTAUTH_SECRET is missing, or the built-in word lists have not been seeded, the E2E skips with a clear reason instead of crashing. When those env vars are present, Playwright starts its own local Next.js app on http://127.0.0.1:3000 for the run.
- Real Google auth smoke checklist: docs/operations/google-auth-smoke-checklist.md
- Built-in word list update runbook: docs/operations/built-in-word-list-update-runbook.md