The URL Shortener is a simple tool that allows users to convert long URLs into short, shareable links.
- Backend: Built with Node.js.
- Frontend: Uses HTML, CSS, and JavaScript.
- Database: MongoDB (via MongoDB Atlas).
Follow these steps to set up and run the project on your computer:
Download the project files to your local machine:
git clone https://github.com/Pruthavirajsingh/URL-Shortner.git
cd URL-Shortner
-
Navigate to the
backend
folder:cd backend
-
Install dependencies:
npm install
-
Create a
.env
file inside thebackend
directory:touch .env
Add the following lines to your
.env
file:PORT=5000 MONGO_URI=your_mongodb_connection_string
Replace
your_mongodb_connection_string
with your actual MongoDB Atlas connection string. -
Start the backend server:
npm start
- Navigate to the
frontend
folder:cd ../frontend
- Install dependencies:
npm install
- Start the frontend server:
npm start
- Once the servers are running, open your browser and go to:
http://localhost:3000
- Enter a long URL into the input box and click the "Shorten" button.
- A shortened URL will appear on the screen.
- Click the shortened URL to instantly redirect to the original website.
We welcome contributions from everyone!
Here’s how you can help:
- Fork the project to your own GitHub account.
- Create a new branch for your changes:
git checkout -b feature-name
- Make your changes and commit them:
git commit -m "Add feature description"
- Push to your branch:
git push origin feature-name
- Open a Pull Request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you have any questions or feedback, feel free to reach out:
- Email: [email protected]
- GitHub: Pruthavirajsingh