Short-Link is a URL shortening service created with Golang. It provides a simple and efficient way to shorten long URLs. The project utilizes PostgreSQL for data storage and Redis for caching, offering a robust and scalable solution for URL management.
It's a project to master my skills, in other words an interesting challenge. I try to take advantage of substantial concept Golang, engineering and well-structure software engineering.
- URL Shortening: Convert long URLs into shorter, more manageable ones.
- Analytics: Track the usage of shortened URLs.
- Efficient Storage: Utilize PostgreSQL for storing URL data.
- Performance: Leverage Redis for enhanced caching and retrieval speed.
- Shutdown gracefully GO app with all containers
- Up project with docker for local mode
- Take advantage of go routine in saving stat and validate links
- Use redis for saving count visits
- Event-Driven-Design: We used queue with go routines to validate all links right after create a new one.
- Hexagonal Architecture
- Integration tests
- Implement kubernetes for production(helm-nginx)
- Golang
- PostgreSQL
- Redis
- RabbitMq
- Grafana
- Clone the Repository:
- Local(docker-compose)
cp .env.example .env.local
.make build-docker
for first time.make up
create database slink
make migration_up_v2
- Open
http://localhost:8080/index
- Kubernetes
cd deploy/kuber
andcp .env.example .env.production
.make install_all_cluster
make upgrade_app
- After any update in order to create a new version and upgrade.- Run
kubectl get pods
to make sure all pods are running. - Set
127.0.0.1 shortlink.com
in etc/hosts. - Run
make migration
- Open
https://shortlink.com
http://localhost:3000/
is Grafana Dashboard.
make down