How to structure an Elm project?
Last updated
Was this helpful?
Last updated
Was this helpful?
The answer to this question can be found in the . This question will therefore be removed at some time in the future.
How should I structure my Elm project?
Use the following file structure:
Main.elm - Contains the main code
Data.elm - Contains utility functions for types (like constants)
Data/.. - Contains types. Group them logically, for example User
and UserForm
into Data/User.elm
.
View.elm - Contains utility functions for views (like view specific constants and very general function.)
View/.. - Contains different Views. Sometimes a type has different views. A login page might have a special view for a wrong login.
Page.elm - Contains utility functions for pages. For page-transitions its handy to store the different models in here.
Page/.. - Contains a Model/View/Update for every page.
.. - in the same style you can add your project specific folders like a separate folder for validation.
📄Article:
👥Thread:
📄Article: Tour of an by Richard Feldman
🎥Video: by Evan Czaplicki