You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overview of various Database tables and their purpose:
2
+
3
+
**1. Users**
4
+
This table manages authenticated user sessions that have access to the producer's system (users need to be authenticated via OIDC as a first step to access the producer app)
5
+
6
+
**2. Sales Sessions**
7
+
This table is used to store orders and their associated reservation dates (used to reserve draft order stock on Shopify). The reservation date equals the end dates of a sales session.
8
+
9
+
**3. Orders**
10
+
This table maps draft order IDs to completed order IDs, linking orders through different stages of processing.
11
+
12
+
**4. Line Items**
13
+
This table maintains a stable ID for line items using an external ID provided via the app's API. This helps track and manage line items even if Shopify updates its internal IDs which is the default behaviour when updating ongoing orders.
14
+
15
+
**5. FDC Variants**
16
+
This table tracks products tagged as FDC, making them accessible to Hubs.
17
+
18
+
**6. Webhooks:**
19
+
Every time Shopify triggers a webhook, a record is created in this table. It logs the webhook event and its associated details.
20
+
21
+
**8. Shopify Sessions:**
22
+
This table manages user sessions created and handled by Shopify, including session tokens and expiration details.
The application is stored on https://app.jpe.infomaniak.com/ and consists of various parts as described below:
4
+
5
+
## 1. PRODUCTION Environment Setup
6
+
7
+
### Application Server (Docker container)
8
+
Runs the application and is connected to Shopify via the Application Dashboard (API Configuration Section)
9
+
10
+
**Automated Deployments:**
11
+
- Image Building: Docker images are built automatically via GitHub Actions. The build process triggers on code changes and commits.
12
+
- Deployment Notification: GitHub Actions will ping Jelastic via a REST API call with deployment details once the build is complete.
13
+
- Tagging: Use branch-sha_commit tags (e.g., main-2d478ef) to keep track of versions.
14
+
15
+
**Logs:**
16
+
- Access logs in the run.log file within the Docker container for troubleshooting.
17
+
18
+
**Environment Variables:**
19
+
- Configure necessary environment variables using the Variables popup in Jelastic.
20
+
21
+
### Nginx Load Balancer:
22
+
23
+
- Port Configuration: Configure Nginx to listen on relevant application port (HTTP) and proxy traffic to the appropriate internal nodes based on IP addresses via HTTPS.
24
+
- SSL Configuration:
25
+
- Ensure Nginx is set up to handle SSL communication internally.
26
+
- Use the ssl.conf configuration file to set up SSL keys for secure communication between components.
27
+
28
+
### Postgres Container:
29
+
Stores the internal data store
30
+
- Links: Ensure proper linking between the Postgres container and other components.
31
+
- Certificates: Use certificates to secure communication between the Postgres container and other services.
32
+
33
+
### Creating new Environments:
34
+
- Simplest way is to clone Environment by using the Jelastic environment cloning feature to duplicate the current setup.
35
+
- This will create an exact replica of your existing environment.
36
+
- Post-clone, adjust the following settings:
37
+
- Update environment-specific settings, such as IP addresses, secrets, and environment variables.
38
+
- Ensure any environment-specific configurations (e.g., database URLs, API keys) are updated.
39
+
40
+

constresult=awaitpool.query(`SELECT draft_order_id as "draftOrderId", completed_order_id as "completedOrderId" from orders order by draft_order_id`,[]);
`SELECT draft_order_id as "draftOrderId", completed_order_id as "completedOrderId", owner_id as "ownerId" from orders where draft_order_id = $1 AND owner_id = (select id from users where user_id = $2)`,
constresult=awaitpool.query(`SELECT draft_order_id as "draftOrderId", completed_order_id as "completedOrderId", owner_id as "ownerId" from orders order by draft_order_id`,[]);
0 commit comments