- Website that can convert any long link and generate a shorter link that redirects to it
- Dynamic shorter link Creation
- Custom short link by the user
- Auto generate randomly generated links based on a length
- Choose an expiration date for each link
-
Frontend:
- React.js
- NextUI
-
Backend:
- Node.js
- Express.js
- MongoDB
-
Deploment
- Vercel
- MongoDB Atlas
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed on your machine.
- MongoDB installed locally or accessible through a remote server.
-
Clone the repository:
git clone https://github.com/aryanranderiya/URLShortener.git
cd URLShortener
-
Install Dependencies
Tip: Create 2 Terminals for ease of use
-
Install Dependencies in Backend
cd Backend
npm i
-
Install Dependencies in Frontend
cd Frontend/react-frontend
npm i
- Update Environment Variables
- Rename '.env.template' to '.env'
- Add the link to your MongoDB connection string and your desired port.
MONGO_DB = "" PORT=3000
- Rename '.env.template' to '.env'
-
Start Server
After Navigating to URLShortener/Backend using cd Backend'
cd api
node index
After Navigating to URLShortener/Frontend/react-frontend using cd Frontend/react-frontend'
cd src
npm start
- Make sure to build the React project before deploying the Server.
npm run build
- No need to Deploy the react frontend as the Backend will automatically serve the frontend from src/build
- Replace all hardcoded URL's from the code