A URL shortener application built using the MERN stack (MongoDB, Express.js, React, Node.js).
- Introduction
- Features
- Technologies
- Installation
- Usage
- Project Structure
- Contributing
- License
- Contact
This project is a simple URL shortener application. Users can input a long URL, and the application will generate a shorter version of that URL. This is useful for sharing long URLs in a more compact form.
- Shorten long URLs
- Redirect short URLs to the original long URLs
- User authentication (Log in/Log out)
- View all shortened URLs (for the authenticated user)
- Frontend: React, Bootstrap
- Backend: Node.js, Express.js
- Database: MongoDB
- Routing: React Router
- Version Control: Git
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/DevPatel1023/Url-Shortner.git cd Url-Shortner
-
Install dependencies for the backend:
cd server npm install
-
Install dependencies for the frontend:
cd ../client npm install
-
Set up environment variables:
Create a
.env
file in theserver
directory and add your MongoDB connection string and any other necessary environment variables.MONGO_URI=your_mongodb_connection_string PORT=5000
-
Run the backend server:
cd server npm start
-
Run the frontend development server:
cd ../client npm start
-
Access the application:
Open your browser and go to
http://localhost:3000
. -
Shorten a URL:
Enter a long URL in the input field and click the "Shorten" button to generate a short URL.
-
Log in/Log out:
Use the "Log in" button to authenticate yourself and access additional features.
Url-Shortner/ ├── client/ │ ├── public/ │ └── src/ │ ├── components/ │ │ ├── Navbar.jsx │ │ ├── UrlShortener.jsx │ │ ├── About.jsx │ │ ├── Login.jsx │ │ └── NoPage.jsx │ ├── App.css │ ├── App.js │ └── index.js ├── server/ │ ├── config/ │ ├── controllers/ │ ├── models/ │ ├── routes/ │ └── index.js └── README.md
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License.
If you have any questions or suggestions, feel free to reach out.
- Email: [email protected]
- GitHub: DevPatel1023