I would look at other github projects on how folks have done it.  You could start with writing your model class and functions very specific for your problem and then abstract away elements where you could re-use.  If you have some code to share, you might get better suggestions on your next step.