Scripty is a self-hosted collaborative screenwriting app built with Next.js, NextAuth, Prisma, Socket.IO, and PostgreSQL.
It is designed for small invite-only teams that want real-time script editing, comments, sharing, exports, and writing stats without relying on a third-party SaaS.
- Real-time collaborative screenplay editor with live cursors and selections
- Screenplay-aware line types: scene headings, action, character, dialogue, parenthetical, transition, shot
- Invite-only Google sign-in with admin-controlled access
- Script sharing with collaborator roles and public read-only links
- Inline text comments with replies, reactions, and resolve/reopen flow
- Revision snapshots and per-script restore points
- Writing stats, streaks, contribution graph, and per-script word/page totals
- Profile setup with custom display name and avatar upload
- Export to PDF, Fountain, Final Draft (
.fdx), and plain text - Built-in pomodoro timer and script chat
- Next.js 16 App Router
- React 19
- NextAuth with Google OAuth
- Prisma + PostgreSQL
- Socket.IO for presence and collaboration
- MinIO for avatar storage
- Nodemailer for invite emails
- Puppeteer for PDF export
- Authentication is Google-only.
- Access is invite-gated by email.
- The email in
ADMIN_EMAILis always allowed to sign in and administer the app. - Other users must exist in the
Invitetable before they can get through login. - Collaboration permissions are role-based:
viewer,editor, andadmin. - Public share links are read-only.
- Node.js 20+
- PostgreSQL
- A Google OAuth app
- MinIO or another S3-compatible object store if you want avatar uploads
- SMTP credentials if you want invite emails to send successfully
For PDF export, Puppeteer must be able to launch Chromium on the host.
Copy .env.example to .env and fill in the values:
cp .env.example .envImportant variables:
GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET: Google OAuth credentialsNEXTAUTH_SECRET: required in productionNEXTAUTH_URL: canonical app URL, for examplehttp://localhost:3009NEXT_PUBLIC_APP_URL: public app URL used in links and emailsDATABASE_URL: PostgreSQL connection stringADMIN_EMAIL: bootstrap admin accountMINIO_*: avatar storage configurationSMTP_*: outbound email configuration
Default local port is 3009.
- Start PostgreSQL.
You can use the included compose example:
docker compose -f docker-compose.example.yml up -d- Install dependencies.
npm install-
Create
.envfrom.env.exampleand configure Google OAuth, database, and auth values. -
Run Prisma migrations.
npm run db:migrate- Start the app.
npm run devOpen http://localhost:3009.
Create a Google OAuth application and add these callback settings:
- Authorized redirect URI:
http://localhost:3009/api/auth/callback/google - For production, use your real domain instead of localhost
The app uses secure cookies automatically when NEXTAUTH_URL is https://....
- Set
ADMIN_EMAILto the Google account that should own the instance. - Sign in with that account.
- Use Settings to invite additional users.
Invited users must sign in with the same email address that was invited.
Avatars are uploaded to MinIO using the configured bucket in MINIO_BUCKET.
Make sure the bucket exists before testing avatar uploads.
npm run dev
npm run build
npm run start
npm run db:migrate
npm run db:studioNotes:
npm run buildrunsnext buildand then restarts theScriptyPM2 process.npm run startserves the app on port3009throughserver.js.server.jshosts both Next.js and Socket.IO on the same HTTP server.
- Set a real
NEXTAUTH_SECRET. The app will error in production without it. - Set
NEXTAUTH_URLandNEXT_PUBLIC_APP_URLto the deployed URL. - Make sure Chromium can launch for PDF export.
- Make sure SMTP credentials are valid if you rely on email invites.
- The app expects to run behind a persistent Node process. This repo uses PM2 in its build script.
src/app/ App Router pages and API routes
src/components/editor/ Editor, comments, toolbar, page layout
src/components/shared/ Header, export/share/profile UI
src/components/sidebar/ Scene list, characters, revisions, collaborators
src/components/stats/ Writing graphs and charts
src/lib/ Auth, DB, exporters, mailer, MinIO, helpers
prisma/ Prisma schema and migrations
server.js Custom Next + Socket.IO server
PDF: screenplay-styled PDF with title page and page numberingFountain: plain-text screenplay formatFDX: Final Draft 12 XMLTXT: readable plain text export
- There is no automated test suite in this repo yet.
- PDF pagination is screenplay-aware, but not a full Final Draft clone.
- Invite email delivery depends entirely on valid SMTP configuration.
No license file is currently included in this repository.