Context
Quotient is a solo side project. I built it to collect quotes, notes and drafts in one place, group them into collections, and keep earlier versions around while I rewrite. The code is public on GitHub and the app runs on Vercel with a Neon Postgres database.
The first pass landed in early December 2024 with the schema, Google sign-in, the notes and collections pages, an analytics page and a small MDX blog. I came back to it in late July 2025 to add search in the navbar, an AI drafting modal and shared editing through links.
It’s one Next.js 14 app on the App Router. I kept pages and API route handlers side by side, Prisma talks to Postgres, and NextAuth handles sign-in. There’s no separate backend, and I didn’t want one.
What’s in it
Writing and notebooks
A piece of writing has a title, HTML content, a word count and time spent. Pieces can belong to collections, which work as notebooks. The notes page shows them as cards, and opening one gives a TipTap editor with headings, block quotes, lists, underline and strike. An unsaved changes prompt stops you from closing the editor and losing work.
I do export in the browser. A piece can be downloaded as a Word file built with docx or a PDF built with jsPDF, after the HTML is run through DOMPurify.
Version history
Every update goes through one Prisma transaction. It updates the writing, reads the latest version number, writes version n+1, then deletes any version past the newest three. The history panel reads those three back in order. That’s enough to restore a draft I just wrecked, without building a separate undo system.
Search
The search route matches the query against titles and content with a case insensitive contains, scoped to the signed in user, and returns matching pieces and collections together. It needs at least two characters. That’s fine at the size of one person’s notes. If it grew, I’d need a real index.
Sharing and co-editing
Sharing is built on two tables. ShareToken holds the token, an active flag, an optional expiry and a cap that defaults to three users. Collaborator links a user to a piece with a role of owner, editor or viewer. Opening a share link checks the token, the expiry and the cap, then adds you as an editor.
The shared editor saves through a PATCH route that lets owners and editors write, and viewers get a read only editor. I tried live sync with Yjs and a websocket server first. Then I removed those routes and kept plain saves, which meant one less server to run. Saves are debounced by 2 seconds and the collaborator list refreshes every 30 seconds.
AI drafting
The AI modal sends a prompt and optional context to one route, which calls Llama 4 Scout on Groq with a system prompt that lists the allowed HTML tags. The route then strips empty paragraphs, empty list items and stacked line breaks before returning the result, so the draft drops into the editor cleanly. The route requires a signed in user.
Activity tracking
Each save updates the user’s last active time. If the gap since the last activity is between 1 minute and 3 hours, it is added to total time spent. Shorter gaps are noise. Longer ones are almost always a tab I forgot to close. The analytics page charts this with Recharts.
Constraints
- One developer doing product, design and code.
- Hosted on Vercel, and I wanted to keep it to one deployable app.
- Google is the only sign-in method, which keeps the auth surface small.
- Version history had to stay bounded, since every save writes a full copy.
Results
- Live at quotient-dun.vercel.app with public source on GitHub.
- The first pass went into the public repo over 4 and 5 December 2024, including production fixes for the Google redirect and the Prisma build step.
- 19 commits in total across the two build passes.
- History is capped at three versions per piece, so storage per piece stays bounded no matter how often it is saved.