myurl

A blazing-fast, planet-scale, and easy-to-use serverless URL shortener!

Usage no npm install needed!

<script type="module">
  import myurl from 'https://cdn.skypack.dev/myurl';
</script>

README

Welcome to myURL 👋

CircleCI Coverage Code Climate maintainability Version Downloads Dependencies devDependencies Vulnerabilities Dependabot Status License Docs Standard code style Prettier code style Deploy to Heroku Issues Issues

A blazing fast, planet-scale, easy-to-use serverless URL shortener!

The secret sauce is deep integration with CDN and aggressively caching everything.

🏠 Homepage

Install

npm i -g myurl # or
yarn global install myurl

Prerequisites

Unfortunately some things can't be automated. e.g. migrating to Route53?

Usage

npx myurl domain.name

Architecture

I was originally going to build this using Cloudflare workers + Cloudflare K/V, BUT then I found out I can't have access logs without paying for the Enterprise plan, so here's Plan B:

AWS

CloudFront allows access log to be stored in S3, and with that we can do any sort of analysis on that. An additional benefit of this approach is that you can use whatever tool you already have that analyzes access logs on S3, so you don't have to be locked in to the analytics of your link shortener!

And the plan here is to have CloudFront trigger lambdas on any URLs, the lambdas would check DynamoDB for any records, and then instruct CloudFront to cache the results!

This aggressive caching of redirects should make requests instantaneous, while the use of Lambda and DynamoDB would make it 1. serverless (you don't have to maintain anything), and 2. planet-scale!

Run tests

yarn test

Author

👤 Jane Jeon

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Jane Jeon.
This project is AGPL-3.0 licensed.