Deployment
Papex can be deployed to Vercel, any Docker environment, or a self-hosted server.
Vercel
- Import the repo into Vercel.
- Set env vars:
DATABASE_URL,AUTH_SECRET. - Build command:
npm run build(output handled by Next.js). - Bind Postgres via Vercel Storage, or fill an external
DATABASE_URL. - Run migrations once after deploy:
npm run db:migrate. - PDF storage: Vercel's filesystem is read-only at runtime, so set
STORAGE_DRIVER=s3and thePAPEX_S3_*variables (see Configuration → Storage). The streaming route then redirects to a presigned object URL instead of serving bytes from disk.
Docker / self-hosted
Use the root docker-compose.yml to run app + database together:
bash
docker compose up -dOr run only Postgres in Docker and build the Next.js image yourself:
bash
docker build -t papex .
docker run -e DATABASE_URL=... -e AUTH_SECRET=... -p 3000:3000 papexDocs site
Docs are built with VitePress into public/docs and served by the main app at /docs:
bash
npm run docs:build