The main projects used are Angularjs, Bootstrap, Socket.io, Express, MongoDB
The main process of the project is that the page is accessed through the ANGULARJS service to the background, and Express is only responsible for background data processing. Personal feeling is the equivalent of Mvc+webapi way.
The project has been completed for several months, then did not immediately finishing, resulting in a lot of details are forgotten, so this decision to re-organize again, deepen the impression.
Here is the file structure of the project:
From top to bottom, explain:
The app folder contains all the files used in the front end, including:
Some HTML templates used by the COMPONENTS:ANGULARJS directive.
JS: All JS files are placed in this directory, including Controlle,service,filters and so on.
Ngmodules: The front end with some plug-ins, including sockets, Ui-router, Iscroll and so on.
Resource: all static resource files.
Views: HTML pages in the project.
There is only one www file in the bin folder, this file is used to start the project and is the main entry for the project.
The database file is stored in the data file.
There is only one live_server.js file in the Lib folder, which is used to listen for and process the socket request and process it on the server.
Models: This folder is the entity that is mapped to the MongoDB database table, the project uses the Mongoose operation database, so it is also the entity that Mongoose uses.
Node_modules: In this folder are some of the necessary modules in the project. Generally in the Package.json to configure the use of the module, directly run the command can be installed into this directory.
Public:express Framework generated folder, which put a static file, because the previous paragraph using Angularjs, so this folder is not useful for the time being.
Routers: This file is a routing file, and in this project, these files are the interfaces that the previous segment accesses. Used to provide the required data.
Views: The frame generated folder, which is placed in the foreground page, because the previous paragraph using Angularjs, so this folder is not useful.
App.js: When starting a project, this file will be called in the WWW file, where the project reference module, static resource path, routing, middleware, and so on are configured.
Text Live platform-project structure