Open-source web app that turns a zipped project folder into a single downloadable document—Markdown, plain text, Word (.docx), or PDF. It focuses on real source files and skips common noise (dependencies, build output, editor tooling, large binaries, and similar) so the result is easier to read and share.
Sign-in is required to generate exports. Authentication is powered by Better Auth with email verification and optional Google OAuth.
- Upload a
.zipof your repository or project root and pick an output format. - Progress feedback during processing (server-sent events).
- Sensible filtering so generated docs emphasize source code, not
node_modules,.git, lockfiles, env files, or bulky binaries. - Stats on generated files for transparency (see the convert UI).
| Area | Choice |
|---|---|
| Framework | Next.js (App Router) |
| UI | React, Tailwind CSS, Radix-based components |
| Auth | Better Auth + MongoDB adapter |
| Data | MongoDB |
| Validation / env | Zod, @t3-oss/env-nextjs |
| Package manager | Bun (bun.lock) |
| Document output | e.g. docx, pdfkit, fflate for zip handling |
Scaffold history: bootstrapped from create-t3-app (this repo has evolved beyond the default template).
- Bun (see
packageManagerinpackage.json; lockfile:bun.lock) - MongoDB reachable from the app (local or hosted)
-
Clone the repository
git clone <your-fork-or-upstream-url> cd codebase-to-doc
-
Install dependencies
bun install
-
Environment variables
Copy
.env.exampleto.envand fill in values. The canonical schema lives insrc/env.js. At minimum you typically need:Variable Purpose MONGODB_URIMongoDB connection string (include database name in the path or use MONGODB_DB_NAME)ZEPTOMAIL_API_KEYTransactional email (verification, password reset) via ZeptoMail BETTER_AUTH_SECRETSecret for signing sessions (required in production) BETTER_AUTH_URLPublic site URL, e.g. http://localhost:3000in dev,https://your-domain.comin production (required in production)Optional:
Variable Purpose BETTER_AUTH_GOOGLE_CLIENT_ID/BETTER_AUTH_GOOGLE_CLIENT_SECRETEnable Sign in with Google when both are set For builds where validating every variable is awkward (e.g. some Docker flows), you can set
SKIP_ENV_VALIDATION—seesrc/env.js. -
Run the dev server
bun run dev
Open http://localhost:3000, sign up or sign in, then open Codebase to document (
/convert) to upload a zip and download the generated file.
| Command | Description |
|---|---|
bun run dev |
Development server (Turbopack) |
bun run build |
Production build |
bun run start |
Start production server |
bun run preview |
Build then start locally |
bun run typecheck |
TypeScript (tsc --noEmit) |
bun run check |
Biome lint/format (project rules) |
src/app/— App Router pages and API routes (/api/codebase-to-doc, auth UI, etc.)src/lib/codebase-to-doc/— Client hooks and shared types for exportssrc/server/codebase-to-doc/— Server-side zip → document pipelinesrc/server/better-auth/— Auth configuration
Contributions are welcome.
- Open an issue first if you plan a large change, so we can align on direction.
- Fork the repo, create a branch, and keep commits focused.
- Run
bun run typecheckandbun run checkbefore opening a pull request. - Describe what changed and why in the PR (user-visible behavior, env changes, or breaking changes).
Please keep secrets and local .env files out of commits.
This repository does not yet include a LICENSE file in the root. If you maintain a fork, add one (for example MIT or Apache-2.0) so others know how they may use and redistribute the code.
Made with care by Blastbenchers.