miniLinkis a Django-based REST API for shortening URLs.
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
- Clone & Navigate
git clone git@github.com:PritomKarmokar/miniLink.git
cd miniLink- Copy
.env.exampleto.env
cp .env.example .env
# Update `.env` with DB credentials & secret key- Create & Activate a Virtual Environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install Dependencies
pip install -r requirements.txt - Database & Server
python manage.py migrate
python manage.py runserver- (Optional) Create Admin
python manage.py createsuperuser- 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- The complete API reference is available in the
docsdirectory. - View API Documentation