A modern, full-featured, open-source URL shortener built with Next.js, TypeScript, Prisma, and Tailwind CSS. Easily create, manage, and analyze short links with advanced analytics, branded domains, and a beautiful dashboard.
- Shorten URLs: Instantly create short links for any long URL.
- Custom Slugs: Choose memorable, branded endings for your links.
- Advanced Analytics: Track clicks, devices, browsers, locations, and more (src/components/Dashboard.tsx).
- User Accounts: Manage your links and access advanced features.
- RESTful API: Programmatically create and manage links (src/app/api/shorten/route.ts).
- Responsive UI: Built with Tailwind CSS for desktop and mobile.
- Security: HTTPS, abuse monitoring, and malware scanning.
- Open Source: MIT licensed, easy to self-host and customize.
-
Clone the repo
git clone https://github.com/yourusername/mntz-shortner.git cd mntz-shortner -
Install dependencies
npm install
-
Configure environment
- Copy
.env.exampleto.envand fill in required values (database, NEXTAUTH_URL, etc).
- Copy
-
Setup database
npx prisma migrate dev
-
Run the app
npm run dev
-
Access the dashboard
- Visit
http://localhost:3000in your browser.
- Visit
See src/app/user/support/docs/page.tsx for full API documentation.
Example: Create a short link
POST /api/links
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"url": "https://example.com/very/long/url",
"customSlug": "optional-custom-slug"
}src/— Main source codecomponents/— UI components (forms, dashboard, maps)app/— Next.js app routes (API, blog, user pages)prisma/— Database schema and migrationspublic/— Static assetstests/— Unit and integration tests
scripts/— Utility scripts.github/— CI workflows
Pull requests and issues are welcome! Please see CONTRIBUTING.md for guidelines.
MIT © Vivek Kavala
Live Demo: mntz.xyz
Docs: See the blog guides for best practices, SEO tips, and technical details.