LinkSnip is a modern URL shortening service built with Node.js, Express, and MongoDB. This application allows users to create shortened URLs, track visit analytics, and manage their links through a clean, responsive interface.
- URL Shortening: Convert long URLs into short, manageable links
- Visit Tracking: Monitor how many times your shortened links have been visited
- User Authentication: Secure signup/login functionality
- Responsive Design: Works seamlessly on desktop and mobile devices
- Modern UI: Clean, intuitive interface built with Tailwind CSS
- Node.js: JavaScript runtime environment
- Express.js: Web application framework
- MongoDB: NoSQL database for storing URL and user data
- Mongoose: MongoDB object modeling tool
- JWT: JSON Web Tokens for authentication
- MVC Architecture: Model-View-Controller design pattern for clean code organization
- EJS: Embedded JavaScript templates for server-side rendering
- Tailwind CSS: Utility-first CSS framework
- Font Awesome: Icon library
-
Clone the repository
git clone https://github.com/pravinpaudel/linksnip.git cd linksnip
-
Install dependencies
npm install
-
Create a
.env
file in the root directory with the following variables:PORT=3000 MONGODB_URI=mongodb://localhost:27017/linksnip JWT_SECRET=your_jwt_secret_key
-
Start the development server
npm run dev
POST /url
- Create a new shortened URLGET /url/:shortId
- Redirect to original URLGET /urls
- Get list of all URLs (requires authentication)
POST /user/signup
- Register a new userPOST /user/login
- Login user and generate JWT
{
shortId: String,
originalUrl: String,
visitHistory: [{ timestamp: Date }],
createdBy: { type: mongoose.Schema.Types.ObjectId, ref: 'User' }
}
{
name: String,
email: String,
password: String
}
- User registers with email and password
- Password is hashed before storage in database
- On login, JWT token is generated and sent to client
- Protected routes verify JWT token before granting access
- Custom short URLs
- Advanced analytics (geographic data, referrers, etc.)
- QR code generation for shortened URLs
- Link expiration options
- Team collaboration features
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- UI design inspired by modern web applications and best practices