A URL Shortener application built using the MEAN stack (MongoDB, Express.js, Angular, and Node.js) and styled with Tailwind CSS.
- Shorten URLs and store them in a MongoDB database
- Redirect shortened URLs to the original URLs
- Responsive and modern UI using Tailwind CSS
- Dark mode support using Tailwind CSS
- Copy shortened URLs to the clipboard
- Expire shortened URLs after a specified duration
- Click statistics for shortened URLs
- URL Details page with click statistics, original URL, shortened URL, creation date, and expiration date
-
Clone the repository:
git clone https://github.com/manthanank/url-shortener-app.git cd url-shortener-app/backend
-
Install the backend dependencies:
npm install
-
Create a
.env
file in thebackend
directory and add the following:PORT=3000
-
Start the backend server:
node index.js
-
Install the frontend dependencies:
npm install
-
Start the frontend development server:
ng serve
The frontend server will run on http://localhost:4200
and the backend server will run on http://localhost:3000
.
- Open your browser and go to
http://localhost:4200
. - Enter a URL in the input field and click the "Shorten" button.
- The shortened URL will be displayed. Click the shortened URL to be redirected to the original URL.
- Use the "Copy Link" button to copy the shortened URL to your clipboard.
To build and deploy the application for production:
-
Build the Frontend
ng build --prod
-
Start the Backend
Ensure your
.env
file contains the production MongoDB URI.cd backend node index.js
-
Deploy the Application
Deploy your application using your preferred cloud provider or hosting service. Ensure the
dist/url-shortener-app
directory is correctly served by your backend.
Preview: URL Shortener App
Screenshot:
This project is licensed under the MIT License. See the LICENSE file for details.