K
K
k-22016-04-19 15:19:31
JavaScript
k-2, 2016-04-19 15:19:31

How to create an architecture in js?

Help create a common js application architecture.
For example, I need to create an online store.
It will have:
1. login (displayed on all pages)
2. search with options
3. product
page 4. search page
5. text pages (home, about us, etc..)
Tell me how I can start creating js application architecture - I'm interested in the code itself - where to start, what to use (what technologies).
I understand that there should be a router and modules. modules should be responsible for their action (one module is login, another is search, third is ajax, etc...) . And the modules should only be connected through the router or the kernel and should not know about each other.
I can not combine all the information into one whole.
PS:
I'll add the following code to the question
(function() {
window.sample = {}; // The main application object
sample.routers = {}; // An object containing controllers to provide
// transitions between sections of the application.
sample.models = {}; // An object for storing models with data
sample.ui = {}; // An object containing controllers responsible for
// building application interfaces and their behavior.
sample.core = {state: null}; // The core of our Applications
// contains an object that is a "sandbox".
sample.modules = {}; // Object containing controllers of other
// system modules
})();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2016-04-19
@K-2

Use
the emberjs.com
framework or
https://angularjs.org/
They will solve all your questions about routers, modules and other things for you.

O
Oleg Lustenko, 2016-04-19
@fakey0u

How to name folders and where to store modules? about this question?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question