- cd backend
- rake db:create
- rake db:migrate
- rails s
- cd web
- yarn install
- npm start
- Some approaches are naive:
a. Shortening algorithm is pretty simple. I opted to focus on functionality + look & feel
b. Calling Link.all in a couple of places. For the purposes of this demo, I feel it's good enough. Pagination would have been better in the case of serving, and in the case of the bloom filter, it could be backed by Redis or such.
-
There's no security. CORS allows from anywhere. In practice, I would Only allow CORS from the production domain
-
If this where to become a public API, I would implement some sort of API key functionality with rate limiting and maximum number of requests per hour/day/month.
-
No error catching. Any errors that occur server side, will not appear client side. The user can be left scratching their head.
-
Not 100% test coverage. I only tested
ShortenController
andShort::BloomFilter
as a demonstration.