Intro disclaimer: I am struggling with the overall design logic for a large application that I am solely in charge of building at my current workplace. (Please keep in mind that I have never considered myself a "PHP developer" and my boss knows this! When put in charge of this project, I knew it would be a great opportunity to learn the principles of developing a full application, but I find myself struggling with "the basics" that I never even realized I didn't know!) I am not an expert in any area of programming, and most definitely consider myself a novice here, so any constructive criticism is welcome. This being my first ever post to a programming forum asking for help, I'm hoping that my broad question will lead to a more refined discussion and some concrete options of things I can consider and places I might find good examples.
Broad overview: As one of our (the company I work for) products, we sell mobile applications built on a preconfigured (pre as in...before I came on board) "platform" which is basically one big mobile application being utilized as a template for branded versions of said template. I am tasked with building a web application which will
#1) give the clients the ability to make changes to the specifics of their branded applications, and eventually
#2) let the developers make more advanced changes to those same applications and/or "build" new instances of that template...and possibly in the far future
#3) allow clients to build new instances of the template themselves.
Stretch goal: I really want this application to be highly scalable. For instance, I'd love to be able to deliver this application fully functioning, and let them know that "hey, we can also utilize it for future platforms without having to reprogram an entire web app from scratch!"
Some logic 'nitty gritty': This is where I'm finding that I get lost in the crazy number of options there are out there for building a php application. So, what I need is a program that will:
- take a logged in user's request for one specific application (passing an $id)
- "build" that application, which includes any number of 'features' (of which we have a current variety of 27 choices)
-
and each feature consists of (feature = 1 row in db)
- specific pieces of data(id, display_type, image, etc), which are stored in their respective columns
(every feature contains the same top level data piece keys, with varying values)
- "settings", there is an initial array of them that have the same keys throughout all features, but most features also contain additional settings - all of which are stored as JSON in 1 column of that same db table
- some features can be 'parents' to other features, to an unspecified depth of parentage
- take that appBuild and show it to the user in an incremental, but visual way which will allow them to point and click to make changes to each feature.
I've gotten much of this figured out. I believe I have the user login, and roles/permissions in hand...I've been working with vue.js and svgs as far as the visuals go...but I'm struggling with organizing the large amount of data that is involved in each individual application. Right now, I've managed to pull in each application and show the details (even though I've only been var_dumping the 'settings data' so far), but it's extremely messy.
I would really like each Feature to be its own object, and then to have an Application object which contains all of the Feature objects related to that app. (and each Feature to contain one or more Settings objects)....As far as the visual implementation, I'm thinking it needs to be shown "by page". (each page is also considered a Feature though) ie: the Home Page has it's UI setting values plus 3 dynamic Feature objects, each of which have their own UI settings, plus additional settings according to feature type. I feel like utilizing an Abstract Factory design pattern, along with Composite (for the features) is a good plan, but I'm struggling to find an example implementation that really helps me understand how to implement it in the grand scale that I have. They seem to mostly be absurdly simple, or too abstract (foo = bar kind of stuff) for me to really wrap my tired brain around the concepts.
When looking at my company's current (legacy) solution to this problem (they have something that developers currently use to put together the branded applications), it's a HUGE mess of javascript written in a completely nonsensical manner. They basically pull all the data in for each app and utilize massive if-then statements to sort out what to do with it all... That being said, it works - so what can I say?
If anyone has any advice on design patterns I should look at or complex examples of applications that sound similar, that would be super! Also, if there is any advice on what kind of things I could utilize helpers or custom libraries for...that would be awesome too. If you would like to see code, please ask! There's just so much of it right now that I couldn't begin to fathom where to start showing it in this initial post...but my hope is that by putting this out there, a more granular discussion can ensue.
Or, feel free to tell me I'm "on my own" on this too. I'm getting pretty used to that!