Crema React
v-4 nx
v-4 nx
  • About Crema Nx
  • Overview
    • Crema Overview
    • Dependency Graph
    • Folder Structure
      • apps
        • source
        • source-e2e
      • libs
        • components
        • constants
        • context
        • helpers
        • hooks
        • mockapi
        • modules
        • services
    • Package.json
      • MUI+CRA
      • MUI+Next.js
      • MUI+CRA+TS
      • MUI+Next.js+TS
      • Antd+CRA
      • Antd+Next.js
      • Antd+CRA+TS
      • Antd+Next.js+TS
    • GitHub Access
    • Slack Community
    • Figma File
  • Decelopment
    • Installation
    • Route Management
    • Auth User
    • Authentication Methods
    • API Calls
    • Multilingual
  • MUI
    • Theme Color
    • Sidebar Configuration
    • Navigation Style
    • Footer Configuration
    • Template Direction
    • Template Mode
  • FAQ
  • ANTD
    • About Crema Ant
    • Style Framework
  • Crema V-3 Doc
  • Servers
    • Python
    • Laravel
    • Mongoose
  • Credits
Powered by GitBook
On this page

Was this helpful?

  1. Overview

Folder Structure

Crema has a vast and professional folder structure

Last updated 2 years ago

Was this helpful?

The folder structure is professional and easy to understand. A typical Nx workspace is structured into "apps" and "libs". This distinction allows us to have a more modular architecture by following a separation of concerns methodology, incentivizing the organization of our source code and logic into smaller, more focused, highly cohesive units. Nx automatically creates TypeScript path mappings in the tsconfig.base.json file, such that other apps or libs can easily consume them like below.

// Example of importing from the library
import AppLoader from '@crema/components/AppLoader';
...

Therefore, consuming libraries is very straightforward, and similar to what you might already be accustomed to in previous projects.

In Crema-4.x.x all apps will go into the apps directory. You will the starter template to start your project. You will get a minimum of four apps by default in Crema-4.x for each variant as follows.

  1. source: app based on the context API

  2. source-redux: app based on the Redux

  3. source-toolkit: app based on the redux-toolkit

  4. starter-kit: starter-kit based on the context API

You can remove the extra dependency of the project that not belongs to your project after the development is done.

A common mental model is to see the application as "containers" that link, bundle and compile functionality implemented in libraries for being deployed. As such, if we follow an 80/20 approach:

  • place 80% of your logic into the libs/ folder

  • and 20% into apps/

    Crema is using an advanced folder structure like below

Crema Folder Structure