@clidey/dory 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +4 -0
- package/.github/ISSUE_TEMPLATE/anything-else.md +10 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +39 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/claude.yml +37 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/CONTRIBUTING.md +91 -0
- package/LICENSE +201 -0
- package/README.md +185 -0
- package/SECURITY.md +11 -0
- package/assets/dory_logo.png +0 -0
- package/bin/dory.js +131 -0
- package/docs/README.md +2 -0
- package/docs/configuration/app-settings/feature-flags.mdx +157 -0
- package/docs/configuration/app-settings/user-settings.mdx +201 -0
- package/docs/configuration/installation-setup/env-vars.mdx +198 -0
- package/docs/configuration/installation-setup/installation.mdx +127 -0
- package/docs/dory.json +162 -0
- package/docs/integrations/analytics-monitoring/error-tracking.mdx +199 -0
- package/docs/integrations/analytics-monitoring/notifications.mdx +189 -0
- package/docs/integrations/analytics-monitoring/user-analytics.mdx +182 -0
- package/docs/integrations/shopify-integration/shopify-setup.mdx +226 -0
- package/docs/integrations/shopify-integration/shopify-webhooks.mdx +207 -0
- package/docs/overview/developer-overview/dev-architecture.mdx +292 -0
- package/docs/overview/product-intro/app-overview.mdx +167 -0
- package/docs/overview/product-intro/architecture.mdx +203 -0
- package/docs/overview/product-intro/core-concepts.mdx +267 -0
- package/docs/platform-admin/billing-subscriptions/billing.mdx +176 -0
- package/docs/platform-admin/system-maintenance/db-migrations.mdx +184 -0
- package/docs/platform-admin/system-maintenance/health-monitoring.mdx +222 -0
- package/docs/platform-admin/system-maintenance/queue-management.mdx +234 -0
- package/docs/platform-admin/user-team-management/teams.mdx +170 -0
- package/docs/platform-admin/user-team-management/users.mdx +185 -0
- package/docs/support/legal/dependency-analysis.mdx +132 -0
- package/docs/support/legal/privacy-terms.mdx +73 -0
- package/docs/support/troubleshooting/common-issues.mdx +159 -0
- package/docs/usage/api-usage/api-inventory.mdx +213 -0
- package/docs/usage/api-usage/api-products.mdx +249 -0
- package/docs/usage/api-usage/api-purchase-orders.mdx +289 -0
- package/docs/usage/api-usage/api-reports.mdx +227 -0
- package/docs/usage/api-usage/api-suppliers.mdx +171 -0
- package/docs/usage/api-usage/api-user-management.mdx +171 -0
- package/docs/usage/ui-workflows/bundles.mdx +157 -0
- package/docs/usage/ui-workflows/demand-planning.mdx +210 -0
- package/docs/usage/ui-workflows/favorites.mdx +167 -0
- package/docs/usage/ui-workflows/inventory-management.mdx +179 -0
- package/docs/usage/ui-workflows/onboarding.mdx +215 -0
- package/docs/usage/ui-workflows/purchase-orders.mdx +200 -0
- package/docs/usage/ui-workflows/reports.mdx +257 -0
- package/index.html +54 -0
- package/k8s/Dockerfile +15 -0
- package/k8s/config/nginx-default.conf +22 -0
- package/k8s/dev.Dockerfile +16 -0
- package/package.json +71 -0
- package/src/app.css +3 -0
- package/src/app.tsx +13 -0
- package/src/components/dark-mode-toggle.tsx +25 -0
- package/src/components/dropdown.tsx +49 -0
- package/src/components/hooks.tsx +28 -0
- package/src/components/loading.tsx +23 -0
- package/src/components/mdx-provider.tsx +13 -0
- package/src/components/navigation.tsx +53 -0
- package/src/components/notification.tsx +97 -0
- package/src/components/routes.tsx +89 -0
- package/src/components/search-index.ts +43 -0
- package/src/components/search.tsx +508 -0
- package/src/components/store.ts +144 -0
- package/src/index.css +24 -0
- package/src/main.tsx +18 -0
- package/src/mdx/accordion.tsx +48 -0
- package/src/mdx/api-playground.tsx +674 -0
- package/src/mdx/api.tsx +354 -0
- package/src/mdx/callout.tsx +80 -0
- package/src/mdx/card.tsx +48 -0
- package/src/mdx/code.tsx +289 -0
- package/src/mdx/expandable.tsx +40 -0
- package/src/mdx/fence.tsx +73 -0
- package/src/mdx/icon.tsx +73 -0
- package/src/mdx/latex.tsx +26 -0
- package/src/mdx/list.tsx +7 -0
- package/src/mdx/mdx.tsx +43 -0
- package/src/mdx/mermaid.tsx +102 -0
- package/src/mdx/open-api.tsx +325 -0
- package/src/mdx/source.tsx +47 -0
- package/src/mdx/step.tsx +49 -0
- package/src/mdx/table.tsx +15 -0
- package/src/mdx/tag.tsx +66 -0
- package/src/mdx/text.tsx +98 -0
- package/src/plugins/sanitize.ts +15 -0
- package/src/theme.scss +124 -0
- package/src/ui/header.tsx +88 -0
- package/src/ui/layout.tsx +167 -0
- package/src/ui/mobile-navigation.tsx +91 -0
- package/src/ui/prev-next-link.tsx +74 -0
- package/src/ui/table-of-content.tsx +166 -0
- package/src/utils/fonts.ts +20 -0
- package/src/utils/functions.ts +12 -0
- package/src/utils/hooks.ts +46 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.app.json +32 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +25 -0
- package/vite.config.ts +27 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Environment Variables & Configuration'
|
|
3
|
+
description: 'Details of required environment variables, example values, and configuration across dev, staging, and prod.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Environment Variables & Configuration
|
|
7
|
+
|
|
8
|
+
## Purpose and Scope
|
|
9
|
+
|
|
10
|
+
This document provides a detailed technical overview of the environment variables and configuration management within the Genie application, specifically focusing on how team, shop, and general settings are handled. It covers the backend service responsible for settings management, the structure of configuration data, integration points with external services (notably Shopify), and the interaction with frontend components for settings updates.
|
|
11
|
+
|
|
12
|
+
The scope is limited to the environment and configuration aspects related to team settings, insights, shop configurations, and business details within the Genie platform. It clarifies the flow and storage of configuration data, including environment-dependent settings like time zone and currency.
|
|
13
|
+
|
|
14
|
+
## Technical Overview
|
|
15
|
+
|
|
16
|
+
The SettingsService in the backend manages the core configuration and environment-specific settings at the team level. It acts as the interface to stored data for team general settings, insights settings, and shop settings, primarily through the `TeamEntity` persisted in the database.
|
|
17
|
+
|
|
18
|
+
### System Boundaries and Architecture
|
|
19
|
+
|
|
20
|
+
- **Backend:** The `SettingsService` uses TypeORM repository to read and update the `TeamEntity` database representation.
|
|
21
|
+
- **Frontend:** React-based web UI components fetch and mutate settings by invoking API endpoints which under the hood use `SettingsService`.
|
|
22
|
+
- **External API Integration:** Shopify data such as shop currency and time zone are imported into the team settings and validated.
|
|
23
|
+
|
|
24
|
+
### Key Technologies and Patterns
|
|
25
|
+
|
|
26
|
+
- **NestJS** with the `@Injectable()` pattern for service injection.
|
|
27
|
+
- **TypeORM** to interface with PostgreSQL or relational DB for `TeamEntity` storage.
|
|
28
|
+
- **Data Transfer Objects (DTOs)** encapsulate settings data structures for transmission between layers.
|
|
29
|
+
- **React Query** in the frontend for data fetching and mutation.
|
|
30
|
+
|
|
31
|
+
### Configuration Data Flow
|
|
32
|
+
|
|
33
|
+
1. Shopify data (currency, time zone) imported via webhooks or manual sync.
|
|
34
|
+
2. Stored persistently in the `TeamEntity` fields (`currency`, `timeZone`).
|
|
35
|
+
3. General team business settings stored as JSON in `generalSettings` in the same entity.
|
|
36
|
+
4. Insights settings regarding inventory grading, sales periods, etc., stored via dedicated columns.
|
|
37
|
+
5. Frontend reads/writes through APIs that delegate to `SettingsService` methods.
|
|
38
|
+
|
|
39
|
+
```mermaid
|
|
40
|
+
flowchart TD
|
|
41
|
+
subgraph Backend
|
|
42
|
+
SS["SettingsService"]:::service
|
|
43
|
+
TE["TeamEntity (DB Model)"]:::database
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
subgraph Frontend
|
|
47
|
+
GU["GeneralSettings UI Component"]:::frontend
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
subgraph Shopify
|
|
51
|
+
SH["Shopify API / Webhook"]:::external
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
GU -->|"API calls for get/update settings"| SS
|
|
55
|
+
SS -->|"Read/Write settings"| TE
|
|
56
|
+
SH -->|"Push shop data (currency/timezone)"| SS
|
|
57
|
+
|
|
58
|
+
classDef service fill:#1976d2,color:#fff,stroke:#0b3d91,stroke-width:1px;
|
|
59
|
+
classDef database fill:#795548,color:#fff,stroke:#5d4037,stroke-width:1px;
|
|
60
|
+
classDef frontend fill:#388e3c,color:#fff,stroke:#2e7d32,stroke-width:1px;
|
|
61
|
+
classDef external fill:#fbc02d,color:#000,stroke:#f9a825,stroke-width:1px;
|
|
62
|
+
|
|
63
|
+
click SS "apps/api/src/user-management/services/settings.service.ts"
|
|
64
|
+
click TE "apps/api/src/user-management/entities/team.entity.ts"
|
|
65
|
+
click GU "apps/web/src/components/pages/settings/general-settings.tsx"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Core Concepts and Responsibilities
|
|
69
|
+
|
|
70
|
+
### Team Settings
|
|
71
|
+
|
|
72
|
+
- Represented primarily by `TeamEntity`.
|
|
73
|
+
- Contains both simple scalar settings (e.g., `name`, `currency`, `timeZone`) and complex JSON blobs (e.g., `generalSettings`, `stockLevelsSettings`).
|
|
74
|
+
- Manages onboarding, enabled state, and disables reasons.
|
|
75
|
+
|
|
76
|
+
### Insights Settings
|
|
77
|
+
|
|
78
|
+
- Includes inventory grading strategy and threshold levels.
|
|
79
|
+
- Important validation: `InventoryItemGradingStrategy.SalesFrequency` is explicitly unsupported and raises exceptions.
|
|
80
|
+
|
|
81
|
+
### Shopify Integration
|
|
82
|
+
|
|
83
|
+
- The Shopify shop data (e.g., currency, time zone) is imported and validated. Time zone validation is done via `isValidTimeZone`.
|
|
84
|
+
- Defaults to `Etc/UTC` if invalid or missing.
|
|
85
|
+
|
|
86
|
+
### Error Handling
|
|
87
|
+
|
|
88
|
+
- Uses `GenieException` to encapsulate errors with context, such as team ID or invalid states.
|
|
89
|
+
|
|
90
|
+
### Ownership
|
|
91
|
+
|
|
92
|
+
- Maintained by the user management backend module.
|
|
93
|
+
- Settings changes propagate via API and frontend UI.
|
|
94
|
+
|
|
95
|
+
### Non-functional Requirements
|
|
96
|
+
|
|
97
|
+
- Time zone and currency are critical for correct operation and must always be valid.
|
|
98
|
+
- The system must guard against unsupported grading strategies.
|
|
99
|
+
- Updates must be atomic and error-resilient.
|
|
100
|
+
|
|
101
|
+
## Code Structure
|
|
102
|
+
|
|
103
|
+
| File/Folder | Role Description |
|
|
104
|
+
|---------------------------------|--------------------------------------------------------|
|
|
105
|
+
| `apps/api/src/user-management/services/settings.service.ts` | Core backend logic for loading and updating team settings. |
|
|
106
|
+
| `apps/api/src/user-management/entities/team.entity.ts` | Database entity modeling the team configuration persistently. |
|
|
107
|
+
| `apps/web/src/components/pages/settings/general-settings.tsx` | Frontend UI component for managing general team and shop settings. |
|
|
108
|
+
| `apps/web/src/api/resources/settings` | API layer exports for settings-related calls. |
|
|
109
|
+
|
|
110
|
+
### Key Code Snippet from `SettingsService`
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
async updateTeamGeneralSettings(teamId: string, settings: TeamGeneralSettingsDto) {
|
|
114
|
+
const { businessName: name, ...generalSettings } = settings;
|
|
115
|
+
try {
|
|
116
|
+
await this.teamRepository.update(teamId, {
|
|
117
|
+
name,
|
|
118
|
+
generalSettings,
|
|
119
|
+
});
|
|
120
|
+
} catch (error) {
|
|
121
|
+
throw new GenieException("Failed to update team general settings", {
|
|
122
|
+
error,
|
|
123
|
+
teamId,
|
|
124
|
+
settings,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This method extracts the business name to the `name` column and stores other general settings in the JSON field `generalSettings`.
|
|
131
|
+
|
|
132
|
+
## API and Interfaces
|
|
133
|
+
|
|
134
|
+
### Key Methods in `SettingsService`
|
|
135
|
+
|
|
136
|
+
| Method | Description | Input | Output |
|
|
137
|
+
|-------------------------------|----------------------------------------------------|---------------------------------|----------------------------------|
|
|
138
|
+
| `getTeamGeneralSettings` | Retrieves general team settings. | `teamId: string` | `TeamGeneralSettingsDto` |
|
|
139
|
+
| `updateTeamGeneralSettings` | Updates general team settings. | `teamId: string`, `TeamGeneralSettingsDto` | void |
|
|
140
|
+
| `getTeamInsightsSettings` | Retrieves team insights settings. | `teamId: string` | `InsightsSettingsDto` |
|
|
141
|
+
| `updateTeamInsightsSettings` | Updates insights settings including grading configs.| `teamId: string`, `InsightsSettingsDto` | void |
|
|
142
|
+
| `getShopSettings` | Retrieves the shop-level config like currency, timezone.| `teamId: string` | `GetShopSettingsResponseDto` |
|
|
143
|
+
| `saveShopSettings` | Saves Shopify shop currency and time zone settings.| `teamId: string`, Optional Shopify webhook payload | void |
|
|
144
|
+
|
|
145
|
+
### Error Conditions
|
|
146
|
+
|
|
147
|
+
- Unsupported inventory grading strategies throw a `GenieException`.
|
|
148
|
+
- Any update failure results in a thrown exception with contextual info including the failing settings and team ID.
|
|
149
|
+
|
|
150
|
+
### Frontend Integration
|
|
151
|
+
|
|
152
|
+
- Uses React Query hooks such as `useGetTeamGeneralSettingsQuery` and mutation hooks `useUpdateTeamGeneralSettingsMutation`.
|
|
153
|
+
- UI includes controlled forms managing business details and Shopify sync status.
|
|
154
|
+
|
|
155
|
+
## Environment & Configuration
|
|
156
|
+
|
|
157
|
+
### Team Configuration Properties
|
|
158
|
+
|
|
159
|
+
| Setting | Type | Description | Default / Validation |
|
|
160
|
+
|------------------------------------|--------------------------|-----------------------------------------------------------|--------------------------------------|
|
|
161
|
+
| `name` | string | Business name of the team. | Nullable, stored in `name` column. |
|
|
162
|
+
| `generalSettings` | JSON object | Business address, VAT number, contact info, etc. | Stored in JSON column. |
|
|
163
|
+
| `currency` | string | Team's accounting/display currency. | From Shopify, nullable. |
|
|
164
|
+
| `timeZone` | string | IANA time zone identifier for the team/shop. | Default: `Etc/UTC`, validated against timezone list. |
|
|
165
|
+
| `averageDailySalesPeriodDaysSetting` | integer Enum (7,30,60,90,180) | Period for sales averaging in analysis. | Default: 30 |
|
|
166
|
+
| `inventoryItemGradingPeriodDaysSetting` | integer Enum | Period over which inventory grading is calculated. | Default: 30 |
|
|
167
|
+
| `inventoryItemGradingStrategySetting` | Enum `InventoryItemGradingStrategy` | The strategy for inventory grading (e.g., SalesRevenue). | Default: `SalesRevenue`, `SalesFrequency` disallowed. |
|
|
168
|
+
| `inventoryItemGradingLevelAThresholdSetting` | integer | Threshold % for grading level A. | Default: 80 |
|
|
169
|
+
| `inventoryItemGradingLevelBThresholdSetting` | integer | Threshold % for grading level B. | Default: 15 |
|
|
170
|
+
| `inventoryItemGradingLevelCThresholdSetting` | integer | Threshold % for grading level C. | Default: 5 |
|
|
171
|
+
| `stockLevelsSettings` | JSON object | Settings for stock buffer, lead time, reorder frequency. | Defaults to leadTime=30, stockBuffer=10, reorderFrequency=EveryTwoMonths |
|
|
172
|
+
|
|
173
|
+
### Shopify Environment Integration
|
|
174
|
+
|
|
175
|
+
- Shopify shop data such as currency and IANA time zone are pulled from webhook payloads or API calls.
|
|
176
|
+
- Time zone validation is performed by `isValidTimeZone` utility.
|
|
177
|
+
- If invalid or missing, time zone falls back to `Etc/UTC`.
|
|
178
|
+
|
|
179
|
+
### Local Development and Environment Setup
|
|
180
|
+
|
|
181
|
+
- Environment variables managing database and Shopify credentials are outside the scope of this document.
|
|
182
|
+
- Configuration for environment management likely handled in `ConfigModule` and `ConfigService` (referenced exports), but specific environment variables are not detailed here.
|
|
183
|
+
|
|
184
|
+
## Testing, Monitoring, and Deployment
|
|
185
|
+
|
|
186
|
+
- Test details for settings service and UI are unspecified.
|
|
187
|
+
- Error conditions raise `GenieException` logged with context for debugging.
|
|
188
|
+
- Frontend mutation success triggers user notifications.
|
|
189
|
+
|
|
190
|
+
## Troubleshooting & Known Issues
|
|
191
|
+
|
|
192
|
+
- Attempting to use the unsupported `SalesFrequency` grading strategy results in explicit exceptions.
|
|
193
|
+
- Manual Shopify sync on the frontend has race-condition warnings (HTTP 409) if multiple syncs are attempted simultaneously.
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
This document is aimed at backend and frontend developers managing and extending the Genie platform's environment and team settings system. It should serve as a guide for understanding configuration storage, validation, API design, and usage patterns for consistent, reliable environment configuration handling.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Installation & Setup Guide'
|
|
3
|
+
description: 'Steps to clone, install dependencies, run the application, and prepare the database.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Installation & Setup Guide
|
|
7
|
+
|
|
8
|
+
### Overview
|
|
9
|
+
This guide covers the installation and setup of the Genie application backend and frontend components essential for onboarding, data synchronization, and product variant management.
|
|
10
|
+
|
|
11
|
+
Genie integrates tightly with Shopify stores to synchronize product, inventory, bundle, and purchase order data. It handles onboarding workflows, monitors product variant counts, and manages webhooks for real-time data sync.
|
|
12
|
+
|
|
13
|
+
### Components Involved
|
|
14
|
+
- **Onboarding Service**: Manages user onboarding progress, data synchronization, and notification workflows.
|
|
15
|
+
- **Shopify Webhooks Service**: Registers and manages Shopify webhook subscriptions for data updates.
|
|
16
|
+
- **Database Views and Migrations**: Defines database schemas, especially for inventory data and product variant tracking.
|
|
17
|
+
- **Frontend Modals and UI Components**: Provide user feedback and guides, such as store size warnings when variant count is large.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Backend Installation & Setup
|
|
22
|
+
|
|
23
|
+
### 1. Database Setup and Migrations
|
|
24
|
+
|
|
25
|
+
Genie uses a PostgreSQL database with TypeORM. Core migrations include:
|
|
26
|
+
|
|
27
|
+
- **Initial Database Schema**: Creates tables for users, teams, products, product variants, purchase orders, and related entities. [Initialise Migration](apps/api/src/migrations/db/1688040345407-Initialise.ts)
|
|
28
|
+
- **Inventory Item View**: Creates a SQL view consolidating product and variant data for inventory management, including sales and stock metrics. This view gets updated with new columns like `isNewProduct` for enhanced data insights. [Inventory View Migration](apps/api/src/migrations/db/1692960155848-add-is-new-product-to-inventory-item-view.ts)
|
|
29
|
+
- **Product Variant Location & Shopify Inventory Item ID**: Adds location-based inventory tracking and links variants to Shopify InventoryItem IDs. [Variant Location Migration](apps/api/src/migrations/db/1701958615964-add-product-variant-location-and-shopify-inventory-item-id.ts)
|
|
30
|
+
|
|
31
|
+
Run migrations after database setup to ensure schema is current.
|
|
32
|
+
|
|
33
|
+
### 2. Onboarding Service Setup
|
|
34
|
+
|
|
35
|
+
The `OnboardingService` handles setup progress and sync workflows:
|
|
36
|
+
|
|
37
|
+
- Initializes onboarding progress record for a new team.
|
|
38
|
+
- Verifies product variant count does not exceed limits and disables teams if necessary.
|
|
39
|
+
- Manages multi-step onboarding including insight settings, grading, suppliers, purchase order import, bundle mapping, and final completion.
|
|
40
|
+
- Tracks progress and triggers background data sync jobs using BullMQ queues (`QUEUE.ONBOARDING`).
|
|
41
|
+
|
|
42
|
+
Key files and location:
|
|
43
|
+
- Service: `apps/api/src/setup/services/onboarding.service.ts`
|
|
44
|
+
- Controller: `apps/api/src/setup/controllers/onboarding.controller.ts`
|
|
45
|
+
- Module: `apps/api/src/setup/setup.module.ts`
|
|
46
|
+
|
|
47
|
+
**Important:** On module initialization, the onboarding service resumes incomplete onboarding flows for all teams to ensure no data sync or onboarding step is left hanging after a server restart.
|
|
48
|
+
|
|
49
|
+
### 3. Shopify Webhooks
|
|
50
|
+
|
|
51
|
+
Webhook registration is essential for real-time syncing of Shopify events such as:
|
|
52
|
+
- Products and variants create, update, delete
|
|
53
|
+
- Locations activate, create, update, delete
|
|
54
|
+
- Inventory levels update and disconnect
|
|
55
|
+
- Collections create, update, delete
|
|
56
|
+
- Orders create, update, cancel, delete
|
|
57
|
+
- Shop updates
|
|
58
|
+
|
|
59
|
+
The `WebhooksInsightsSyncService` manages webhook registration and event processing pipelines. It includes:
|
|
60
|
+
- Registration and unregistration of webhooks for active/inactive teams
|
|
61
|
+
- Processing batched Shopify events through a set of ordered pipes for syncing data to database
|
|
62
|
+
- Retry mechanism for failed webhook registrations
|
|
63
|
+
|
|
64
|
+
Files of interest:
|
|
65
|
+
- `apps/api/src/pim/services/webhooks-insights-sync.service.ts`
|
|
66
|
+
|
|
67
|
+
### 4. Billing & Subscription
|
|
68
|
+
|
|
69
|
+
The `MantleService` integrates billing, subscription state handling, and plan assignments:
|
|
70
|
+
- Identifies customers in the billing system and assigns plans
|
|
71
|
+
- Handles trial expirations, subscription cancellations, activations
|
|
72
|
+
- Reacts to install/reinstall/uninstall Shopify app webhooks
|
|
73
|
+
|
|
74
|
+
File:
|
|
75
|
+
- `apps/api/src/billing/services/mantle.service.ts`
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Frontend Setup
|
|
80
|
+
|
|
81
|
+
### 1. Store Size Warning Modal
|
|
82
|
+
|
|
83
|
+
To alert users whose Shopify store has a very high number of product variants (exceeding `MAX_ALLOWED_PRODUCT_VARIANTS_COUNT`), Genie shows a modal prompting a discovery call before proceeding with onboarding.
|
|
84
|
+
|
|
85
|
+
- The modal displays the exact variant count fetched by querying the API.
|
|
86
|
+
- Includes an embedded HubSpot calendar iframe to book time with the Genie team.
|
|
87
|
+
|
|
88
|
+
Relevant file:
|
|
89
|
+
- `apps/web/src/components/pages/Onboarding/store-too-large-modal.tsx`
|
|
90
|
+
|
|
91
|
+
### 2. Sync Product Variants Manually
|
|
92
|
+
|
|
93
|
+
Users can manually refresh Shopify store sync from settings:
|
|
94
|
+
|
|
95
|
+
- The "Shopify Store Data" card lets users trigger manual sync to refresh product variants.
|
|
96
|
+
- Sync status and feedback notifications are provided.
|
|
97
|
+
|
|
98
|
+
Relevant file:
|
|
99
|
+
- `apps/web/src/components/pages/settings/general-settings.tsx`
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Running Genie Locally
|
|
104
|
+
|
|
105
|
+
1. **Set up all environment variables** as per your environment. Refer to `Environment Variables & Configuration` documentation for required keys.
|
|
106
|
+
2. **Initialize and migrate the database** using TypeORM migrations.
|
|
107
|
+
3. **Start backend services**, ensuring BullMQ queues and Redis are operational for job processing.
|
|
108
|
+
4. **Start the frontend web server** using Next.js; the onboarding modals and syncing features will be accessible.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Summary
|
|
113
|
+
This installation and setup guide provides technical details for initializing Genie’s backend services, database, webhooks integration with Shopify, billing system connectivity, and frontend user experience components necessary for a seamless onboarding and store data synchronization process.
|
|
114
|
+
|
|
115
|
+
Developers are encouraged to familiarize themselves with the onboarding service flows and webhook synchronization pipelines to understand the end-to-end data flow from Shopify to Genie’s internal representations and UI triggers.
|
|
116
|
+
|
|
117
|
+
For deeper understanding, review:
|
|
118
|
+
- [Onboarding Service Implementation](apps/api/src/setup/services/onboarding.service.ts)
|
|
119
|
+
- [Webhook Synchronization Service](apps/api/src/pim/services/webhooks-insights-sync.service.ts)
|
|
120
|
+
- [General Settings Sync Component](apps/web/src/components/pages/settings/general-settings.tsx)
|
|
121
|
+
- [Store Too Large Modal](apps/web/src/components/pages/Onboarding/store-too-large-modal.tsx)
|
|
122
|
+
|
|
123
|
+
Regularly check migration files to keep the schema updated and refer to the workflow queues for processing status.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
Please refer to the respective internal modules and service implementations for detailed operational logic and error handling behaviors.
|
package/docs/dory.json
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Docucod",
|
|
3
|
+
"colors": {
|
|
4
|
+
"primary": "#60A5FA",
|
|
5
|
+
"light": "#60A5FA",
|
|
6
|
+
"dark": "#1E3A8A"
|
|
7
|
+
},
|
|
8
|
+
"favicon": "/favicon.svg",
|
|
9
|
+
"styling": {
|
|
10
|
+
"eyebrows": "breadcrumbs",
|
|
11
|
+
"codeblocks": "dark"
|
|
12
|
+
},
|
|
13
|
+
"icons": {
|
|
14
|
+
"library": "fontawesome"
|
|
15
|
+
},
|
|
16
|
+
"fonts": {
|
|
17
|
+
"family": "Montserrat",
|
|
18
|
+
"source": "https://fonts.gstatic.com/s/googlesansflex/v5/t5sJIQcYNIWbFgDgAAzZ34auoVyXkJCOvp3SFWJbN5hF8Ju1x6sKCyp0l9sI40swNJwGpVd4AZzz0v6lJ4qFXNZhGjLvDSkV4USKMo6qQzwliVdHAy9jxTDHg_ugnAakpwGc-cxgUqDCIUI.woff2",
|
|
19
|
+
"format": "woff2"
|
|
20
|
+
},
|
|
21
|
+
"background": {
|
|
22
|
+
"decoration": "gradient"
|
|
23
|
+
},
|
|
24
|
+
"navigation": {
|
|
25
|
+
"tabs": [
|
|
26
|
+
{
|
|
27
|
+
"tab": "Overview",
|
|
28
|
+
"groups": [
|
|
29
|
+
{
|
|
30
|
+
"group": "Developer Overview",
|
|
31
|
+
"pages": [
|
|
32
|
+
"overview/developer-overview/dev-architecture"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"group": "Product Intro",
|
|
37
|
+
"pages": [
|
|
38
|
+
"overview/product-intro/app-overview",
|
|
39
|
+
"overview/product-intro/architecture",
|
|
40
|
+
"overview/product-intro/core-concepts"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"tab": "Configuration",
|
|
47
|
+
"groups": [
|
|
48
|
+
{
|
|
49
|
+
"group": "App Settings",
|
|
50
|
+
"pages": [
|
|
51
|
+
"configuration/app-settings/feature-flags",
|
|
52
|
+
"configuration/app-settings/user-settings"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"group": "Installation Setup",
|
|
57
|
+
"pages": [
|
|
58
|
+
"configuration/installation-setup/env-vars",
|
|
59
|
+
"configuration/installation-setup/installation"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"tab": "Usage",
|
|
66
|
+
"groups": [
|
|
67
|
+
{
|
|
68
|
+
"group": "API Usage",
|
|
69
|
+
"pages": [
|
|
70
|
+
"usage/api-usage/api-inventory",
|
|
71
|
+
"usage/api-usage/api-products",
|
|
72
|
+
"usage/api-usage/api-purchase-orders",
|
|
73
|
+
"usage/api-usage/api-reports",
|
|
74
|
+
"usage/api-usage/api-suppliers",
|
|
75
|
+
"usage/api-usage/api-user-management"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"group": "UI Workflows",
|
|
80
|
+
"pages": [
|
|
81
|
+
"usage/ui-workflows/bundles",
|
|
82
|
+
"usage/ui-workflows/demand-planning",
|
|
83
|
+
"usage/ui-workflows/favorites",
|
|
84
|
+
"usage/ui-workflows/inventory-management",
|
|
85
|
+
"usage/ui-workflows/onboarding",
|
|
86
|
+
"usage/ui-workflows/purchase-orders",
|
|
87
|
+
"usage/ui-workflows/reports"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"tab": "Integrations",
|
|
94
|
+
"groups": [
|
|
95
|
+
{
|
|
96
|
+
"group": "Analytics Monitoring",
|
|
97
|
+
"pages": [
|
|
98
|
+
"integrations/analytics-monitoring/error-tracking",
|
|
99
|
+
"integrations/analytics-monitoring/notifications",
|
|
100
|
+
"integrations/analytics-monitoring/user-analytics"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"group": "Shopify Integration",
|
|
105
|
+
"pages": [
|
|
106
|
+
"integrations/shopify-integration/shopify-setup",
|
|
107
|
+
"integrations/shopify-integration/shopify-webhooks"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"tab": "Platform Admin",
|
|
114
|
+
"groups": [
|
|
115
|
+
{
|
|
116
|
+
"group": "Billing Subscriptions",
|
|
117
|
+
"pages": [
|
|
118
|
+
"platform-admin/billing-subscriptions/billing"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"group": "System Maintenance",
|
|
123
|
+
"pages": [
|
|
124
|
+
"platform-admin/system-maintenance/db-migrations",
|
|
125
|
+
"platform-admin/system-maintenance/health-monitoring",
|
|
126
|
+
"platform-admin/system-maintenance/queue-management"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"group": "User Team Management",
|
|
131
|
+
"pages": [
|
|
132
|
+
"platform-admin/user-team-management/teams",
|
|
133
|
+
"platform-admin/user-team-management/users"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"tab": "Support",
|
|
140
|
+
"groups": [
|
|
141
|
+
{
|
|
142
|
+
"group": "Legal",
|
|
143
|
+
"pages": [
|
|
144
|
+
"support/legal/dependency-analysis",
|
|
145
|
+
"support/legal/privacy-terms"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"group": "Troubleshooting",
|
|
150
|
+
"pages": [
|
|
151
|
+
"support/troubleshooting/common-issues"
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"logo": {
|
|
159
|
+
"light": "./logo/logo.png",
|
|
160
|
+
"dark": "./logo/logo.png"
|
|
161
|
+
}
|
|
162
|
+
}
|