"Drop your code, let Doggo fetch it! Combination of a Pastebin and CodeShare. Free and selfhostable."
DoggoPaste project monorepo.
- Credential (email & password) auth
- OAuth2 authentication with the following providers: Google, GitHub, Facebook
- Account linking and unlinking with social providers
- Password change with the option to log out from all active sessions
- Session management
- Profile management
- UI theme selection
- Role-based access control (user, admin) with admin dashboard
- Full CRUD for authenticated users, and CR access for guests
- Folders for static pastes
- Tags and categories
- Burn after read
- Expiration after a specified period (e.g., 2 weeks)
- Sensitive content warnings
- Download with correct file extensions and name sanitization
- Raw view mode
- One-click copy to clipboard
- Auto-generated human-readable slugs (e.g., "everybody-cold")
- Syntax highlighting for over 50 languages, with 10 editor themes
- Public paste feed with pagination
- Anonymous static pastes
- Realtime collaborative code editing
- Live cursors showing participants' positions
- Easy deployment with Docker & reverse proxy (e.g., Caddy)
- System status & version monitoring
- Guide & FAQ pages for easy entry to DoggoPaste
DoggoPaste is an app that combines features known from Pastebin.com and Codeshare.io into one, FOSS app with modern UI and easy deployment.
The following section provides an overview of each element of the root project structure.
.
├── apps/ # Applications in the monorepo
│ ├── api/ # Backend REST API and WebSockets server built with Hono.js
│ ├── proxy/ # Entry point running "web" and "api" as child processes on a single port
│ └── web/ # Frontend app built with Next.js
├── biome.json # Biome config for formatting and linting
├── docker-compose.dev.yaml # Docker config for development environment (only database)
├── docker-compose.prod.yaml # Docker config for production deployment (entire standalone project)
├── docker-compose.test.yaml # Docker config for tests
├── package.json # Root dependencies and scripts
├── pnpm-lock.yaml # Lockfile for reproducible installs
├── pnpm-workspace.yaml # Workspace config
└── turbo.json # Turborepo configRun from within the root app directory, e.g. doggopaste, using turbo run <command>:
build– builds all applications for productiondev --filter=proxy– runs all applications in development mode with hot reload on a single port via the proxystart --filter=proxy– starts all built applications on a single port via the proxycheck-types– performs a full type-safety check across the projectncu– checks for dependency updates using npm-check-updatesncu-u– applies available dependency updatescheck– analyzes the codebase for potential issues using Biomecheck:fix– automatically fixes issues reported by Biome
Run from within the app directory, e.g. doggopaste/apps/api, using pnpm run <command>:
apps/apidb:push– synchronizes the database schema (development use only)db:generate– generates a new migration based on the current schema changesdb:migrate– applies pending migrations to the databasedocs– generates OpenAPI documentation based on the project's route definitionstest– executes the complete test suitetest:watch– runs the test suite in watch mode with automatic reload
services:
doggopaste:
container_name: doggopaste
image: poprostuwitold/doggopaste:latest
environment:
APP_NAME: "DoggoPaste"
APP_URL: "https://doggopaste.example.com"
DATABASE_URL: ""
BETTER_AUTH_SECRET: ""
GITHUB_CLIENT_ID: ""
GITHUB_CLIENT_SECRET: ""
ports:
- 3002:3002
restart: unless-stopped
depends_on:
- doggopaste_db
networks:
- doggopaste_network
- caddy
doggopaste_db:
image: postgres:17
container_name: doggopaste_db
restart: unless-stopped
environment:
POSTGRES_USER: doggo
POSTGRES_PASSWORD: changeme
POSTGRES_DB: doggopaste
volumes:
- /srv/server/services/doggopaste/db:/var/lib/postgresql/data
networks:
- doggopaste_network
networks:
doggopaste_network:
driver: bridge
caddy:
name: caddy
external: trueSet environmental variables in docker-compose.prod.yaml and then launch it:
- Install dependencies with
pnpm
pnpm install- Launch development database with docker
docker compose -f docker-compose.dev.yaml up- Create
.envfile inapps/apiand run migrations
DATABASE_URL="postgresql://doggo:changeme@localhost:5432/doggopaste"cd apps/api && pnpm run db:push- Create
.envfile inapps/proxy
Tip
You can generate BETTER_AUTH_SECRET with Node.js like this:
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
APP_NAME="DoggoPaste"
APP_URL="http://localhost:3002"
DATABASE_URL="postgresql://doggo:changeme@localhost:5432/doggopaste"
BETTER_AUTH_SECRET="" 5a. Launch app in development mode
cd apps/proxyturbo run dev --filter=proxyOR
5b. Launch app in production mode
turbo run buildturbo run start --filter=proxy- Visit
http://localhost:3002
- Turborepo as monorepo solution
- Hono as API and WebSockets backend framework
- Next.js as frontend framework
- PostgreSQL with Drizzle ORM as database
- Socket.IO for realtime communication
- Better Auth for auth
- Headless UI as components
- TailwindCSS and DaisyUI for styling
Documentation for all REST API routes is available at /api/docs.
Tests are in apps/api/__tests__.
- Launch development database with docker
docker compose -f docker-compose.test.yaml up- Create
.env.testfile inapps/apiand run migrations
NODE_ENV="test"
DATABASE_URL="postgresql://doggo:changeme@localhost:5432/doggopaste"
GITHUB_CLIENT_ID="xxx"
GITHUB_CLIENT_SECRET="xxx"cd apps/api && pnpm run db:push- Run tests
pnpm run test