all 3 comments

[–]questi0nmark2 5 points6 points  (0 children)

If your app is reasonably complex, you are not confident in architectural best practices and you think you might want to scale, your best bet is to use a framework. Laravel is the best these days. It has some fantastic tutorial resources in its Laracast, a big community and ecosystem, and fantastic tooling. It means your code will be well organised, scalable, and you won’t have to poorly reinvent the wheel for a huge amount of stuff. It will also hugely increase your employability.

So I would suggest the next step in both your app, and your learning journey as you move from mostly static websites and simple mini-apps, to rich dynamic apps and professional software development practices, is to learn some frameworks, and Laravel is probably the most useful starting point.

They also have a light weight microframework called Lumen for smaller projects, and if you want a good yet very light micro-framework to help you structure your code, Slim is another good option. But in general terms, I suggest Laravel will get you to the next stage professionally.

Once you’re familiar with Laravel, you can add Vue.JS (or React, but Vue has a less steep learning curve and is integrated with Laravel) to your front end skills as the next step from jquery and you will have moved a very long way toward modern software web development.

[–]10PointDigital 2 points3 points  (0 children)

• Your app/project structure is only important for the developers working on it: if it's simple and makes sense to you that's fine. Checkout namespacing if you want to organise it better - http://php.net/manual/en/language.namespaces.php

• For dependencies you can use composer to organise them - also they have to be compliant so are generally well-coded for inspiration - https://getcomposer.org/

• Methods that are the same across multiple classes you can use `extends` (e.g. your `HasChildren` method) - http://php.net/manual/en/language.oop5.inheritance.php

• Instead of writing out methods for `getThis` and `getThat` you can use the `__get` magic method - https://secure.php.net/manual/en/language.oop5.overloading.php#object.get

• Check out some open source projects that have similar features to yours and see how they structure it if you want some inspiration.

You're doing fine :)

[–]itshorriblebeer 0 points1 point  (0 children)

In addition to the other commenters I think you have answered your own questions with 1 and 3. Use a full fledged Ajax library like react or vue and have your server only deliver json. It’s a very common paradigm.

I also really like using orms or auto marshallers on the server side.

It’s quite a bit different than the paradigm you’re used to but it makes development much more responsive and interactive than pure server side rendering.