url-shortener

module
v0.0.0-...-e6db692 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2024 License: MIT

README

URL Shortener

A simple URL shortener application built with Golang, Postgres, and Redis. This app takes a long URL provided by a user and returns a shortened version. The shortened URLs can be stored and retrieved efficiently using Redis for quick lookups and Postgres for persistence.

Architecture diagram

arch

Features- Shorten long URLs

  • Store and retrieve URLs using Postgres and Redis
  • Redirect users to the original URL when the shortened link is accessed

Tech Stack-Backend: Golang

-Database: Postgres (for persistence) -Cache: Redis (for fast lookups)

Setup

  1. Install dependencies:
go mod tidy
  1. Set up environment variables: Create a .env file from .env.exampl and replace the values with your secrets
cp .env.example .env
  1. Set up docker container
docker-compose up -d
  1. Run the app
go run cmd/main.go
  1. Open browser at http://localhost:8080

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Directories

Path Synopsis
internal
templ: version: v0.2.663
templ: version: v0.2.663
components
templ: version: v0.2.663
templ: version: v0.2.663

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL