Skip to content

Consistent Project Structure

Web App Solution, Inc edited this page Apr 5, 2017 · 7 revisions

Back to Wiki Home

Directory Layout

Consistent and thoughtful project structure is essential to all projects. The code we develop will live on past our time on the project and the more clearly and consistently a project is structured the more readily the owners of the project can bring the next developers in and get up to speed. Simple is good and using familiar patterns should be encouraged.

Sencha suggests following a unified directory structure that is the same for every app. Although not mandatory, the suggestions should be considered as best-practice guidelines to keep your application well organized, extensible and maintainable. Check out the Getting Started Guide for a detailed explanation on the suggestions for basic file structure. Here is the structure for our FlowMVC app:

build/                             --> debuggable and production versions of FlowMVC generated from ant build
docs/                              --> output folder for JSDuck generated documentation
src/FlowMVC/                       --> contains flow source code

    logger/                        --> contains logger
    mvc/                           --> base and abstract classes
         controller/               --> application service controllers
         event/                    --> application-level events used with event bus
         mediator/                 --> view mediators that fulfill the passive view pattern
         service/                  --> concrete and mock data service implementations
              mock/                
              rpc/
         store/                    --> data stores containing lists of models
    util/                          --> utility classes

test/FlowMVC/                      --> unit tests and supporting classes
         mvc/
              event/               
              model/
              store/
         util/
test/
     lib/                          --> contains all 3rd party libraries for unit tests
          deft-08.8/               --> the current [DeftJS](https://github.com/deftjs/) library
          jasmine-1.3.1/           --> the current [Jasmine](http://pivotal.github.com/jasmine/) unit testing library
          
     spec-runner.html              --> the launch file for the unit tests

build.properties                   --> build properties file for Ant
build.xml                          --> build file for Ant
LICENSE                            --> FlowMVC license file
README.md                          --> project readme file