{"id":16101090,"url":"https://github.com/logvinovleon/uberchallenge","last_synced_at":"2025-07-18T10:07:33.268Z","repository":{"id":57527467,"uuid":"69143036","full_name":"LogvinovLeon/UberChallenge","owner":"LogvinovLeon","description":"My email sender for the UBER challenge.  https://github.com/uber/coding-challenge-tools/blob/master/coding_challenge.md","archived":false,"fork":false,"pushed_at":"2016-09-28T08:42:16.000Z","size":149,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T00:26:32.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LogvinovLeon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-25T04:08:38.000Z","updated_at":"2016-09-25T05:33:32.000Z","dependencies_parsed_at":"2022-09-18T03:41:32.980Z","dependency_job_id":null,"html_url":"https://github.com/LogvinovLeon/UberChallenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LogvinovLeon/UberChallenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogvinovLeon%2FUberChallenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogvinovLeon%2FUberChallenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogvinovLeon%2FUberChallenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogvinovLeon%2FUberChallenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LogvinovLeon","download_url":"https://codeload.github.com/LogvinovLeon/UberChallenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogvinovLeon%2FUberChallenge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265738485,"owners_count":23820162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-09T18:49:05.792Z","updated_at":"2025-07-18T10:07:33.236Z","avatar_url":"https://github.com/LogvinovLeon.png","language":"Go","readme":"# UberChallenge\nMy email sender for the UBER challenge.\nhttps://github.com/uber/coding-challenge-tools/blob/master/coding_challenge.md\n\n## TL;DR\nJust go and try it! [www.uberchallenge.email](www.uberchallenge.email)\nThe API: [https://api.uberchallenge.email/email](https://api.uberchallenge.email/email) (I would describe it later)\n\n##Problem description:\nThis service allows you to send emails using different email providers.\nFor now it supports [Mailgun](https://mailgun.com) and [Sendgrid](https://sendgrid.com). \n \nThe best and the only feature of this service is that it falls back to the secondary provider if first is down.\n\n* Mailgun has 99.99% SLA.\n* Sendgrid does not have an SLA.\n\n## Scope\nThe solution focuses on the back-end, but also has a front-end part \nwhich allows to play with the service and send some emails.\n\n## Architecture\n\nBack-end and front-end are completely separated.\nThey have nothing in common. \n\nI just placed them into a single repo so it would be easier for you to review.\n\n### Back-end\nBack-end is a Go app.\nI have absolutely no experience with Go and started learning it after I decided to write this project.\n\n#### Why Go?\n\n* Go is designed to be fast, safe and reliable.\n* It's statically typed.\n* It is also designed for web.\n* This service is IO-heavy. It spends most of the time communicating with the providers.\n* Go runs every request in it's own goroutine, so if one request get's stuck or slow or fails it would not affect other users.\n\nThe whole back-end contains of a single endpoint which allows you to (surprise!) send emails.\nIt you want to test it you can execute this command from console:\n```\ncurl -X POST -H \"Content-Type: application/json\" \\\n-d='{\"to\":\"logvinov.leon@gmail.com\", \\\n\"subject\": \"Lorem\", \\\n\"body\": \"ipsum\"}' \\\nhttps://api.uberchallenge.email/email -i\n```\n\nI wanted to keep it as simple as possible, that's why I'm not using any frameworks.\nYou don't need them for such a simple app.\nIt also has `preferred_provider` parameter which is not required.\nYou can set it to `sendgrid` if you're brave. By default we start sending with `mailgun`.\n\n####Back-end is deployed on Heroku and this gives me a couple of benefits\n\n* Monitoring \u0026 metrics\n* Logging\n* Continuous deployment (github integration and easy rollbacks)\n* Scalability (the servers are completely stateless, so I can just add more instances with a single command)\n\nIf this night this service would become EXTREMELY popular I CAN (but wouldn't because of the costs) handle the load.\nI would receive an email from mailgun, that I would reach the quota soon.\nThe only two actions that I need to do is to change the mailgun plan and scale the number of heroku instances.\n\nIf I would have more time and motivation I would use some of the auto-scaling solutions, but it seemed to be an overkill.\n\n#### Security\nThe service checks the correctness of the client input and uses https.\n\nI do not store any tokens/API keys in the repo.\n\nIn order to run the service you need to set those environment variables:\n```\nSENDGRID_API_KEY\nMAILGUN_DOMAIN\nMAILGUN_API_KEY\nMAILGUN_API_KEY\nPORT (heroku sets it)\n```\n\nAnd execute:\n`go run web.go`\n\nIf you're planning to use only one provider you don't need to set the variables for the other one.\n\n\n### Font-end\nFront-end is in [docs](docs) directory.\nIt's just a couple of static files, so you can run it on your local machine.\nI'm serving them using github pages connected to a custom domain.\nGitHub Pages sites have a bandwidth limit of 100GB or 100,000 requests per month.\nIf my front-end would become EXTREMELY popular at night I would receive a polite email from GitHub (they guarantee it) and would setup a CDN in front of GH pages.\nGH pages is already a CDN, so it also allows we to serve my page faster to the users in different locations.\n#### Security\nI do not have any confidential or sensitive information on those pages, that's why I don't use https for Front-end.\n(Also because GH Pages does not support https for custom domains yet)\nIf it would be critical I can setup a CDN in front of it/instead of it and have https.\n#### Speed\nI did not use any heavy css frameworks like bootstrap.\nI used [milligram](https://milligram.github.io/) which is only 2kB gzipped.\n\n# Other projects I'm proud about\n\n* [Interpreter of my own functional language written in Haskell](https://github.com/LogvinovLeon/MIML)\n* [Algorithmic trading bot for Jane Street hackathon](https://github.com/LogvinovLeon/eth1)\n* Awesome work on Profilers and JS packaging that I've done at Quora, but cannot describe here because of an NDA.\n\n# Links:\n\n* [My CV](https://docs.google.com/document/d/1wxfYc1kwj5c51uXhXfhgFe0ZjelIctBDrPelmXH3VBA/edit) (It has all other links inside)\n* [My Github](https://github.com/LogvinovLeon)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogvinovleon%2Fuberchallenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogvinovleon%2Fuberchallenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogvinovleon%2Fuberchallenge/lists"}