

URL Shortener with Rust, Svelte, & AWS (1/): Intro + Setup
source link: https://dev.to/mileswatson/url-shortener-with-rust-svelte-aws-1-intro-setup-3fli
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

URL Shortener (2 Part Series)
In this series of posts, I aim to guide you through the process of creating and deploying a public API. Over the course of the series, you will learn how to use the following technologies:
- Rust with Rocket web framework - for handling API requests
- Docker and Docker Compose - for containerizing your application
- Svelte and Bulma - for creating a simple frontend
- Elastic Beanstalk - for hosting your service
- IAM and GitHub Actions - for automating testing + deployment
Explaining fully the reasons for choosing Rust would be a blog post in itself - instead, I recommend you watch the following video by Jon Gjengset:
If you haven't previously used Rust before, then I strongly recommend you spend some time reading through the Rust book before attempting to do any of this yourself.
Svelte
Svelte is a different kind of web framework - instead of being a library like React or Vue, it is actually a compiler under the hood. This enables you to write really clean, concise, and performant code (it does surgical DOM updates instead of using VDOM diffing+reconciliation).
If you want to learn more (or even if you don't), I can highly recommend watching this excellent presentation by the creator of Svelte.
Amazon Web Services (AWS) is the world's biggest cloud service provider. They provide over 200 services that allow organizations and individuals to rent resources from one of AWS' many data centers.
Cloud computing is becoming increasingly popular, as more and more companies prioritize agility and elasticity (which cloud platforms offer) over control and cost-efficiency (which traditional, managed infrastructure provides).
For beginners, AWS offer a free tier, which should allow you to complete this tutorial without spending any money. However, accidentally spending money is an easy mistake for beginners to make - I recommend following this video to minimize any surprise bills.
Before moving on...
- Install the latest stable Rust version by following these instructions
- Create a Github repo for storing your code (commit + push whenever you see fit)
- Use
cargo init --bin
to create a new Rust project, and check it works withcargo run
- Install Node.js
- Install Yarn with
npm install --global yarn
If you have any issues, compare your code with the part-1 tag of my repo.
That's all for this post! In the next post, we will create a simple HTTP API with the Rocket web framework. Make sure to click the "Follow" button if you want to be alerted when the next part is available!
Footnote
If you enjoyed reading this, then consider dropping a like or following me:
I'm just starting out, so the support is greatly appreciated!
Disclaimer - I'm a (mostly) self-taught programmer, and I use my blog to share things that I've learnt on my journey to becoming a better developer. Because of this, I apologize in advance for any inaccuracies I might have made - criticism and corrections are welcome!
Recommend
-
505
Kutt.it is a free and open source URL shortener with custom domains and stats.
-
102
Breviare :scissors: :v: Breviare is a minimalist URL shortener made in Javascript (NodeJS / ExpressJS / MongoDB / Ajax).
-
387
URL shortening is nothing new, it was originally made popular due to the 140 character limit of Twitter and the 160 character limit of SMS messages. https://trimlink.site https://trimlink....
-
25
When is a URL shortener not a URL shortener? 2011-08-16 by qntm The URL http://qntm.org...
-
16
Hot: Firefly 1.3.0 URL Shortener released Posted: 2011-02-01 - Last updated: 2019-06-05 Tagged
-
14
Screencast: Firefly URL shortener in less than 2.5 minutes Posted: 2010-07-12 - Last updated: 2019-06-05 Tagged...
-
100
Setup your own Firefly URL shortener in 2.5 minutes Posted: 2010-06-06 - Last updated: 2019-06-05 Tagged
-
20
Announcing Firefly, a ruby URL shortener Posted: 2010-03-29 - Last updated: 2019-06-05 Tagged ...
-
15
In the first post of the series, I covered the reasons for choosing Rust and AWS, as well as the process for initialising a new Rust project. If you haven't followed the steps in that article, you can find it her...
-
6
In the last post, we created a static front-end application with Svelte + Bulma, and then integrated it into our Rust code + Dockerfile. In this final post, we will cover the p...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK