https://github.com/ashesbloom/url_shortener
Takes a url and return the shorten one, keep track of total visits and total clicks
https://github.com/ashesbloom/url_shortener
ejs-templates express-js jwt-authentication mongodb mvc-architecture nodejs
Last synced: 2 months ago
JSON representation
Takes a url and return the shorten one, keep track of total visits and total clicks
- Host: GitHub
- URL: https://github.com/ashesbloom/url_shortener
- Owner: ashesbloom
- Created: 2024-04-08T11:34:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T12:07:30.000Z (almost 2 years ago)
- Last Synced: 2025-02-22T00:28:31.678Z (over 1 year ago)
- Topics: ejs-templates, express-js, jwt-authentication, mongodb, mvc-architecture, nodejs
- Language: JavaScript
- Homepage: https://urlshortener-production-dfbc.up.railway.app/ashes/home
- Size: 4.01 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# URL Shortener ๐
A web application that shortens long URLs into compact, easy-to-share links. This project includes user authentication, click tracking, and an admin portal for managing statistics and user roles.
## โจ Features
- โ๏ธ URL shortening
- ๐ ๏ธ Custom short URL creation
- ๐ Click tracking for each shortened URL
- ๐ User authentication and role management
- โ๏ธ Admin portal for statistics and user management
- ๐ 3-day history retention for URL clicks
- ๐๏ธ Ability to clear history (for users and admins)
- ๐งน Admin capability to delete any entry
## ๐ ๏ธ Technologies Used
- Node.js
- Express.js
- MongoDB Atlas
- EJS (Embedded JavaScript templating)
- JavaScript
- CSS
- JWT for authentication
## ๐ฆ Dependencies
```json
{
"dependencies": {
"cookie-parser": "^1.4.6",
"dotenv": "^16.4.5",
"ejs": "^3.1.10",
"express": "^4.19.2",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.3.0",
"nodemon": "^3.1.0",
"shortid": "^2.2.16",
"sweetalert": "^2.1.2"
}
}
```
## ๐ Installation
1. Clone the repository.
2. Run `npm install` to install dependencies.
3. Set up your MongoDB Atlas cluster and add the connection string to your `.env` file.
4. Run `npm start` to start the server.
## ๐ก Usage
1. Navigate to the homepage.
2. Enter a long URL in the input field.
3. Click "Shorten" to generate a short URL.
4. Copy and share the shortened URL.
## ๐ง Admin Portal
Access the admin portal to:
- View overall statistics.
- Manage user roles.
- View and delete individual URL entries.
- Clear history for all users.
## โ ๏ธ Disclaimer
The length of the shortened URL ID may vary depending on the domain being used. While we aim for 8-character IDs, the actual length might be different to ensure uniqueness across the system.
## ๐ค Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.