the trickiest stuff is just dealing with epubs, converting epubs to html. i can't say how long it took me because it's something i did gradually, always working on it whenever there was a problem with a book i wanted to add.
Is the code open source? I've been wanting to build something similar but with the option translate the text, to help with language learning.
Dunno about this one, but ttu[1] is a very popular offline web-based HTMLZ and EPUB reader in the Japanese learning community.