Answer the question
In order to leave comments, you need to log in
How to make structure in meteor js mvc?
Just started to deal with Meteor Js. Advise how to organize mvc structure?
Answer the question
In order to leave comments, you need to log in
I will not be able to advise how to implement classic MVC, but I can recommend using examples of ready-made applications to organize your own structure.
For example, Microscope tutorial application https://github.com/DiscoverMeteor/Microscope
, as well as Telescope https://github.com/SachaG/Telescope
+ see examples of package implementations at atmosphere.meteor.com
I personally have the following structure:
1 ) I divide the whole application into many packages.
Each package is either
a) Library package.
Any functionality that is self-sufficient and designed for multiple use in various applications.
Example - most packages from atmosphere.meteor.com
b) package-module.
I divide all the functionality into modules.
For example: blog, personal account, profile, admin panel, etc., etc.
All of them are dependent on one base module "core" and use or inherit some of its functionality.
c) main application.
It is a kind of glue for packages.
Connects the necessary ones, configures them, and so on.
If we consider the application from the point of view of mvc, then from my structure, it is necessary to tell more about the "package-module".
Such a package includes everything that is necessary for its operation: routes, collections, libraries, templates, helpers, and so on.
The package itself is almost self-sufficient and can only pull some dependencies from other packages.
Thus, such a package can be used in different applications without any special settings, etc.
The basic structure of a module package is:
module
|
- router (Controller)
|- contollers
|_ subscribers
|- filters
|- hooks
_ libs (Model)
|-collections
|-methods
|- helpers
|-libs
|- publications
_ views
|- templates
|-helpers
|-events
|- etc
If necessary, I can tell you more about any of the layers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question