Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Open-source URL shortener built with Next.js, Tailwind CSS, PostgreSQL, and Drizzle ORM.
OnURL is an open-source URL shortener template built with Next.js, TypeScript, and Tailwind CSS that lets you shorten and share long URLs from your own deployed web app.
OnURL is a URL shortener web application built on the Next.js React framework and written in TypeScript, with a Tailwind CSS–styled interface. It takes a long URL as input and outputs a short, shareable link stored in a PostgreSQL database via Drizzle ORM. The project is open source and has a live demo deployed to Vercel at onurl.vercel.app.
The template bundles an entire tech stack: Zod for schema validation, React Icons for iconography, react-share for social media sharing buttons, and unDraw illustrations for the UI. Code quality tooling includes ESLint and Prettier, and deployment is handled through Vercel.
pnpm db:generate and pnpm db:migrate.Set a PostgreSQL connection string as POSTGRES_URL in your .env.development or .env.production file. Then run pnpm install, generate migrations with pnpm db:generate, apply them with pnpm db:migrate, and launch in development with pnpm dev. For production, run pnpm build followed by pnpm start. The app then accepts a long URL and returns a short link, with social sharing as a one-click action.
OnURL is open source, so the code is free to use. You only pay for your own infrastructure, such as a Vercel deployment and a PostgreSQL database.
OnURL uses PostgreSQL, accessed through Drizzle ORM. Database schema changes are managed by generating and running SQL migrations with pnpm scripts.
Create a production build with pnpm build after setting POSTGRES_URL in .env.production, then start it with pnpm start. The project is also configured for Vercel deployment.
The README does not list any analytics or click-tracking features. OnURL focuses on shortening and sharing URLs, with the tech stack adding validation, styling, and social share buttons.
