ZapURL is a high-performance, scalable URL shortener built with Go and a microservices architecture. It allows users to shorten long URLs and efficiently redirect to their original destinations. The project is containerized using Docker and supports distributed key generation for unique short URLs.
Hosted at: zapurl.tech
- URL Shortening - Generate short, unique URLs
- Microservices Architecture - Modular services for scalability
- PostgreSQL - Persistent database storage
- Redis Bloom Filters - Prevent duplicate short URLs
- Consul Service Discovery - Manage service communication
- Dockerized - Easily deployable with Docker
- Go - Core backend logic
- PostgreSQL - Database storage
- Redis + RedisBloom - Caching and URL existence check
- HashiCorp Consul - Service discovery
- Docker - Containerized deployment
- Svelte - Frontend
-
Clone the repository:
git clone https://github.com/bikraj2/zap_url.git cd zapurl
-
Set up the environment variables in
.envrc
. -
Start the services using Docker:
make run/docker
-
Run the services manually (optional):
make run/shorten make run/redirect make run/kgs
Method | Endpoint | Description |
---|---|---|
POST |
/api/v1/shorten |
Shorten a long URL |
GET |
/api/v1/resolve/{shortcode} |
Redirect to original URL |
Example request:
curl -X POST http://localhost:8081/api/v1/resolve/{shortcode} -d '{"url": "https://example.com"}' -H "Content-Type: application/json"
- Implement user authentication
- Add click tracking & analytics
- Deploy using Kubernetes
- Add Custom short codes
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.
Have suggestions? Open an issue or drop me a message!