Skip to content

SnapLink – A fast, minimal, and efficient URL shortener, for easy link sharing.

Notifications You must be signed in to change notification settings

madhvi-n/snaplink

Repository files navigation

SnapLink - A URL Shortener

Django CI Python Django Django Rest Framework Angular

SnapLink is a simple yet powerful URL shortener built with Python (Django) and React for the frontend. It allows users to shorten long URLs, track visits, and even generate QR codes for quick access.

✨ Features

  • 🔗 URL Shortening – Convert long URLs into short, easy-to-share links.
  • 📊 Click Tracking – See how many times a link has been accessed.
  • Expiration Dates – Set an expiry time for temporary links.
  • 📸 QR Code Generation – Generate QR codes for each shortened URL (To Do).
  • 🚀 Fast & Lightweight – Uses HTMX/React for a snappy frontend experience (To Do).

🛠 Tech Stack

Backend:

  • Python (Django)
  • SQLite/PostgreSQL (Database)
  • Redis (Caching short URLs for performance)

Frontend:

  • React
  • Tailwind CSS (for styling)

📦 Installation & Setup

  1. Clone the Repository

    git clone https://github.com/madhvi-n/snaplink.git
    cd snaplink
  2. Set up a virtual environment

    python -m venv venv
    source venv/bin/activate  # On macOS/Linux
    venv\Scripts\activate  # On Windows
  3. Install Dependencies

    pip install -r requirements.txt
  4. Apply Database Migrations

    python manage.py migrate
  5. Create a Superuser

    python manage.py createsuperuser
  6. Run the Development Server

    python manage.py runserver

    Access the application at: http://127.0.0.1:8000

Frontend

  1. Install dependencies

        npm install
  2. Run the Development Server

        npm run dev

📝 API Documentation

The API documentation is available via Swagger:

  • Swagger UI: http://127.0.0.1:8000/api/swagger/
  • Redoc: http://127.0.0.1:8000/api/redoc/

⚙️ Environment Variables (Example .env file)

SECRET_KEY=django-secret-key
DEBUG=True
BASE_URL=http://localhost:8000

🎉 Happy Coding! 🚀