Ink is a self-hosted LaTeX editor that lets you write, compile, and preview documents right in the browser. Built as a Turborepo monorepo with a Next.js frontend and a Hono backend, it provides a clean dashboard to manage documents, templates, and trash, and renders LaTeX source to PDF on the fly.
- LaTeX compilation - render LaTeX source to PDF instantly via a server-side compile proxy.
- Split-pane editor - write LaTeX on the left, preview the rendered result on the right.
- Document management - create, edit, search, and organize documents with per-user ownership isolation.
- Archive & trash - archive documents to keep them out of the way or delete them into the trash.
- Templates - get started quickly from a library of document templates.
- OAuth authentication - login with Google or GitHub (JWT access + rotating refresh tokens in httpOnly cookies).
- Typed API contracts - Zod schema validation on every request and response.
| Layer | Technology |
|---|---|
| Monorepo Tool | Turborepo |
| Package Manager | pnpm (workspaces) |
| Language | TypeScript (throughout) |
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| UI | React 19 · Tailwind CSS 4 |
| Icons | react-icons |
| Layer | Technology |
|---|---|
| Framework | Hono 4 via @hono/node-server |
| Authentication | arctic (Google & GitHub OAuth with PKCE) · jose (JWT) |
| Validation | Zod |
| Layer | Technology |
|---|---|
| DB | PostgreSQL |
| ORM | Prisma 7 via @prisma/adapter-pg |
- Node.js 18+
- PostgreSQL
- pnpm 9+
git clone https://github.com/your-username/ink.git
cd ink
pnpm install
cp apps/server/.env.example apps/server/.env
cp packages/database/.env.example packages/database/.env
# Edit the .env files with your configuration
pnpm --filter database generate
pnpm --filter database db:push
pnpm devFrontend: http://localhost:3000 · API: http://localhost:3001
apps/server/.env:
NODE_ENV
FRONTEND_URL
API_URL
ACCESS_JWT_SECRET
REFRESH_JWT_SECRET
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
LATEX_COMPILER_URL
packages/database/.env:
DATABASE_URL
DATABASE_POOL_SIZE
| Script | Description |
|---|---|
pnpm dev |
Start all apps in development mode |
pnpm build |
Build all apps and packages |
pnpm lint |
Lint all apps and packages |
pnpm format |
Format code with Prettier |
pnpm check-types |
Type-check all apps and packages |
pnpm test |
Run server unit tests (Jest) |
- Provision a PostgreSQL database (Neon, Supabase, Railway, etc.).
- Configure all environment variables for production.
- Run
pnpm --filter database db:push. - Build and deploy the frontend (
apps/web) and backend (apps/server) separately.
Contributions are welcome! Please follow the existing code conventions and commit style (conventional commits via commitlint).
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
Distributed under the MIT license. See LICENSE for more information.
Built with ❤️ using Next.js, Hono, and Prisma.
