Best Way to Partition A Very Big Single Page App?

I’m creating one very very big single page app. It is very much a CRUD, SaaS app. At the moment it is about 5000 lines of code, but will end up being around 30,000 lines of code.

I had had in mind to make it all in one index.php file, but the file is getting a bit big so I am thinking of partitioning it into pieces, which may be the parts relating to contacts, activities, finances, settings etc.

My existing design has elements that are common to these different parts that are already integrated into the one index.php file, such as:

So I’m experimenting with breaking it up… I’ve just put each of those main section listed into php include files, which makes everything much more manageable from a size point of view. However things like the flows which manage contacts are still in index.php, while the places I want to use them are now in ssi_contacts.php. Hence they don’t appear in any of the menus as I try to use them. And editing ssi_contacts.php graphically is much harder as it no longer displays with any of my css.

Is there a better way to do this partitioning that will overcome some of these issues?

Best wishes,
Antony.

PS - or here is an idea… does one of the methods allow me to move the code out to the external file and then back into my main index.php file with a single click? That would be the easiest way to manage it all I think!

Community Page
Last updated: