My primary background is in desktop development and my knowledge of web development is a little rusty by now. I know about Node.JS, Angular, React, Express and the like and have done a few small projects with these technologies. So far, I have implemented the below requirements for each project myself or copied them from previous projects. Now I am looking for a reasonable fullstack framework with the following requirements:
- A central definition of data schemas. I don't want to define my schema or validation twice, once in the frontend and once in the backend.
- Automatic generation of REST endpoints. I hate boilerplate code and don't want to reimplement Get/GetOne/Add/Update/Delete and Websocket for each data model. Even better would be a GraphQL interface.
- Authorization and Authentication
- No manual HTTP calls for standard cases. I want to define my model at the server and have the data available in an array at the client. As soon as a client inserts a record in his list I want that automatically a POST with the new record is sent to the server, it verifies the model and the authorization and inserts the record into the database. Then the server notifies the other clients about the change using websockets. The other clients see the new data record in their array without having to write a single manual HTTP call or websocket connection.
- Open Source Only. No Firebase or similar.
I've been searching for a while, but haven't found anything that seems reasonable. If I don't find anything I will write a small framework myself. I apologize if I seem lazy and don't want to search myself, but I'm really getting desperate. I want to spend as little time as possible on writing boilerplate and instead write business logic. There are thousands of javascript frameworks out there but none of them seem to handle these simple standard cases very well. They all require manual implementation of CRUD for each model or manual data fetching and subscription. Please make suggestions for frameworks and help me to see through the framework jungle!
- ActiveRecord is wonderful for data schemas: https://guides.rubyonrails.org/active_record_migrations.html
- ActiveRecord form validations is excellent and defined only on the model
- Scaffolds automatically generate create/read/update/delete endpoints: https://guides.rubyonrails.org/v3.2/getting_started.html#get...
- Websocket-driven updates provided by Hotwire / Turbo Streams: https://turbo.hotwired.dev/handbook/introduction
- Authorization and Authentication by Devise: https://github.com/heartcombo/devise
HAML is wonderful as a templating language as well.
The realtime aspect of what you are looking for is the hard part. The only options I know of are the remix stack above (you still have to do some extra plumbing), elixir/Phoenix (or other turbo links like options but most aren't fast enough). To do realtime updates natively you need to move to evented data front to back and that is a very big move away from models the way we normally think of them. Check out eventide or resolv.js.
Phoenix specifically doesn't work like turbolinks. LiveVIew in Phoenix uses a websocket to transport data, morphdom to patch the dom, and a light process on the server to manage state. It's as fast as the internet connection for insertions into a list. In fact it is quite capable of parallel data loading just like remix, and the server can work share in parallel across as many cores as you have available on the server.
Remix makes things that were simple hard (apparently with the goal of doing _everything_ on the server again).
https://create.t3.gg/
https://github.com/t3-oss/create-t3-app
I hadn't touched much webdev for a few years, the ecosystem / build tooling has gotten a LOT better. It's back to being fun and painless to spin up a new webapp.
Frontend:
Backend: Infrastructure + deployments:https://stacktape.com(disclaimer: I'm a founder)
Reactivity is not an issue anymore with the HOTWIRE stack in rails or there's the even better StimulusReflex gem that you can use for reactivity and realtime features.
Dead Comment
It's far from production ready, but it's already working reasonably well.
I tried HotWire but it didn't feel right to me because I'm used to React.
Is there a specific reason that you need to have an SPA framework?
Do NOT make your own framework, that is a doom loop of death. Lots of smart (and not smart) people have created frameworks for you..... focus on productivity only.
What you're describing sounds very nice though.
I've often wanted a VB6 equivalent for the web, but open source.
That's Gambas, it can create web apps.
https://gambas.sourceforge.net
Some more links here:
https://github.com/wekan/hx/tree/main/prototypes/ui/gambas
https://anvil.works/
open source.
https://anvil.works/open-source
i should be a paid for how much i recommend looking at them, but i've never used it for anything production.
For anyone looking, here's installing via pip: https://github.com/anvil-works/anvil-runtime#using-the-stand...
The code is GNU AFFERO GENERAL PUBLIC LICENSE Version 3.