Skip to content

PritomKarmokar/miniLink

Repository files navigation

🔗 miniLink

  • miniLink is a Django-based REST API for shortening URLs.

Overview

The miniLink API provides a RESTful interface for URL shortening operations. All endpoints return JSON responses (except redirects) and use standard HTTP response codes.

Key Features:

  • ✅ Secure HMAC-based token generation
  • ✅ Persistent URL storage with PostgreSQL
  • ✅ Fast redirects with 302 status codes
  • ✅ RESTful API design
  • ✅ Comprehensive error handling

⚙️ Local Setup

  1. Clone & Navigate
git clone git@github.com:PritomKarmokar/miniLink.git
cd miniLink
  1. Copy .env.example to .env
cp .env.example .env
# Update `.env` with DB credentials & secret key
  1. Create & Activate a Virtual Environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install Dependencies
pip install -r requirements.txt 
  1. Database & Server
python manage.py migrate
python manage.py runserver
  1. (Optional) Create Admin
python manage.py createsuperuser

🐳 Docker Setup

  • Build & Run
docker compose up --build
  • Run Migrations, Create Superuser & Tests
  • Open another terminal and run the below commands
docker ps
docker exec -it <container id> bash
python manage.py migrate
python manage.py createsuperuser

📚 API Documentation

About

Django-based REST API for shortening URLs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors