Skip to content

Building URL shortener using Go Fiber, Redis and Docker

Notifications You must be signed in to change notification settings

sachin-404/ZipLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZipLink

ZipLink is a URL shortener application built with Go and Fiber framework. It allows users to create custom short URLs for long URLs, making them easier to share and manage.

Features

  • Custom Short URLs: Users can create custom short URLs according to their preferences.
  • Expiration: Optionally set an expiration time for short URLs.
  • Rate Limiting: Rate limiting to prevent abuse and ensure fair usage.
  • Swagger Documentation: Swagger UI integration for API documentation.
  • Dockerized: Docker and Docker Compose setup for easy deployment.

Tech Stack

  • Go: Backend language
  • Fiber: Web framework for Go
  • Redis: Backend data store for storing short URLs and rate limiting information
  • Docker: Containerization for deployment
  • Swagger: API documentation

Installation

  1. Clone the repository:

    git clone https://github.com/sachin-404/ZipLink.git
    
  2. Navigate to the project directory:

    cd ZipLink
    
  3. Set up environment variables:

    Create a .env file in the project root directory and specify the following environment variables:

    DB_ADDRESS="db:6379"
    DB_PASSWORD=""
    APP_PORT=":3000"
    DOMAIN="localhost:3000"
    API_QUOTA=10
    
  4. Build and run the Docker containers:

    docker compose up --build
    
  5. Access the application at http://localhost:3000.

Usage

  • Shorten a URL: Send a POST request to /api/v1 with the long URL in the request body. Optionally, you can provide a custom short URL and expiration time.

  • Resolve a Short URL: Access the shortened URL generated by the application to be redirected to the original long URL.

  • API Documentation: Access Swagger UI documentation at http://localhost:3000/docs for detailed API documentation.

About

Building URL shortener using Go Fiber, Redis and Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published