You could read this:
https://learn.adafruit.com/running-programs-automatically-on-your-tiny-computer
or this:
http://mattrichardson.com/BeagleBone-System-Services/
and think that this will be an easy job. What is not said is that if your code loads a GUI, this won't work at all. Systemd services configure system services. Your GUI has to wait until the display server and display manager have started.