If you’re writing the app because you want to learn how to program, then start with the links that @desertblade posted.
If the only reason you’re writing the app is to accomplish a specific automation, you’re better off using CoRE. It’s a rule engine that doesn’t require you to learn how to program, but can do almost everything that can be done by writing a custom app.