- let hof manage the data model and repeatitive code
- focus on the core features of your app
- define a core data model and configuration
- generate the majority of boilerplate, helpers, and extras
- extend or customize the logic, interfaces, and integrations
- evolve the data model and code, updates are automated
As you develop your data model and application, edit any part and hof will make sure the right thing happens.
[insert screencast]
Various self & saas providers are possible for core application features like auth, user management, chat, email, billing, deployment, and devops.
Supabase will be installed with your project development dependencies
# create a new directory
mkdir myapp && cd myapp
# create a new application from supacode
hof create github.com/hofstadter-io/supacode myapp
This will walk you through the process of creating a new supacode application. When done, you should have a running application.
Now that you have your base application, you can start developing your core features.
hof flow @dev
Running this command starts up development mode.
- supabase containers are started
- application hot-reload mode is started
- hof code gen hot-reload mode is started
Now, as you edit files in any part of the stack, the appropriate recompilation and live update will happen. There is a hot-reload stack, such that:
- hof -> code: Changes to the data model trigger hof code regen
- code -> app: Changes to the code trigger app recompilation
When developing with hof, you work from both sides of the code generation.
(inputs) edit the data model and supacode configuration
vvv
[codegen] hof (hot reload)
vvv
(output) edit code details or writing any custom code
vvv
[running] npx (hot reload)
When you change either the code gen inputs or outputs, hof will ensure the correct steps are taken to update your application code, the running server, and connected clients.
Your core data model is the source-of-truth definition for the entities, objects, and relations in your application. As you update this, hof will regenerate the code, the application will see updates and hot-reload itself.
You can modify and extend the generated code. When you again edit the data model, your changes will be automatically merged with the new generated code. You can also add any extra files you like.
You can use generated and custom code in both directions:
- gen -> custom: use helpers and libraries for your datamodel
- custom -> gen: use custom code to fill in the implementation
supacode has many good defaults for CRUD operations based on your data model. As you update, these handlers will update along with the various integrations, like auth and other features, which you configure as part of supacode's inputs