Skip to content

EiseWilliam/scissor-api

Repository files navigation

Scissor URL Shortener API

A high-performance URL shortening service built with a modern tech stack for robust functionality and a smooth user experience.

Technologies

  • FastAPI - Web framework.
  • Uvicorn - HTTP Server.
  • Pydantic - data validation and settings management.
  • MongoDB - Data Storage.
  • Redis - In-memory cache for analytics and rate limiting.
  • Celery - Distributed task queue for background processing e.g fetching Url preview data.

Features

  • Create short, memorable URLs from long, unwieldy links.
  • Gain detailed analytics on shortened URLs, including clicks, referrers, and location data.
  • Generate QR codes for quick sharing of shortened links.
  • Protected endpoints with robust rate limiting.
  • Dockerized Setup.
  • JWT token authentication.

Local Setup with Docker

Prerequisites

  • Docker

Steps

  1. Clone the repository
git clone https://github.com/EiseWilliam/scissor-api 
  1. Change directory
cd scissor-api
  1. Build the docker images
docker-compose build
  1. Start the services
docker-compose up
  1. Access the API docs at http://localhost:8000/docs

Optional: Change environment variables

If you want to make changes to environment variables like jwt secret key, you can do so by editing the envsampledocker file in the root directory and renaming it to .env.

by default all env variables for docker setup is defined in scissor-api/app/core/config/settings.py file.

Local Setup without Docker

Prerequisites

  • Python 3.10
  • MongoDB
  • Redis

Steps

  1. Clone the repository
git clone https://github.com/EiseWilliam/scissor-api
  1. Change directory
cd scissor-api
  1. Create a virtual environment
python3 -m venv venv
  1. Activate the virtual environment
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Environment variables
cp .envsample .env
  1. Start the server
python3 run.py
  1. Access the API docs at http://localhost:8000/docs

API Documentation

View API documentation at Scissor API Documentation

UI Implementation

View the frontend repo at Scissor Frontend

About

URL shortener API with powerful analytics powered by FastAPI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages