Jump to content
MakeWebGames

Framework Recommendations


Samurai Legend

Recommended Posts

Hello everyone! Hope all is well with you all. 

I previously was planning to recreate my old project Samurai Assault. 
 

I was wondering what framework would you guys use and why?

I wanted to go with Laravel, Inertia and VueJS however, someone pointed out Inertia was a headache to work with. 
 

I do want to proceed using Laravel as I believe that will boost my credentials within a career in Web Development. However, Inertia and Vue I am not to sure.

So other than Inertia and Vue I believe the best alternative are either just using the default blade system, Splade (Which also uses Vue) or Livewire (Which I know nothing about).

What are your thoughts? 

Edited by Samurai Legend
Link to comment
Share on other sites

5 hours ago, Samurai Legend said:

Hello everyone! Hope all is well with you all. 

I previously was planning to recreate my old project Samurai Assault. 
 

I was wondering what framework would you guys use and why?

I wanted to go with Laravel, Inertia and VueJS however, someone pointed out Inertia was a headache to work with. 
 

I do want to proceed using Laravel as I believe that will boost my credentials within a career in Web Development. However, Inertia and Vue I am not to sure.

So other than Inertia and Vue I believe the best alternative are either just using the default blade system, Splade (Which also uses Vue) or Livewire (Which I know nothing about).

What are your thoughts? 

I have always been told by a friend who has built games professionally for years to use laravel and learn it but i could never get my head around it (coming from someone who basically used to build games with just mysql and old school html etc nothing fancy no frameworks.) id go with laravel hes built some great games over the years.

  • Like 1
Link to comment
Share on other sites

Far be from me to put people off the big frameworks, consider writing it in PHP ... plain old-fashioned PHP, no framework, in fact with care you can get away without composer.json or indeed a vendor folder - not recommended however assuming you want to write tests (and you do... trust me), not to mention making autoloading a breeze!

I've seen far too many instances of ""Laravel"" programmers that simply cannot write raw PHP, they have been too accustomed to using all the bells and whistles which Laravel provides. Don't get me wrong, I like the bells and whistles, but a) they are not too difficult to write for your use case, and b) sometimes you have to write real-world code that simply doesn't fit into the patterns that can be forced upon you with these large frameworks.

The same holds true to a lesser extent for the other large frameworks - and in fact I attended a fascinating talk in Birmingham last year IIRC on framework agnostic code - ie your code or domain logic was separate from the framework making it simple to switch between Symfony, Laravel, CodeIgniter for example.

Perhaps you feel that some sort of basic framework is required, in which case have a look at Slim, it's small, fast, and very easy to use. Best of all, you can relatively easily convert your controllers for use in other frameworks as it uses little more than PSR-7 messaging.

For CSS, I'm a fan of Tailwind and for Javascript, Alpine seems to fit the bill nicely, though both can take a bit of getting used to.

If you do go the Laravel route, perhaps have a look at Livewire. It's becoming a very popular addition, and is starting to have the feel of React or Vue without the complexities.

Laravel can be beneficial from a career point of view, I use it commercially daily, though I work with legacy code - no framework in sight - equally as much. I suspect that the legacy knowledge is oddly more useful the further up the career ladder you get - but your mileage may well vary.

Whatever you decide on - stick at it for a while, learn the ins and outs, the little "gotcha's", find the sweet spot, the ideal position in the market for that framework, and keep experimenting with it. Before long you will become accustomed to its ways and be able to push its boundaries forward as well as your own.

  • Like 2
Link to comment
Share on other sites

On 9/19/2024 at 2:01 PM, aventro2 said:

What problems did your friend run into with Inertia? I have built applications with that stack and it worked very well.

The problems I do not remember and it was way too confusing. 

On 9/20/2024 at 6:14 PM, Jax said:

Far be from me to put people off the big frameworks, consider writing it in PHP ... plain old-fashioned PHP, no framework, in fact with care you can get away without composer.json or indeed a vendor folder - not recommended however assuming you want to write tests (and you do... trust me), not to mention making autoloading a breeze!

I've seen far too many instances of ""Laravel"" programmers that simply cannot write raw PHP, they have been too accustomed to using all the bells and whistles which Laravel provides. Don't get me wrong, I like the bells and whistles, but a) they are not too difficult to write for your use case, and b) sometimes you have to write real-world code that simply doesn't fit into the patterns that can be forced upon you with these large frameworks.

The same holds true to a lesser extent for the other large frameworks - and in fact I attended a fascinating talk in Birmingham last year IIRC on framework agnostic code - ie your code or domain logic was separate from the framework making it simple to switch between Symfony, Laravel, CodeIgniter for example.

Perhaps you feel that some sort of basic framework is required, in which case have a look at Slim, it's small, fast, and very easy to use. Best of all, you can relatively easily convert your controllers for use in other frameworks as it uses little more than PSR-7 messaging.

For CSS, I'm a fan of Tailwind and for Javascript, Alpine seems to fit the bill nicely, though both can take a bit of getting used to.

If you do go the Laravel route, perhaps have a look at Livewire. It's becoming a very popular addition, and is starting to have the feel of React or Vue without the complexities.

Laravel can be beneficial from a career point of view, I use it commercially daily, though I work with legacy code - no framework in sight - equally as much. I suspect that the legacy knowledge is oddly more useful the further up the career ladder you get - but your mileage may well vary.

Whatever you decide on - stick at it for a while, learn the ins and outs, the little "gotcha's", find the sweet spot, the ideal position in the market for that framework, and keep experimenting with it. Before long you will become accustomed to its ways and be able to push its boundaries forward as well as your own.

Thank you for your response. I was told by someone else about a year ago to use Slim. I am now looking into Slim and I have come across detailed videos of Slim as well as blogs. By my understanding Slim seems to be something which I can work with and benefit from.
 

How would you recommend me to go with Slim? 
 

Tips to start off my journey and what I should focus on.

Best way to connect to a database


What can I pair Slim with? e.g. Twig, JavaScript framework, maybe a SPA? Or maybe not

I was thinking using Slims Skeleton and adding a database migration (Phoenix or Phinx) as I believe there isn't one. I know this isn’t require.

From there I’ll create an authentication system (login & register) 

Then start off with a home page.

Edited by Samurai Legend
Link to comment
Share on other sites

With Slim, you really want to install a few extras. You'll need a PSR7 library - sliim/psr7 is perfectly decent. Slim does come with a container, but it's limited, so get yourself php-di/php-di. Drop in twig/twig of course, vlucas/phpdotenv for parsing your .env file and I like to use respect/validation for form validation. monolog/monolog for logging of course and finally, though I often forget about this one, is slim/csrf for CSRF protection though tbf, it's not difficult to do yourself.

composer require slim/slim slim/psr7 slim/csrf php-di/php-di vlucas/phpdotenv monolog/monolog twig/twig 

I could rustle up a bare-bones skeleton, however there are plenty out there that are very decent and probably better than I can produce.

Unlike many other frameworks, there are so many ways of booting Slim - you could for example place all the code into your index.php apart from the controller (and presumably repository) code, however I find I tend to split things up a bit.

It's really up to you to choose what tools you need. Your container (usually php-di) allows you to instantiate any class and access that via DI, so you could (for example) have both Twig and Smarty in the same project potentially sharing some templates. CSRF, you can do yourself thought there is a package for that. Monolog is probably the standard logger as it supports writing to a huge variety of endpoints - files, databases, etc. Validation, well I tend to use Respect as it seems to fit my needs. and so on.

I'd suggest you experiment with some of the basic examples in the Slim docs first have at look at the original author's skeleton akrabat/slim4-starter as it's a great starting point.

For databases, use the container to instantiate a PDO instance, and ideally use repository classes that access the PDO instance - it keeps your code nice and clean. As for linking with JavaScript .. your choices are unlimited. It makes no demands whatsoever, on JS or CSS, so that's all up to you. As mentioned above, look into Alpine and Tailwind as both fit nicely and are powerful enough to produce some amazing applications.

If you run into trouble or need some advice, give me a shout; I'm always willing to lend a hand. In the meantime, I'll pull apart one of my apps to leave it the basic index/login/register/home/logout endpoints and pop that in a repository for people to play with.

Edited by Inveteratus
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...