You need index.html page like below
<html>
<body>
<div id="header"><!-- something cool here --></div>
<div id="login" class="view"> ... </div>
<div id="home" class="view" style="display:none;"> ... </div>
<div id="page3" class="view" style="display:none;"> ... </div>
<div id="page4" class="view" style="display:none;"> ... </div>
<div id="footer"><!-- something cool here --></div>
</body>
</html>
When application loaded, all views (divs with view class) are hidden (display:none) except login view. Login view should have login form on it, when it submitted by user it initiates ajax request. When ajax successful application hides login page and displays home page instead.
You may structure your code next way. For every module you will have model, view and controller files.
For example, for login module you may have loginModel.js, loginView.js, loginCtrl.js. In model file you will connect to DB and check credentials provided. In view you will bind listeners to controls. In controller you will react to user pressed Submit button.