Skip to content

Latest commit

 

History

History
49 lines (42 loc) · 1.07 KB

README.md

File metadata and controls

49 lines (42 loc) · 1.07 KB

Motivation

The motivation behind this project is to learn more about system design and how to build a scalable system. The book system design interview is a great resource to learn about system design and this project is based on the case study of building a url shortener.

Table of Contents

Requirements

  • Docker
  • Docker Compose
  • Golang

How to run

  1. Clone the repository
  2. Run docker-compose up to start the redis server
  3. Run go run main.go to start the server
  4. Run go test ./... to run the tests

API

POST /shorten

Request body:

{
    "url": "https://www.google.com"
}

Response body:

{
    "shortened_url": "http://localhost:8080/1"
}

GET /:id

Response body:

{
    "url": "https://www.google.com"
}

Architecture

Architecture

References