This is a full-stack URL Shortener application built using the MERN stack (MongoDB, Express, React, Node.js). The frontend is developed with Vite+React+TypeScript, and the backend uses Node.js, Express, and MongoDB.
- Shorten URLs: Convert long URLs into short, manageable links.
- Custom URLs: Create memorable custom short URLs.
- Analytics: Track the number of clicks on your shortened URLs.
- User-Friendly: Intuitive and easy-to-use interface with Tailwind CSS styling.
- Node.js
- MongoDB
- npm (Node Package Manager)
git clone https://github.com/your-username/url-shortener.git
cd url-shortenercd client
npm installcd ../server
npm installcd server
npm startcd ../client
npm run devCreate a .env file in the server directory and add the following environment variables:
MONGODB_URI=your_mongodb_connection_string
PORT=5001
- Sign in to Vercel.
- Import the
clientdirectory from your GitHub repository. - Set the framework preset to Vite.
- Set the build command to
npm run build. - Set the output directory to
dist. - Deploy the project.
- Create a new project in Vercel for the
server. - Import the
serverdirectory from your GitHub repository. - Set the framework preset to Node.js.
- Add necessary environment variables (e.g.,
MONGODB_URI). - Deploy the project.
- Navigate to the deployed client application.
- Enter a long URL in the input field.
- Click "Shorten URL".
- Use the generated short URL to share and track clicks.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.