If you don’t want to use existing plugins, at least read the code to see how to do what you want. But write it as a plugin, not a theme. Themes are loaded after plugins, and don’t have the same activation hooks, which are needed for custom post types (flush rewrite on activation). And if the code is in the theme, you are locked in to using that theme. You can’t switch and you can’t independently deactivate things to determine a problem, without losing the functionality of everything.
Separate plugins are best — especially for modularity.