The starting source code is available here on GitHub.
The ending source code is available here on GitHub.