{"id":17767895,"url":"https://github.com/marceloboeira/shortify","last_synced_at":"2026-04-16T11:02:58.570Z","repository":{"id":71790503,"uuid":"71497666","full_name":"marceloboeira/shortify","owner":"marceloboeira","description":"URL Shortener API assignment ","archived":false,"fork":false,"pushed_at":"2016-10-20T19:37:54.000Z","size":73,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T01:53:17.946Z","etag":null,"topics":["benchmark","mongo","redirection","ruby","shortener","shortify","url-shortener","webserver"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marceloboeira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-20T19:35:51.000Z","updated_at":"2019-07-17T19:33:43.000Z","dependencies_parsed_at":"2023-06-19T09:46:04.162Z","dependency_job_id":null,"html_url":"https://github.com/marceloboeira/shortify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marceloboeira/shortify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fshortify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fshortify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fshortify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fshortify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marceloboeira","download_url":"https://codeload.github.com/marceloboeira/shortify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marceloboeira%2Fshortify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","mongo","redirection","ruby","shortener","shortify","url-shortener","webserver"],"created_at":"2024-10-26T20:51:58.800Z","updated_at":"2026-04-16T11:02:58.545Z","avatar_url":"https://github.com/marceloboeira.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shortify\n\u003e URL Shortener\n\nThe complete assignment description is available at the [docs/ASSIGNMENT.md](docs/ASSIGNMENT.md) file.\n\nSome information about stack choice is available at the [docs/COMMENTS.md](docs/COMMENTS.md) file.\n\n### Setup\n\nAssuming that you already had Mongo and Ruby/Bundler installed, you can just run: `bundle install`\n\n### Running\n\nAfter complete the setup, you can run: `bin/rails server`\n\nIf you use `foreman`, there is two options available:\n\n* `foreman start -f Procfile` - Runs the default web server\n* `foreman start -f Procfile.dev` - Runs the webserver and also a local mongodb server\n\nHopefully by now the project is running\n\n### Tests\n\nTo run the tests, make sure mongo is up, then: `bundle exec rspec`\n\n---\n\n## Usage\n\n### API\n\nShortify has a built in REST like API, where you can manage your Shortened URLs.\nMore information at the [`docs/API.md`](docs/API.md) file.\n\n### Gateway\n\nThe API provides a shortened url, based on the host of the environment. The host can be set in the settings file of each environment.\n\nBasically every shortened url will look like: `http://shfy.ca/a32b7` -\u003e `http://{HOST}/{SLUG}`\n\n#### Redirecting\n\nCurrently the request status for the redirection is hardcoded to 301, mostly because it seems the right thing to do, once you have the DNS caching. That should be revisited if you want to have statistics of access.\n\n---\n\n### Benchmarks\n\nThe benchmarks were perfomed with [ApacheBench](https://httpd.apache.org/docs/2.4/programs/ab.html), running along with the webserver on my own local machine, the resuts were satisfatory, considering the stack and the conditions.\n\n**Test params**:\n\n- Goal: 10k requests\n- Conditions: 100 concurrent requests\n- Url: http://localhost:5000/example_slug\n- Command line example: `ab -c 100 -n 10000 -g results.data http://localhost:5000/example`\n\n**Results**\n\u003e results ploted with [gnuplot](http://gnuplot.info)\n\n![benchmark](./docs/benchmark.png \"benchmark\")\n\n## Roadmap\n\nSome nice things I would like to implement in the future.\n\n- [ ] API dynamic documentation (Swagger)\n- [ ] API Authentication\n- [ ] Custom Cache-control (Related to stats vs crawlers)\n- [ ] Improve api-database reliability\n- [ ] Improve benchmarks\n- [ ] Pretty error pages\n- [ ] Grape/Mongo validators (Url/Slug)\n- [ ] Search/get by slug\n- [ ] Expiration Date\n- [ ] Statistics (Access, origins, user-agent...)\n- [ ] Automated deploy\n- [ ] Logging (GrapeLogger/Middleware logger)\n- [ ] Monitoring (NewRelic)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarceloboeira%2Fshortify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarceloboeira%2Fshortify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarceloboeira%2Fshortify/lists"}