Full-stack research discovery app with:
- React + Vite frontend
- Express API
- cookie auth, 2FA, passkeys, trusted devices
- SQLite local mode
- Postgres runtime mode for app, auth, security, and content stores
- Install dependencies:
npm install - Copy env values from
.env.exampleas needed. - Start the app:
npm run dev
Frontend runs on http://localhost:3000.
API runs on http://localhost:3001.
To run the full backend on Postgres:
export DATABASE_URL="postgres://postgres:postgres@localhost:5432/preprint_explorer"
export ENABLE_POSTGRES_APP_STORE=1
export APP_URL="http://localhost:3001"
export WEBAUTHN_RP_ID="localhost"
export WEBAUTHN_ORIGIN="http://localhost:3001"
npm run dev:apiBuild and run with Docker Compose:
docker compose up --buildThis starts:
postgresonlocalhost:5432- the app on
http://localhost:3001
In production mode, the Express server serves the built frontend and the API from the same origin.
npm run lint
npm run build
npm run backup:db
npm run test:e2e:passkey
npm run test:smoke:postgresIf SMTP_URL is set, verification and password-reset emails are sent through SMTP.
Without it, the server falls back to debug logging and returns debugToken values outside production.
INITIAL_ADMIN_EMAILgrants the first moderation/admin role at startup.npm run backup:dbwrites a logical JSON backup into./backupsand keeps the most recentBACKUP_RETENTION_COUNTsnapshots.- In production, the API now emits request IDs, baseline security headers, and a stricter CSP than local development.
GET /api/readyandGET /api/metricsprovide lightweight readiness and operational visibility endpoints.MONITORING_PROVIDER=slackformats alerts for Slack Incoming Webhooks;generic-webhookkeeps the raw JSON event payload.BACKUP_UPLOAD_PROVIDER=s3uploads snapshots to S3-compatible object storage using theBACKUP_S3_*env vars;generic-webhookkeeps the previous HTTP upload mode.- Moderation policy is now server-driven:
MODERATION_AUTO_ASSIGN=1assigns new reports to admins automatically, and severe or repeated reports are auto-escalated based onMODERATION_AUTO_ESCALATE_REASONSandMODERATION_TARGET_REPORT_ESCALATION_THRESHOLD. - The moderation center supports assignees, escalation notes, action history, and bulk moderation actions.