See the top-level README for the overall architecture, client protocol, and message formats. This file covers only what is specific to this Next.js project.
This project uses a modified Next.js with breaking changes from upstream. Before editing server code, read the relevant guide in node_modules/next/dist/docs/ — public Next.js documentation may be wrong for this repo. See AGENTS.md / CLAUDE.md.
src/app/
├── api/ingest/route.js HTTP POST endpoint for keylogger client
├── api/events/route.js SSE endpoint for dashboard updates
├── api/mode/route.js Dashboard mode (raw/structured) endpoint
├── layout.js
└── page.js Dashboard: connects to /api/events via SSE
- The keylogger client batches keystrokes and POSTs them to
/api/ingest. - The server appends logs to Upstash Redis.
- The dashboard connects to
/api/events(SSE) to receive real-time updates. - Dashboard mode (raw/structured) is set via
/api/modeand returned to the client in each POST response.
npm install
npm run devDashboard: http://localhost:3000. SSE endpoint: /api/events. In production, use https://keylogger-py.vercel.app.