Explore Sencha’s comprehensive library of developer resources, featuring best practices, expert guides, and the latest updates on JavaScript, Java, and React frameworks.
Act as a Principal Ext JS Architect. I want you to build a basic CRM single-page application prototype using Sencha Ext JS 8.0 Modern Toolkit, styled with a theme inspired by Microsoft Fluent Design 2.
### PROJECT SETUP & TOOLING INSTRUCTIONS
1. Initialize the project using Sencha Open Tooling via `@sencha/ext-gen`:
Run: `npx @sencha/ext-gen app -t modern-desktop -n CrmApp` (or the appropriate modern template).
2. Configure the project to support **Multi-Profile** layout rules (Desktop and Phone profiles) using `Ext.Viewport` / profile configurations.
3. Ensure no backend dependency exists: mock all CRM data locally inside local `Ext.data.Store` instances with inline `data` arrays or mock memory proxies.
### ARCHITECTURAL & LAYOUT BEST PRACTICES (STRICT)
- **Flat Layout Tree:** Never wrap a component inside an unnecessary `Ext.Container` or `Ext.Panel` unless it explicitly adds required layout behavior, toolbars, or visual frames.
- **Modern Flexbox Mechanics:** Take full advantage of Modern Toolkit's native CSS Flexbox layout (`layout: 'vbox'`, `layout: 'hbox'`, `flex` configurations) rather than fixed pixel dimensions where possible.
- **Fluent Design 2 Styling:** Apply custom SCSS/CSS variables to achieve Fluent Design 2 characteristics: clear elevation shadows, soft neutral backgrounds (`#F5F5F5`), subtle borders, modern typography, rounded corners (`border-radius: 6px` to `8px`), and Microsoft-style primary accent colors (e.g., `#0078D4`).
### APPLICATION STRUCTURE & MAIN VIEWPORT
Create a main viewport containing:
1. **Top Toolbar :**
- Application logo & Title ("Enterprise CRM").
- Quick search input field (`Ext.field.Search`).
- Right-aligned profile avatar, notifications button, and a dark/light mode toggle.
2. **Navigation Area **
- Left-aligned collateral drawer menu with icons.
- Navigation routes/items: **Dashboard**, **Contacts / Leads**, **Deals Pipeline**, and **Analytics**.
3. **Main Content Area (`card` layout):**
- Dynamically switches views based on navigation selection.
### REQUIRED FEATURES & VIEWS
#### 1. Executive Dashboard View (`layout: 'vbox'` or dynamic grid layout)
- **KPI Summary Cards:** A top row using `hbox` layout displaying 4 key metrics (Total Revenue, Active Leads, Conversion Rate, Deals Closed) with crisp Fluent design card containers.
- **Ext JS Native Charts (`Ext.chart.Cartesian` / `Ext.chart.Polar`):**
- **Sales Pipeline Chart:** Bar or Area chart showing deals progression by stage.
- **Lead Sources Chart:** Pie or Donut chart displaying lead origins (Organic, Referral, Direct, Paid).
- **Recent Activities Grid (`Ext.grid.Grid`):** Modern grid showing recent sales interactions with custom column renderers for statuses (colored badges).
#### 2. Contacts & Deals Views
- High-performance `Ext.grid.Grid` featuring sorting, filtering, and item selection.
- Detail drawer / slide-out panel when a row is selected.
### RESPONSIVE & MULTI-PROFILE BEHAVIOR
- Define `responsiveConfig` rules or profile switches:
- **Desktop (`width >= 800`):** Persistent left navigation drawer, side-by-side KPI cards and charts in `hbox`.
- **Phone (`width < 800`):** Collapsible modal navigation drawer, stacked KPI cards and charts in `vbox`, optimized mobile grid columns.
### DELIVERABLES EXPECTED
1. Step-by-step CLI commands to initialize and run the app with `npm start`.
2. Full source code structure (`app/desktop/src/`, `app/shared/src/`, etc.).
3. Clean, production-ready Ext JS Modern 8.0 code for Viewport, Stores, Models, Controllers (`ViewController`), and Custom SCSS for the Fluent Design 2 theme.
Please start by setting up the project structure and generating the main files!