Papers is a web-first platform for sharing research, discussing work in progress, publishing papers without turning LinkedIn into an accidental preprint server, and building research discovery around interests, follows, and public discussion.
This repository is structured for agentic execution from day one:
apps/web: the Next.js App Router productpackages/auth: Better Auth config and identity integrationpackages/db: Drizzle schema, repositories, and demo-mode fallbackpackages/contracts: domain types and validationpackages/config: runtime configurationpackages/ai: Grok provider and safe-to-send classification boundariespackages/ui: shared UI primitives
- public landing page and feed shell
- sign-in and sign-up pages
- profile pages by handle
- paper creation flow with
publicandblindvisibility modes - comments, follows, stars, and saved-interest actions
- deterministic feed ranking from recency, follows, stars, and topic overlap
- blind-mode serialization rules that suppress author identity publicly
- server-side Grok adapter with explicit safety boundaries
- Trigger.dev tasks for metadata enrichment, PDF processing, and feed refresh
This repo is designed to run in two modes:
managed mode: real Postgres, Better Auth, R2, and Trigger.devdemo mode: no external infra required, powered by a local data fallback
Copy .env.example into .env.local and set what you have. With no
DATABASE_URL, the app falls back to local demo data so the product remains
explorable while the production stack is being configured.
npm install
npm run lint
npm run test
npm run check
npm run buildRun the app:
npm run devOpen http://localhost:3000.
- database: Neon Postgres
- auth: Better Auth with email login and optional ORCID linking
- storage: Cloudflare R2
- jobs: Trigger.dev
- external text model: Grok, server-side only, for public non-blind content
Blind posts never send raw private content, hidden author identity, or blind-mode assets to external model providers.