Enterprise Headless Architecture
The Loomix Commerce platform is built on a high-performance Headless Decoupled architecture. This decoupled design provides maximum scalability, enterprise security, lightning speed, and complete separation of concerns between frontend presentation and backend services.
1. Frontend (Next.js 16 App Router)
Shopper user interface with React Server Components, multilingual i18n, dynamic rendering of Loomix Blocks, and instant caching with Revalidation.
2. E-Commerce Engine (Medusa v2)
Management of product catalogs, variants, regional pricing, carts, order registration workflows, SMS OTP, and local shipping.
3. Content Management (Strapi CMS)
Management of page layouts, banners, blogs, footer/header menus, product option translations, and real-time webhook systems.
4. Loomix Blocks Ecosystem
Pre-designed visual blocks synced from the Loomix Registry via Strapi Admin Storefront UI and GitHub CI/CD, dynamically rendered by BlockRenderer.
Data Fetching and Rendering Flow in Next.js
- Fetch main page layout and dynamic blocks from Strapi CMS
- Fetch regional prices and catalog from Medusa 2.0 Engine
- Query Meilisearch directly for filters and colors
- Dynamic rendering of Strapi blocks to Loomix Blocks components
const homepageData = await getHomepageData();const region = await getRegion(countryCode);const searchResults = await queryMeilisearch({ color: "Red", price_range: [10, 50] }); return ( <main> {homepageData.blocks.map((block, index) => ( <BlockRenderer key={block.id} block={block} region={region} countryCode={countryCode} /> ))} </main>);Token Network and Environment Variables Security (.env)
# Public Service URLsSTOREFRONT_PUBLIC_URL=https://yourdomain.comSTRAPI_PUBLIC_URL=https://cms.yourdomain.comMEDUSA_BACKEND_PUBLIC_URL=https://api.yourdomain.com # Strapi CMS Access TokensSTRAPI_API_TOKEN_FOR_MEDUSA=your_strapi_full_access_tokenSTRAPI_API_TOKEN_FOR_FRONT=your_strapi_read_only_token # Medusa & Search Public KeysMEDUSA_PUBLISHABLE_KEY=pk_your_medusa_publishable_keyMEILI_SEARCH_KEY=your_meilisearch_search_api_key # Email (SMTP) and SMS ServicesSMTP_HOST=smtp.gmail.comSMTP_PORT=587SMTP_USER=your-email@gmail.comSMTP_PASS=your-app-passwordSMTP_FROM_ADDRESS=noreply@yourdomain.comSMS_API_KEY=your_sms_api_key