Shorten is a modern, user-friendly URL shortening application built with Next.js and Prisma. It allows users to create shortened versions of long URLs, making them easier to share and manage.
- User authentication (register, login, logout)
- Create shortened URLs with custom codes (optional)
- View list of shortened URLs with visit counts
- Copy shortened URLs to clipboard
- Delete shortened URLs
- Redirect to original URLs when accessing shortened links
- Frontend:
- Next.js 14 (React framework)
- TypeScript
- Tailwind CSS for styling
- shadcn/ui components
- Backend:
- Next.js API routes
- Prisma ORM
- Database:
- PostgreSQL
- Authentication:
- JWT (JSON Web Tokens)
- bcrypt for password hashing
- Form Validation:
- Zod
- Deployment:
- Vercel (recommended)
-
Clone the repository:
git clone https://github.com/0xtbug/shorten.git cd shorten
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following:DATABASE_URL="your_postgresql_connection_string" JWT_SECRET="your_jwt_secret" NEXT_PUBLIC_BASE_URL="http://localhost:3000"
-
Set up the database:
npx prisma migrate dev
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
This application is designed to be easily deployed on Vercel. Follow these steps:
- Push your code to a GitHub repository.
- Connect your GitHub account to Vercel.
- Create a new project in Vercel and select your repository.
- Configure your environment variables in Vercel's project settings.
- Deploy!
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.