Skip to main content

Angular App Architecture

The sources in the app can be organised like this:

Angular App Architecture

1. src folder

The src folder contains all the project's source files.

FolderContent
appapplication sources
assetsembedded resources (images, fonts, icons etc.)
environmentsenvironment based configuration files (dev, prod)

2. app folder

The app folder is decomposed in different modules according to their respective responsibilities.

FolderContent
.AppModule
AppRoutingModule
AppComponent
coreCommon services instantiated once at the start of the application. Loading of essential functionnalities required by all the application (e.g: Authentification)
page moduleA module defined for a specific page
uiReusable modules for pure presentational components (e.g: dumb components)

3. page module folders

Each custom module created should match a business functionnality. The content of a page module is a coherent set of components.

FolderContent
componentsComponents used inside this module. Contains both presentation (dumb) and business-oriented containers (smart) components
pagesPage using the components of the module
sharedshared elements in the module or re-exported (pipes, directives, services)