This project is a simple URL shortener application built with Next.js and PostgreSQL.
- Shorten long URLs to easily shareable short links
- Redirect users from short links to original long URLs
- PostgreSQL database for storing URL mappings
- Node.js (v14 or later)
- Git
-
Clone the repository:
git clone https://github.com/your-username/url-shortener.git cd url-shortener
-
Copy the
.env.sample
file to.env.local
and fill in the required environment variables:cp .env.sample .env.local
Make sure to set the
NEXT_PUBLIC_BASE_URL
to your local development URL (e.g.,http://localhost:3000
). -
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser to see the application.
- PostgreSQL is running on port 54320
To deploy this application, make sure to update the NEXT_PUBLIC_BASE_URL
in your production environment to match your domain.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.