Short-URL is a simple URL shortener application that allows users to shorten long links, track analytics such as click count, and manage their shortened URLs. The application includes user authentication with JWT, providing a secure environment for managing URLs.
- User Authentication: Users can sign up, log in, and securely manage their URLs using JWT authentication.
- URL Shortening: Converts long URLs into short, shareable links.
- Analytics Dashboard: Displays short ID, original URL, and the number of times the link has been clicked.
- EJS-Based UI: Server-side rendering using EJS for a smooth and interactive user experience.
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT (JSON Web Token)
- UI Rendering: EJS (Embedded JavaScript)
-
Clone the repository:
git clone https://github.com/Shubbu-07/short-url.git cd short-url -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory and add the following:MONGO_URI=your_mongodb_connection_string PORT=8001
- Create a
-
Start the server:
npm start
POST /user- Register a new userPOST /user/login- Login and receive JWT token
POST /url/- Shorten a new URLGET /url/:shortId- Redirect to the original URLGET /analytics- View analytics of shortened URLs
- Sign up or log in to access the URL shortener.
- Enter a long URL in the provided form to generate a short link.
- View analytics to track the number of clicks on your shortened URL.
(Include relevant screenshots of your application here)