
Show HN: Learn how to build a small Twitter clone in 7 days - shane_burkhart
http://www.trysparkschool.com/?utm_source=hacker_news&utm_campaign=twitter_clone_clicks&utm_medium=post
======
derefr
"Small Twitter clone" can be taken two ways, and this one, I think, is the
less interesting of the two. (Not to denigrate the project for what it is;
it's a good idea.)

On a one-machine scale, Twitter can be a single Postgres table, or a single
ElasticSearch index. At the scale they actually are, it's really a whole lot
more.

I'd really love a tutorial—or possibly a whole book—that instead took you
through setting up the sort of _distributed system_ that is required to make a
Twitter clone run at a Twitter-like scale. Either through IaaS APIs, or on
your own with something like OpenStack DevStack.

It could probably _start_ where this tutorial _ends_ —with a one-node system
running a Twitter-backend-alike monolith. And then each chapter would increase
the scale, introduce a problem the scale causes, and then walk you through
adding in an additional component: a message queue; a fragment cache; app-
level health checks; a search indexing cluster; distributed logging + request
tracing; geographic sharding; multi-master DB replication—in order to solve
that scaling problem.

There would also be scale-points that would require changes in the business
logic: making IDs globally unique and sortable ala
[https://github.com/twitter/snowflake;](https://github.com/twitter/snowflake;)
deprecating but keeping around old APIs as new ones are added; "Ball of Mud"
refactorings; isolated Enterprise clusters of the app; etc.

Bonus points if later chapters actually go back and rip out solutions that
were introduced in earlier chapters—not because they were mistakes, but just
because they were right for 10^3/s but not 10^6/s. And _bonus_ bonus points if
they assume an SLA that requires that such switchovers occur without downtime.

~~~
shane_burkhart
I really like this idea! It has a very real world feel and I'm not sure there
is another course that does what you're talking about.

I think the course is more advanced than my target audience could handle right
now, but it might a nice follow up to a bigger web app course.

I'll definitely write this down as an idea for a future course. I'd like to
create a series of courses that take people from zero to employable and I
think that would be a nice addition. Thanks!

------
soneca
I finished the course a few days ago and it was awesome. Of course it is not a
fully functional complete clone, but it is an incredible learning resource.

It really starts from the beginning as in "first you have to install the
proper tools and prepare your software development environment" beginning.
Which is great to teach you things that you wouldnt learn in other free online
courses.

I think it is a essential resource that present you the full stack of a web
app, acting as the perfect complement to more pure code oriented courses like
freecodecamp and codecademy.

And you can really start from zero coding knowledge. I fully recommend it.

~~~
trevyn
>Of course it is not a fully functional complete clone

Indeed, that would require adding a decade of neglect and abuse. :-)

------
dom96
This looks like a really cool course.

In case anybody is interested in learning how to build a Twitter clone in Nim
then consider taking a look at my book[1]. It's not free but it is a good way
to learn Nim and web development concepts in a systems programming language.

1 - [https://manning.com/books/nim-in-
action?a_aid=niminaction&a_...](https://manning.com/books/nim-in-
action?a_aid=niminaction&a_bid=78a27e81)

------
Veratyr
Interesting that your site doesn't work at all without allowing third party
scripts. I don't think I've ever seen anything like this before, hosting the
entire page on another domain.

~~~
shane_burkhart
Yeah long story on how I ended up here. I was using
[http://teachable.com](http://teachable.com), but then I decided it would be
easier to use jekyll since it's good for code highlighting. I already had the
homepage built in leadpages, so I used their snippet to include it on the
page.

I don't like it, but I haven't had time to rewrite the page.

~~~
nsp
Ouch - I'm the CTO of teachable, had syntax highlighting on the todo list
forever - it just got bumped up on the list.

~~~
shane_burkhart
Hey, love the product, but there were just a few things I needed to be a
little better.

The code highlighting was a big one, but I also had issues when updating raw
HTML. I would create a code block in raw HTML and then go to update it later.
When I updated it, the elements that were there previously would be escaped
after updating. So any time I needed to update raw HTML, I had to recopy the
entire snippet since saving it would mess up what was there.

Other than that, I would've liked a little more detail for stats. I think I
was trying to segment users by how much of the course they completed, but
didn't find an easy way to do that.

I like the Teachable platform and I'll be making other courses in the future.
I'll more than likely switch back to Teachable when the syntax highlighting
gets done.

If you have any questions, feel free to reach out at shane at
trysparkschool.com. Thanks!

------
newscracker
I visited the page with uBlock on and nothing showed up. The I noticed that
leadpages.net is blacklisted on it. So I had to remove the Ad Block and
refresh the page.

------
riffic
Cool, may I recommend building an OStatus-compliant twitter clone?

[https://www.w3.org/community/ostatus/](https://www.w3.org/community/ostatus/)

~~~
carbocation
The last activity I see there is from January 2012, nearly 5 years ago. Is
that still active, perhaps somewhere else?

~~~
buzzybee
It's used in GNUSocial which has been gradually rising in activity.

------
wofo
Thanks for the course! I have a question unrelated to the contents: Why did
you choose to release it for free? I guess you spent a lot of time preparing
it, so I assume there must be some kind of (non-monetary?) benefit you expect
to get from it.

~~~
shane_burkhart
There are already enough barriers to overcome when getting started, I didn't
want money to be an additional barrier. I have a bunch of friends that want to
learn to code, but have struggled with courses that try to get technical too
quickly. My goal was to create the best resource for getting from 0 to 1.

I'm always going to offer this course, and a few others, for free. Having said
that, some people want to keep learning after taking these courses. I'm going
to offer a paid course that builds a full web app with users, payments, git,
etc. People that take the paid course will be able to build just about any web
app they want. My hope is, with a little more practice, they would be able to
get a job as a web developer.

~~~
wofo
Awesome! Thanks for your reply!

------
bootload
@Shane, is the course emailed in one hit, or in batches. If so that is an
interesting way to do it (phased roll-out of course by email) in itself.

~~~
shane_burkhart
It's sent out one lesson per day for 7 days. I used to do all in one day, but
the course completion rate was significantly lower. I think people were
getting overwhelmed.

~~~
bootload
_" I think people were getting overwhelmed."_

Good point.

------
rexreed
Ugh, I had to unblock a bunch of scripts to even view this page. Super fail.
I'm going to reblock everything I just blocked. Thanks.

~~~
dmoo
when someone builds a free resource to help people do you not think that the
tone of your comment is a bit harsh. Maybe something like 'hey Shane if you
did x or y it might help those people who have config z access your stuff'

------
Andrenid
Can you let the emails roll in, then do the course later in your own time? Or
do the links expire?

~~~
shane_burkhart
Yeah you can definitely do that. The links don't expire.

------
user5994461
The page is empty. Blocked by uBlock Origin.

~~~
rexreed
My Script blocker killed it too. If it wasn't a link from HackerNews, I
wouldn't have bothered to even try to unblock it.

------
was_boring
How did we as an industry go from "create a blog in 10 minutes" with rails to
a "create a twitter clone in 7 days"?

It seems we have gone backwards in terms of speed of getting things done in
the last decade.

~~~
drieddust
Not really creating a blog in 10 minutes using a framework is very different
from learning to build a twitter clone with without one is not comparable in
my view.

~~~
repsilat
Back in undergrad I picked up PHP for the first time one day and built a blog
with comments in one sitting. Super easy, anyone could do it, no frameworks
(or javascript) required.

~~~
drieddust
How did you do ajax requests without js?

~~~
repsilat
Ajax might have existed back then, but it was probably still called "DHTML"
:-).

To be honest I'm not really sure why you'd want javascript running on a blog
_today_ let alone more than decade ago.

------
DrewWeth
I got an email with the first course today and was pretty blown away tbh.

~~~
shane_burkhart
Thanks! I love hearing these things. I hope you enjoy the rest of the course
:)

------
chrismorgan
That 1.5MB of image on the landing page should be shrunk drastically—you could
trivially shave a megabyte off it, or even more.

~~~
shane_burkhart
You're right. I built the page with leadpages so I figured they would do that
for me. I'll have to shrink it down manually.

~~~
azdavis
This[1] might be helpful.

[1]: [http://tinypng.com](http://tinypng.com)

~~~
shane_burkhart
Thanks. Unfortunately, it came back with an error when I uploaded my image.

~~~
dqv
pngquant is more developer friendly :)

[https://pngquant.org/](https://pngquant.org/)

------
codesternews
Is their any other sites/courses like this freely available?

~~~
tent
Though I have not used it yet,
[https://www.railstutorial.org](https://www.railstutorial.org) by Michael
Hartl also focuses on building a Twitter clone.

~~~
briandear
Rails Tutorial is probably the single most influential training course among
the Rails community -- at least anecdotally.

I have worked with dozens of Rails devs over the years and in my estimation at
least 80% have done the Rails Tutorial. In my opinion, it's the single best
resource for learning Rails in a way consistent with real-world best
practices.

~~~
shane_burkhart
100% this. I learned rails with that tutorial and highly recommend it.

------
azdavis
Minor nitpick: it says "...you will learn how to:" and then one of the bullet
points (the one about SQL) starts with "How to..."

~~~
shane_burkhart
Good catch! I updated it, thanks.

------
syngrog66
if the feature scope and traffic scale is small enough you can build a
Twitter-like in 7 hours. if not 7 minutes. given all the tools, frameworks and
services avail today.

scope and scale are key

------
vijayr
Is there anything like this for heavier topics like AI,ML etc?

~~~
jmportilla
I teach an online course: [https://www.udemy.com/python-for-data-science-and-
machine-le...](https://www.udemy.com/python-for-data-science-and-machine-
learning-bootcamp/?couponCode=PYTHONDATA2016) on these topics

------
arisAlexis
I built writedown.co which is a blockchain enabled immutable Twitter clone.
Check it out.if you like

~~~
arisAlexis
sad to be downvoted each time I mention this free site I built with love.
Haters gonna randomly hate I guess

------
fiatjaf
Twitter clones are the easiest thing to teach in a beginner programming class.
That's ok, but don't say it like it is an amazing thing.

------
zizimaza
Lurker here. Someone mentioned this the other day here too. Too bad Twitters
dying, but you get the idea.
[https://news.ycombinator.com/item?id=13157254](https://news.ycombinator.com/item?id=13157254)

~~~
cookiecaper
Twitter dying is a huge opportunity, they've certainly proven the demand for
it. It's a surprise there aren't thousands of VC-backed wannabes popping up
already. Would be really interested if FB or Google bought them out and sought
to integrate.

~~~
daveguy
At the same time they proved demand they also proved difficulty in
monetization. Even if you have better execution there is the large network
effect for acquiring/maintaining users.

