flippakitten
Expert Member
Nobody picks PHP...
If I want to render a static HTML website with a few things like a contact form, I'll use PHP.
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Nobody picks PHP...
If I want to render a static HTML website with a few things like a contact form, I'll use PHP.
hours... I personally prefer seconds.
Sorry you're developing a front end with a CRUD and full database in seconds?
Gatsby. You're welcome.
Have you ever used Rails?
This? https://www.gatsbyjs.org/docs/
It's a nice concept but I'm struggling to see why I would want to use it and to figure that out, I would need to implement something to find its advantages and disadvantages.
If someone wanted a "Hi, I'm a plumber. Here's my contact details" website I'll give them a "blistering fast" PHP, HTML, CSS website there's no reason to get NodeJS involved.
Personally I'm shifting towards Flutter in preparation for Flutter For Web, the cost savings for me has been epic so far by pairing up a Flutter UI with a Rails backend.
As for JS, I get by just fine with React and Redux, it's extremely expensive to develop but I'm not paying for it so whatever.
I have, but I don't believe that Rails just randomly creates a database without you taking time to specify how the schema appears?
And besides Rails isn't really used for SPA - which is what we're discussing here.
rails new my_project -d mysql
rails db:create
rails g model User name:string email:string
rails g resource Article name:string user_id:references
rails db:migrate
#app/models/user.rb:
class User < ActiveRecord
has_many :posts
end
#app/models/article.rb
class Article < ActiveRecord
belongs_to :user
end
NodeJS has nothing to do with it?


Or Gatsby.yes, node has nothing to do with PHP, HTML or CSS on a PHP, HTML and CSS website
So like Mongoose?Bash:rails new my_project -d mysql rails db:create rails g model User name:string email:string rails g resource Article name:string user_id:references rails db:migrate
Ruby:#app/models/user.rb: class User < ActiveRecord has_many :posts end #app/models/article.rb class Article < ActiveRecord belongs_to :user end
Schema defined for my SPA's API. Just update the controller with CRUD (if I'm lazy I could just rails g scaffold_controller Article)
I know that's a very simple schema but the point is once you know what your Schema should look like, it's a matter of minutes to set that up in Rails.
So like Mongoose?
Where are you hosting out of interest?Never used mongoose and never will because it's only for MongoDB. So no, Rails is not like Mongoose.
My choice for distributed SQL is CockroachDB because it's boring and predictable. I tried to demo it to someone and the response was "Oh so it's like a relational database".
Again though, it's complete overkill for 99% of apps. I've seen a MySQL DB with 100,000,000 rows in a table. I've seen a MySQL table with over a billion rows.
I have a LAMP server running on a free micro instance which I can dump a bazillion PHP one pagers on and it will continue to hum along forever, maybe have to restart it once every 2 years.
No need to over engineer, it's expensive and pointless.
I will first try the front-end of things and see whether or not I like it, if I do I would try to go full stack.
Where are you hosting out of interest?
My personal website is running on Gatsby. It's so great!Or Gatsby.
Nice one guyMy personal website is running on Gatsby. It's so great!
Ronald Langeveld
ronaldlangeveld.com
Well I note your site is a PWA (generally CRA and Gatsby should be) so you're winning there already.There's actually a lot companies running sites built with Gatsby. And not all of them are "static" in the sense that it doesn't change.
Showcase of Gatsby Websites
Gallery of sites using Gatsby across the web, find inspiration or inspect the code of popular projects.www.gatsbyjs.org
I really do thing the the future of the web is javascript served statically (React, Vue, Angular, etc) and then data is served dynamically with API's - this is basically what any app on your phone does as well.