|
| 1 | +--- |
| 2 | +slug: why-codeamigo |
| 3 | +title: Why I Created Codeamigo |
| 4 | +author: Philip London |
| 5 | +author_title: Founder @ codeamigo.dev |
| 6 | +author_url: https://github.com/plondon |
| 7 | +author_image_url: https://avatars.githubusercontent.com/u/5640772?v=4 |
| 8 | +tags: [codeamigo, about, education] |
| 9 | +--- |
| 10 | + |
| 11 | +I've applied to work at [Codecademy](https://www.codecademy.com/) three times, once in 2014, again in 2015, and most recently in 2020. I've been rejected all three times. A few weeks after the most recent rejection I decided to build my own version of Codecademy. I was living in Spain so I thought codeamigo would be a good name. Here's why I created [codeamigo.dev](https://codeamigo.dev) and what I've learned so far. |
| 12 | + |
| 13 | +I love the interactive learning experience of Codecademy. Of all the mediums I've used to learn how to code, YouTube, blog posts, tutorials, etc., Codecademy always stood out. I loved feeling a sense of accomplishment after finishing a step or lesson, or reaching my streak goal for the week. When I was first learning to code, I visited Codecademy everyday. I wouldn't be a developer without it. |
| 14 | + |
| 15 | +What _bothered_ me about the platform was that I didn't know my teachers. I wanted to connect with members of my community and learn from them, instead of just digesting information from a black box. Watching [MKBHD](https://www.youtube.com/user/marquesbrownlee) on YouTube made this clear. I don't watch everyone of his videos because I'm interested in each and every piece of tech, I'm interested in him, and how he presents his material. |
| 16 | + |
| 17 | +I thought if I could bring that concept to coding lessons and tutorials people would be able to learn from and follow peers they liked learning from. Building the platform was a lot of fun and quite challenging. |
| 18 | + |
| 19 | +## Compiling Code on The Fly |
| 20 | + |
| 21 | +Without a doubt the most challenging aspect of building codeamigo.dev was the code compilation. There are not a ton of examples of it in the wild. In fact, [Amjad Masad](https://twitter.com/amasad), who built repl.it, also wrote the code for Codecademy. Anyway, I decided to start with just languages the browser can understand natively, so HTML, CSS, and JS. [Ives Van Hoorne](https://twitter.com/compuives) and the [codesandbox](https://codesandbox.io) team were a great inspiration. |
| 22 | + |
| 23 | +### Attempt 1: babel-standalone |
| 24 | + |
| 25 | +Based on talks given by Ives I figued that [babel-standalone](https://babeljs.io/docs/en/babel-standalone) would be a good first step. Everytime a file changed I would post a message to an iframe that was listening for files, transpile them with babel, and then append the generated output to a script tag. I had special logic for if the file was HTML or CSS. It was very primitive, messy, and slow. I was happy it worked but it would sometimes take 5-6 seconds to render a change. |
| 26 | + |
| 27 | +### Attempt 2: parcel |
| 28 | + |
| 29 | +After scouring the internet for other solutions I came across [parcel](https://github.com/parcel-bundler/parcel/issues/1253) and thought this might be a good approach. In fact, they even had their own [REPL project](https://parcel-repl.vercel.app/) that mirrored the functionality I wanted. This worked well for awhile and was what the project was using when I posted it to [Hacker News originally](https://news.ycombinator.com/item?id=26464998). However, it would often use too many webworkers and cause the site to crash. Plus, I knew it wouldn't be able to scale past browser based languages. |
| 30 | + |
| 31 | +### Attempt 3: repl.it approach |
| 32 | + |
| 33 | +Next up I tried [recreating repl.it's approach](https://cloud.google.com/customers/repl-it). But it thoguht it would be too complex of an endeavor considering I have yet to find product-market-fit. |
| 34 | + |
| 35 | +### Attempt 4: Codesandbox To the Rescue! |
| 36 | + |
| 37 | +A few months ago, codesandbox released [sandpack](https://github.com/codesandbox/sandpack), which is exactly what I was looking for. A super fast, super scalable browser bundler. I would still like to dive deeper into Attempt 3, but only once I have more users and interest. |
| 38 | + |
| 39 | +## Learning New Tools |
| 40 | + |
| 41 | +I've loved the process of recreating Codecademy. I've loved owning all aspects of the project, the backend, frontend, and design, I've been able to implement features quickly and deploy them easily and automatically through [vercel](https://vercel.com). I've gotten to use and love [linear](https://linear.app) for issue management and [plausible](https://plausible.io/) for analytics. |
| 42 | + |
| 43 | +### Backend |
| 44 | + |
| 45 | +codeamigo.dev's backend uses NodeJS to serve an Apollo Server GraphQL API. Everytime you take a lesson, the backend creates codeModules specific to your user, so that it can save your progress. Of course it also tracks what step you are on and which checkpoints you've completed. When and if you decide to create a lesson, codeamigo will provide you with templates to get you started on React.js, Angular, or VanillaJS/TS projects. |
| 46 | + |
| 47 | +### Frontend |
| 48 | + |
| 49 | +The frontend is a NextJS app using apollo-client to manage state and tailwindcss for styling. |
| 50 | + |
| 51 | +### How It Works |
| 52 | + |
| 53 | +codeamigo.dev provides you with a platform to create Codecademy style lessons. Each lesson is made up of Steps, and each Step is made up of Checkpoints. A Step can have many or no Checkpoints. Each Checkpoint points to a test you must write that a user must pass. You can read more about testing [here](https://docs.codeamigo.dev/docs/). |
| 54 | +I hope that this project helps people learn new topics, either through teaching them or taking lessons! |
0 commit comments