https://github.com/techysanoj/url-shortner-new-version
Lightning-fast, secure, and customizable URL shortener with analytics—modern tech stack, REST API, and branded short links.
https://github.com/techysanoj/url-shortner-new-version
express express-js expressjs mvc-architecture mvc-pattern rest-api restful-api url-redirect url-shortener url-shortener-api url-shortener-microservice
Last synced: about 2 months ago
JSON representation
Lightning-fast, secure, and customizable URL shortener with analytics—modern tech stack, REST API, and branded short links.
- Host: GitHub
- URL: https://github.com/techysanoj/url-shortner-new-version
- Owner: techysanoj
- Created: 2025-09-26T13:55:41.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-27T06:59:14.000Z (9 months ago)
- Last Synced: 2025-10-19T08:33:45.098Z (9 months ago)
- Topics: express, express-js, expressjs, mvc-architecture, mvc-pattern, rest-api, restful-api, url-redirect, url-shortener, url-shortener-api, url-shortener-microservice
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# URL Shortener (New Version)
A modern, secure, and lightning-fast URL shortener service built with Node.js. Instantly convert long URLs into short, shareable links and track analytics in real-time. Perfect for social media, marketing, and web applications.
## 🚀 Features
- **Custom Short URLs**: Generate branded or personalized short links.
- **Click Analytics**: Track URL usage, referrers, and stats.
- **RESTful API**: Integrate URL shortening into your own apps.
- **Secure**: Protects against abuse and malicious redirects.
- **Easy to Use**: Minimal setup, clean codebase, and ready-to-deploy.
- **Scalable**: Built for high performance and easy scaling.
## 🛠️ Tech Stack
- **Node.js** (backend logic)
- **Express.js** (routing and server)
- **MongoDB** (URL & analytics storage)
- **Mongoose** (MongoDB ODM)
- **Other dependencies:** See [`package.json`](./package.json)
## 📂 Project Structure
```
.
├── controller/ # Business logic and controllers
├── models/ # MongoDB data models
├── routes/ # App and API routes
├── connection.js # Database connection setup
├── index.js # Main entry point (Express app)
├── package.json # Dependencies & scripts
├── url_shortner_requirements.txt # Requirements/notes
```
## 🧑💻 Getting Started
### Prerequisites
- Node.js (v14+ recommended)
- MongoDB (local or cloud)
### Installation
```bash
git clone https://github.com/techysanoj/URL-Shortner-new-version.git
cd URL-Shortner-new-version
npm install
```
### Configuration
Edit `connection.js` to set your MongoDB connection string.
### Running the Application
```bash
npm start
```
The server runs on [http://localhost:3000](http://localhost:3000) by default.
## 📖 API Usage
### Shorten a URL
`POST /api/shorten`
Request body:
```json
{
"originalUrl": "https://your-long-url.com"
}
```
Response:
```json
{
"shortUrl": "http://localhost:3000/abc123"
}
```
### Redirect
Visiting `http://localhost:3000/abc123` will redirect to the original URL.
### Analytics
Endpoint and analytics implementation details can be extended as needed.
## 🤝 Contributing
1. Fork this repo
2. Create your feature branch (`git checkout -b feature/FeatureName`)
3. Commit your changes (`git commit -m 'Add some feature'`)
4. Push to the branch (`git push origin feature/FeatureName`)
5. Open a Pull Request
## ⭐️ Why Use This URL Shortener?
- Built with best practices in Node.js and MongoDB
- Designed for extensibility (custom domains, analytics, admin dashboard, etc.)
- Perfect for learning, side projects, or deploying at scale
## 📄 License
[MIT](./LICENSE)
---
> Made with ❤️ by [techysanoj](https://github.com/techysanoj)