Skip to content

vikashkumar2020/go-url-shortner

Repository files navigation

Go URL Shortener

This is a URL shortener project built with Go lang. It allows you to create short and manageable URLs for your long URLs.

Run the Project locally using docker

With Docker

  1. Install Docker Desktop
  2. Test the installation by running:
    docker-compose --version
    # Docker Compose version v2.6.1
Steps
  1. Make a copy of the .env.example file and save it as .env:
    cp .env.example .env
  2. Setup the project with single command installation via docker:
    docker-compose up --build -d
    

Setting Up the Project locally

Clone the repository to your local machine:

sh git clone https://github.com/your-username/go-url-shortener.git

Requirements

  • Golang
  • PostgreSQL

Pre-requisites

  1. Download Golang
  2. Test the installation by running:
    go version
    # go version go1.19.2 darwin/arm64

Steps

  1. Navigate to the right directory where your project will be locally saved

  2. Clone this repository and move to go-url-shortener directory

    cd go-url-shortener/
  3. Install go dependencies

    go get
  4. Install goose library for running migrations

  5. Make a copy of the .env.example file and save it as .env:

    cp .env.example .env
  6. Update the .env file with relevant configurations.

  7. Run migrations

    make migration-up-postgres
  8. Start the server

    make server

About

A url shortner application in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published