Skip to content

RudraPratapDev/TinyPath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 TinyPath β€” A Modern URL Shortener

TinyPath banner

Transform endless URLs into tiny, powerful links

Live Demo

πŸš€ Live Demo

Made with React Node.js MongoDB TailwindCSS License: MIT


Why settle for ugly, long URLs when you can have beautiful, trackable short links?


🌟 What Makes tinyPath Special?

tinyPath isn't just another URL shortenerβ€”it's a complete link management platform designed for the modern web. Built with cutting-edge technologies and a passion for beautiful user experiences.

✨ Key Highlights

πŸš€ Lightning Fast 🎨 Beautiful Design πŸ“Š Smart Analytics πŸ”’ Secure & Private
Instant URL shortening Dark/Light themes Real-time click tracking JWT authentication
Modern React 18 Responsive design Performance insights Secure data handling

🎯 Core Features

πŸ”₯ Instant URL Shortening

  • Transform any long URL into a clean, shareable link in seconds
  • Custom short codes for branded links
  • Bulk URL processing capabilities

πŸ“ˆ Comprehensive Analytics

  • Real-time click tracking and statistics
  • Geographic data and referrer insights
  • Performance metrics and trends
  • Export data for detailed analysis

πŸ‘€ User Management

  • Secure user authentication with JWT
  • Personal dashboard for link management
  • Link history and organization
  • Account settings and preferences

🎨 Premium User Experience

  • Beautiful, intuitive interface with dark/light themes
  • Fully responsive design that works on any device
  • Fast loading times and smooth animations
  • Accessibility-first approach

πŸ›‘οΈ Enterprise-Grade Security

  • Secure password hashing with bcrypt
  • Protected routes and API endpoints
  • Input validation and sanitization
  • CORS protection and rate limiting

πŸ› οΈ Tech Stack & Architecture

Frontend

Technology Purpose Why We Chose It
React 18 UI Framework Latest features, excellent performance
TanStack Router Routing Type-safe, modern routing solution
Redux Toolkit State Management Simplified Redux with great DevTools
TailwindCSS Styling Utility-first, highly customizable
TanStack Query Data Fetching Powerful caching and synchronization
Vite Build Tool Lightning-fast development experience

Backend

Technology Purpose Why We Chose It
Node.js Runtime Perfect for real-time applications
Express.js Web Framework Lightweight, flexible, battle-tested
MongoDB Database Flexible schema, excellent scalability
Mongoose ODM Elegant MongoDB object modeling
JWT Authentication Stateless, secure token-based auth
bcrypt Password Hashing Industry-standard security

πŸš€ Quick Start Guide

Prerequisites

Node.js 18+ β€’ MongoDB β€’ Git β€’ npm/yarn

1. Clone & Setup

# Clone the repository
git clone https://github.com/RudraPratapDev/TinyPath.git
cd shortURL

# Install backend dependencies
cd BACKEND && npm install

# Install frontend dependencies  
cd ../FRONTEND && npm install

2. Environment Configuration

Create environment files:

Backend Environment (.env)

NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/tinypath
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRE=7d
APP_URL=http://localhost:5000
CLIENT_URL=http://localhost:5173
BCRYPT_SALT_ROUNDS=12

Frontend Environment (.env)

VITE_API_URL=http://localhost:5000/api
VITE_BASE_URL=http://localhost:5000

3. Database Setup

# Start MongoDB (if running locally)
mongod

# Or use MongoDB Atlas for cloud hosting
# Update MONGODB_URI with your Atlas connection string

4. Launch Application

# Terminal 1: Start Backend
cd BACKEND && npm run dev

# Terminal 2: Start Frontend
cd FRONTEND && npm run dev

5. Access Application


πŸ“š API Reference

Authentication Endpoints

POST /api/auth/register    # User registration
POST /api/auth/login       # User login
POST /api/auth/logout      # User logout
GET  /api/auth/me          # Get current user

URL Management

POST   /api/create         # Create short URL
GET    /api/user/urls      # Get user's URLs
DELETE /api/urls/:id       # Delete URL
GET    /:shortId          # Redirect to original URL

Example API Usage

Create Short URL:

curl -X POST https://tiny-path-delta.vercel.app/api/create \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "longUrl": "https://example.com/very/long/url",
    "customSlug": "my-link"
  }'

Response:

{
  "success": true,
  "shortUrl": "https://tiny-path-delta.vercel.app/my-link",
  "data": {
    "originalUrl": "https://example.com/very/long/url",
    "shortId": "my-link",
    "clicks": 0
  }
}

πŸ—οΈ Project Structure

tinyPath/
β”œβ”€β”€ πŸ“ BACKEND/
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ config/         # Database configuration
β”‚   β”‚   β”œβ”€β”€ πŸ“ controllers/    # Request handlers
β”‚   β”‚   β”œβ”€β”€ πŸ“ dao/            # Data access layer
β”‚   β”‚   β”œβ”€β”€ πŸ“ middleware/     # Auth & validation
β”‚   β”‚   β”œβ”€β”€ πŸ“ models/         # Database schemas
β”‚   β”‚   β”œβ”€β”€ πŸ“ routes/         # API routes
β”‚   β”‚   └── πŸ“ utils/          # Helper functions
β”‚   β”œβ”€β”€ πŸ“„ app.js             # Express app setup
β”‚   └── πŸ“„ package.json       # Dependencies
β”œβ”€β”€ πŸ“ FRONTEND/
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ api/            # API calls
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/     # React components
β”‚   β”‚   β”œβ”€β”€ πŸ“ context/        # React contexts
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/          # Page components
β”‚   β”‚   β”œβ”€β”€ πŸ“ store/          # Redux store
β”‚   β”‚   └── πŸ“ utils/          # Helper functions
β”‚   β”œβ”€β”€ πŸ“„ vite.config.js     # Vite configuration
β”‚   β”œβ”€β”€ πŸ“„ vercel.json        # Deployment config
β”‚   └── πŸ“„ package.json       # Dependencies
└── πŸ“„ README.md              # You are here!

πŸš€ Deployment Guide

Frontend (Vercel)

# Build and deploy
npm run build
vercel --prod

# Or connect your GitHub repo to Vercel for auto-deployment

Backend (Railway/Render)

# Deploy to Railway
railway login
railway new
railway up

# Set environment variables in your hosting platform

Environment Variables for Production

# Backend
NODE_ENV=production
APP_URL=https://your-backend-domain.com
CLIENT_URL=https://your-frontend-domain.com
MONGODB_URI=mongodb+srv://user:[email protected]/tinypath

# Frontend
VITE_API_URL=https://your-backend-domain.com/api
VITE_BASE_URL=https://your-backend-domain.com

πŸ”’ Security Features

  • βœ… JWT Authentication - Secure, stateless sessions
  • βœ… Password Hashing - bcrypt with salt rounds
  • βœ… Input Validation - Prevent malicious inputs
  • βœ… CORS Protection - Controlled cross-origin requests
  • βœ… Rate Limiting - Prevent abuse and spam
  • βœ… Environment Variables - Secure configuration management

πŸ“ˆ Performance Optimizations

  • ⚑ React 18 Features - Concurrent rendering
  • ⚑ Code Splitting - Lazy-loaded components
  • ⚑ Database Indexing - Optimized queries
  • ⚑ Caching Strategy - Efficient data retrieval
  • ⚑ Bundle Optimization - Minimal build sizes
  • ⚑ CDN Integration - Fast global delivery

🀝 Contributing

We welcome contributions! Here's how you can help:

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Code your improvements
  4. Test thoroughly
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Contribution Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Be respectful and collaborative

πŸ†˜ Support & Community

Getting Help

Community

  • ⭐ Star this repository if you find it helpful
  • 🍴 Fork and contribute to the project
  • πŸ“’ Share with your network
  • πŸ’¬ Join discussions and provide feedback

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License - feel free to use this project for personal or commercial purposes!

πŸ™ Acknowledgments

  • React Team - For the amazing framework
  • Vercel - For seamless deployment platform
  • MongoDB - For flexible database solutions
  • TailwindCSS - For beautiful, utility-first styling
  • Open Source Community - For inspiration and tools

πŸ‘¨β€πŸ’» Built with ❀️ by Rudra Pratap Singh Tomar

Transforming the way we share links, one URL at a time.

Connect with me:

GitHub LinkedIn

⭐ If tinyPath helped you, please star this repository! ⭐

Made with React, Node.js, and lots of β˜•

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages