Skip to main content

Project structure

A quick overview of the structure of the application that generates by tramvai new command. At the same time, we support both monorepositories and repositories with one application. Repository type, package manager and testing framework settings are selected when the command new executed.

We recommend follow feature-sliced methodology guidlines to structure application code.

Repository type​

Multirepo​

The repository structure is designed for one application

root-directory
β”œβ”€β”€ tramvai.json - project configuration for `@tramvai/cli`
β”œβ”€β”€ env.development.js - environment variables used for local builds of the project
└── src - application code directory
└── App block

Monorepo​

The repository structure is designed for the presence of several applications, and separate shared libraries

root-directory
β”œβ”€β”€ tramvai.json - project configuration for `@tramvai/cli`
β”œβ”€β”€ env.development.js - environment variables used for local builds of the project
β”œβ”€β”€ apps - directory with applications
β”‚ β”œβ”€β”€ App block
β”‚ β”œβ”€β”€ App block
└── packages - a directory with various libraries / modules that will be shared between applications
β”œβ”€β”€ Lib block
└── Lib block

Blocks​

Application​

app-directory
β”œβ”€β”€ index.ts - application entry point, where all tramvai modules are connected
β”œβ”€β”€ polyfill.ts - polyfills used by the application (absent by default)
β”œβ”€β”€ postcss.js - postcss configuration object
β”œβ”€β”€ shared - reused modules of the application
└── routes - application pages

The following links provide detailed definitions of terms bundle, module and a description of the settings tramvai.json