This post is for neophyte developers looking for a free, relatively straightforward project to give them hard and soft development skills while increasing their online profile.
This README is considered beta and will likely change. This was pulled from a Reddit commented I made that spiraled out of control, and past the 10,000 character limit of Reddit. Please let me know if you find anything that doesn’t make sense.
There is no shortage of ideas for programming projects online. Despite this I encounter developers on a regular basis who say they don’t know where to start, what to work on, or how to work on it. This is intended to be a very opinionated “project”.
Basically, just a well formed project, with lots of opinions but not too much guidance. I try to link to some useful information information along the way, but learning to find your own resources is a valuable skill.
You will hit many, push through them. Being a developer means constantly learning. If you are suffering from learned helplessness, get over it.
The following services will be used in this project, after this point, it will be assumed you have accounts on these 5 services.
- Twitter: a twitter account is useful to increase your public profile and very low overhead. Twitter is a wonderful place for short form ideas, sharing links and having conversations. Additionally it will be used once we get down the rabbit hole.
- Medium: a medium account is quickly becoming the place for long form ideas. It is easy to use and gets out of your way. Making writing a habit is astonishingly useful, both for you public profile and your thought process. Write about working through this project as you do it.
- Github: a github account is basically required for a developer these days, it is where you will be keeping the source for this project.
- Amazon server(s): an amazon microserver is great to have, and costs you nothing. Use EC2 to setup your own little webserver and feel free to experiment with their other free services. It is where our project will run.
You are going to write a web based CMS (Content Management System) with Golang / SQLite and Markdown that will run and allow you to manage your own website.
Now, I select this project because it is trivial, useful and free — so you have no reason not to do it. Everything needed to do this project is easily accessible online, nothing is particularly complex, and it will leverage skills you will use everyday as a developer.
What will this teach you?
- EditorX: you will be living in a text editor over the course of this project, best to find one you like and become and expert in it. I recommend vim, but I am extremely biased.
- Git: every (decent) professional shop uses version control, you need to well. You will be using it concert with github. This is the backbone of the project, you will be using it constantly.
- Github: by far the most popular and visible place for developers. It has concepts that belong to it that are not a part of git, worth learning and building a profile on.
- Amazon EC2: lots of shops use amazon, great to know how to use the UI and how it works, even if only basic use. Plus, free server!
- Golang: fantastic and easy to learn and use programming language. Picked for this project due to simplicity and lack of external dependencies.
- SQLite: great, easy to setup database with unique limitations, great for learning.
- Ubuntu Server or CENTOS: pick one of these OSes for your amazon EC2 server — you will learn to do basic maintenance on them. Updates, reading logs, log rotation, etc.
- Templating (html/template and Markdown): a way of cleanly separating data from layout.
- Writing: via your constantly updated medium posts of course.
- SSH / SCP: will be used to connect to your server and manage files, will require you to use pub/private keys and other fun stuff.
- SQL: everyone needs a basic understanding of SQL these days, even those who desperately try to avoid it.
- Unit Testing: a required skill for modern day development, also coverage reports!
- Licensing (open-source): good to have a familiarity with the basic licenses that exist and what they mean.
- Write — Start an article in medium about (something). Try to get into a schedule for updating your medium with a new article (maybe once a week).
- Learn git basics — how to push, pull, clone, revert, checkout, etc. There are literally thousands of tutorials on git. (hint: learn to use the console, way easier in the long run).
- Learn github basics — github has some unique concepts to it, learn about them, be able to create, delete, track projects on github. Start a project, explore it a bit.
- Learn amazon basics — how to create a server, how to delete a server, how to use SSH keys, pick which server operating system you want to go with — and get your development server up and running.
- Read up a little on the basics of Markdown, and why it is useful, for general knowledge.
- Read up a little on SQLite, and why it is useful, for general knowledge.
At this point, you have a minimal functional knowledge on the environment you will be working in.
- Setup a Github project for this — and pick a license (I like MIT, but whatever floats your boat) — this is where you code will live. Read up on a few open source licenses (MIT, GNU, Apache).
- Setup a Go development environment locally, on your personal computer. Lots of tutorials for this.
- Do a little basic Go development (Hello World), use git along the way.
- Write a test and example that works with go test, use git along the way.
- Push those changes from your local git to github.
At this point, your little hello world application should have multiple commits on it, and those commits should be pushed up to your github repo and visible via the web interface. From here on out, I am not going to remind you to commit to git and push to github, that is a constant, forever.
At his point, you are a baby gopher!
- Write a little web server in Go (just using the standard library, tons of tutorials, get it to say Hello World in a browser)
- Write a test for your little server, to ensure it is working properly, go has built in tools for this “go test” and lots of great tutorials. Since your server only does one thing, the test is super-easy and **httptest **package can help.
To the server!
- Get Go setup on the server, where your app will be living in the future, lots of tutorials online.
- Setup an environment where you can do work either directly on the server over SSH or via your favorite editor via like SCP, up to you.
- Get your Hello World server compiling and working on the server… you should be able to access it via the servers IP.
- Make sure your tests still pass. Did you remember to write more tests as you went? If you didn’t, this is a good time to double back and write more tests. Google about “golang test coverage” and find out how you are doing!
You now have a web based go application!
- Add in using html/template to your little hello world
- Go get a package and use it (SQLite)
- Create your database basic schema (for now, 1 table, 1 field is fine)
- Put data manually in database
- Access the DB from the server to serve whatever is in the database, maybe even changing it (a counter is a good start)
So, now you have database access, sweet… we will keep manually changing the data in database.
Making that DB useful
- Flush out your database schema… maybe like an articles table, with like content, author, etc.
- Make it so your web server can serve articles at like http://(serverip)/article/(id or name)
At this point, your server is pulling data out of the database and using a basic html/template to render it at the above URL — not a CMS yet, but hey, it is a thing!
Actually making it a web based CMS!
- Make a new section of the site, an “admin” section for changing the data in the database (the content you will be managing)
- Make it so you can do all CRUD operations on articles (Create, Read, Update, Delete) — of course with an admin password. Realize without SSL this is very insecure and terrible, but this is just a trivial proof of concept thing anyway.
Now, rather than using html/template syntax for your templates — a syntax that no one but your fellow Gophers will understand, switch it over to Markdown (hint: blackfriday)!
- Do all your tests still pass? Are you proud of your code?
Now you too can look sorta weird in a gopher suit.
The Rabbit Hole
The base project is relatively simple, but if you choose to go down the rabbit hole, stuff will ramp up in complexity rather quickly.
So, lets make this a little more production worthy.
- Load test it — see how many hits it can take. Learning load testing software is useful and fun.
- Replace your database driver with mocks in tests (hint: interfaces) for improving unit testing performance and correctness. This breaking of dependencies to make testing easier.
- Blackbox test it — write a separate go application that acts like a web browser and ensure your pages always do what they should — tested against the live site rather than using the httptest tools. This is a “from the outside” view as compared to the unit-testing view which is very much from the inside. This is is a great skill to have if you are thrown into an organization with no testing as it gets the most coverage with the least effort.
- Setup a system that allows you to upgrade the server with zero downtime. You can use port forwarding, passing off socket ownership, lots of great ideas.
- Make it run on https (generate a cert, set it up in the server, etc)
- Add a “log in with twitter” option — and allow yourself to log in with your twitter account.
Random “Other” Things
If you are looking for work, get a professional domain & email address. The best email address would be like joe -at- joesmith.com. Your site could hold your profile, links to your github, medium and twitter. Put this domain and email address on your resume (the site could run on your free EC2 account).
Don’t be afraid to fiddle… when people pick up programming at a young age, they don’t plan, they do, they fumble about, they try random things. This is a useful strategy because at the start, even if you are doing the wrong thing, you are learning tons.
As we get older, we seem to fiddle less — and that is a shame as it is still one of the best ways to learn.
And… last but not least, watch this video and be aware of the Three Lies.