ShrinkIt is an open-source, serverless URL shortener built with AWS SAM and Go (Golang). It allows you to shorten long URLs into tiny, shareable links while staying cost-efficient and fully under your control.
- 🔗 Short URLs — Generate simple, easy-to-share links.
- ⚡ Serverless — Powered by AWS Lambda for high scalability and low cost.
- 🛠 Built with Go — Fast, efficient, and highly portable.
- 🧩 Infrastructure as Code — Managed using AWS SAM templates.
ShrinkIt is designed as a fully serverless app:
- API Gateway — Provides REST endpoints for creating and retrieving short URLs.
- Lambda (Go) — Business logic written in Go, handling shortening and redirection.
- DynamoDB — Stores original URLs and short-code mappings.
- AWS SAM — Deploys and manages the entire infrastructure.
[ Client ] → [ API Gateway ] → [ Lambda (Go) ] → [ DynamoDB ]
- AWS CLI configured with your account
- AWS SAM CLI installed
- Go 1.23+
git clone https://github.com/ticatwolves/shrinkIt.git
cd shrinkIt
make build
make deploy
Follow the prompts to configure stack name, region, and permissions.
-
Shorten a URL
curl -X POST https://<api-id>.execute-api.<region>.amazonaws.com/prod -H "Content-Type: application/json" -d '{"url": "https://example.com/very/long/url"}'
Response:
{ "short_url": "https://<api-id>.execute-api.<region>.amazonaws.com/prod/shrink/abcd123" }
-
Redirect to original URL
curl -i https://<api-id>.execute-api.<region>.amazonaws.com/prod/shrink/abcd123
make local-start
Test with:
curl http://127.0.0.1:3000/shrink -d '{"url":"https://example.com"}'
.
├── cmd/ # Go Lambda handler
├── internal/ # Business logic
├── deploy/template.yaml # AWS SAM template
├── go.mod
└── README.md
This project is licensed under the MIT License.