In Rails there are individual generator commands for every part of our MVC app, like rails g model, rails g controller etc. And devs tends to recommend these commands instead of full-fleged rails g scaffold command. They said, never use scaffold for “real” app.
And here, in Phoenix… There’s only one generator command for HTML based app, which is phoenix.gen.html. Correct me if I’m wrong, but I didn’t see any other individual generator for this purpose.
So, it’s that okay I use this one-for-all command for “real” app? Or should I just ignore this command completely and write everything manually?
I may be misquoting someone by proxy here, but I remember someone saying that @chrismccord , at least, saw the generators as teaching tools for people mostly.
Adding some cents to it: a very unknown feature is the ability to override the templates for the generated models, views, controllers and templates. Which you can use at your favor, without the need to build your own generator.
If you look a little bit on the original phoenix generator code, you’ll find that phoenix generator looks up first for your app “priv/templates/phoenix.gen.html” directory to get the templates, and if it does not exist, it looks to their own. You can get the default generated code on the same directory in the phoenix project.
Sorry, looking to my answer, it really seemed like a very difficult thing to do. What I was saying is that, you can create a file priv/templates/phoenix.gen.html/controller.ex and this file will be used to generate the controller in the task mix phoenix.gen.html.
You can see the files in this folder for an example of which templates you can edit this way.
I`m fairly new to elixir myself(2-3 months or so). I have 6 tiny apps in production at the moment. All of them have either used the phoenix scaffolding or Ex_admin.
a small ordering system for a diner. so that the chefs can just work and make sure food goes to the right table every time
Inventory system for a self serve tire warehouse
small planning system for farms. never forget when that cow need a medical checkup etc
Economics software for non profit organisations and sports teams
maintenance scheduler for a workshop with options of telling you when you need to reorder supplies
Logistics management system. I guess this one cant be called tiny anymore. Handles packaging and shipment of crates and everything around that.
All of them are deployed on local machines. the ordering system and logistics app will be combined into one app for food delivery services soon so i guess that would be the seventh.