@gnar-engine/cli 1.0.0 → 1.0.1
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/assets/gnar-engine-logo-white.svg +9 -0
- package/bootstrap/deploy.localdev.yml +51 -0
- package/bootstrap/secrets.localdev.yml +27 -0
- package/bootstrap/services/agent/Dockerfile +23 -0
- package/bootstrap/services/agent/notes.md +28 -0
- package/bootstrap/services/agent/package.json +16 -0
- package/bootstrap/services/agent/src/app.js +52 -0
- package/bootstrap/services/agent/src/commands/agent.handler.js +104 -0
- package/bootstrap/services/agent/src/config.js +52 -0
- package/bootstrap/services/agent/src/controllers/http.controller.js +44 -0
- package/bootstrap/services/agent/src/controllers/message.controller.js +51 -0
- package/bootstrap/services/agent/src/db/migrations/01-init.js +50 -0
- package/bootstrap/services/agent/src/db/migrations/02-agent-service-init.js +36 -0
- package/bootstrap/services/agent/src/policies/agent.policy.js +13 -0
- package/bootstrap/services/agent/src/schema/Agent.schema.js +17 -0
- package/bootstrap/services/agent/src/services/agent.service.js +259 -0
- package/bootstrap/services/agent/src/services/chatgpt.service.js +46 -0
- package/bootstrap/services/agent/src/services/manifest.service.js +21 -0
- package/bootstrap/services/control/Dockerfile +23 -0
- package/bootstrap/services/control/Dockerfile.prod +37 -0
- package/bootstrap/services/control/README.md +25 -0
- package/bootstrap/services/control/package.json +16 -0
- package/bootstrap/services/control/src/app.js +45 -0
- package/bootstrap/services/control/src/commands/control.handler.js +231 -0
- package/bootstrap/services/control/src/commands/service.handler.js +81 -0
- package/bootstrap/services/control/src/commands/task.handler.js +247 -0
- package/bootstrap/services/control/src/config.js +55 -0
- package/bootstrap/services/control/src/controllers/http.controller.js +228 -0
- package/bootstrap/services/control/src/controllers/message.controller.js +40 -0
- package/bootstrap/services/control/src/db/migrations/01-init.js +50 -0
- package/bootstrap/services/control/src/db/migrations/02-control-service-init.js +60 -0
- package/bootstrap/services/control/src/db/migrations/03-alter-tasks.js +29 -0
- package/bootstrap/services/control/src/policies/task.policy.js +53 -0
- package/bootstrap/services/control/src/schema/control.schema.js +42 -0
- package/bootstrap/services/control/src/services/registry.service.js +83 -0
- package/bootstrap/services/control/src/services/reset.service.js +28 -0
- package/bootstrap/services/control/src/services/task.service.js +153 -0
- package/bootstrap/services/control/src/tests/control.test.js +50 -0
- package/bootstrap/services/notification/Dockerfile +23 -0
- package/bootstrap/services/notification/Dockerfile.prod +37 -0
- package/bootstrap/services/notification/README.md +3 -0
- package/bootstrap/services/notification/package.json +34 -0
- package/bootstrap/services/notification/src/app.js +51 -0
- package/bootstrap/services/notification/src/commands/command-bus.js +20 -0
- package/bootstrap/services/notification/src/commands/handlers/control.handler.js +18 -0
- package/bootstrap/services/notification/src/commands/handlers/notification.handler.js +157 -0
- package/bootstrap/services/notification/src/config.js +15 -0
- package/bootstrap/services/notification/src/controllers/message.controller.js +82 -0
- package/bootstrap/services/notification/src/services/logger.service.js +16 -0
- package/bootstrap/services/notification/src/services/ses.service.js +23 -0
- package/bootstrap/services/notification/src/templates/admin-order-recieved.hbs +136 -0
- package/bootstrap/services/notification/src/templates/admin-subscription-failed.hbs +87 -0
- package/bootstrap/services/notification/src/templates/customer-order-recieved.hbs +132 -0
- package/bootstrap/services/notification/src/templates/customer-subscription-failed.hbs +77 -0
- package/bootstrap/services/notification/src/tests/notification.test.js +0 -0
- package/bootstrap/services/portal/Dockerfile +23 -0
- package/bootstrap/services/portal/Dockerfile.remote +40 -0
- package/bootstrap/services/portal/README.md +22 -0
- package/bootstrap/services/portal/nginx.conf +12 -0
- package/bootstrap/services/portal/package.json +59 -0
- package/bootstrap/services/portal/public/favicon.ico +0 -0
- package/bootstrap/services/portal/public/gnar-white.png +0 -0
- package/bootstrap/services/portal/public/gnarengine-logo-black.png +0 -0
- package/bootstrap/services/portal/public/index.html +43 -0
- package/bootstrap/services/portal/public/logo192.png +0 -0
- package/bootstrap/services/portal/public/logo512.png +0 -0
- package/bootstrap/services/portal/public/manifest.json +25 -0
- package/bootstrap/services/portal/public/robots.txt +3 -0
- package/bootstrap/services/portal/src/App.js +56 -0
- package/bootstrap/services/portal/src/assets/Logo_Anchord_Black.svg +1 -0
- package/bootstrap/services/portal/src/assets/Logo_Anchord_Black_Green.svg +1 -0
- package/bootstrap/services/portal/src/assets/Logo_Anchord_White_Green.svg +1 -0
- package/bootstrap/services/portal/src/assets/activity.svg +3 -0
- package/bootstrap/services/portal/src/assets/arrow.svg +3 -0
- package/bootstrap/services/portal/src/assets/bin-white.svg +3 -0
- package/bootstrap/services/portal/src/assets/bin.svg +3 -0
- package/bootstrap/services/portal/src/assets/check.svg +3 -0
- package/bootstrap/services/portal/src/assets/chevron.svg +3 -0
- package/bootstrap/services/portal/src/assets/contact.svg +3 -0
- package/bootstrap/services/portal/src/assets/dots-vertical.svg +5 -0
- package/bootstrap/services/portal/src/assets/eye-off.svg +3 -0
- package/bootstrap/services/portal/src/assets/eye.svg +4 -0
- package/bootstrap/services/portal/src/assets/gnar-engine-black.svg +47 -0
- package/bootstrap/services/portal/src/assets/gnar-engine-white.svg +47 -0
- package/bootstrap/services/portal/src/assets/gnar_engine.svg +3 -0
- package/bootstrap/services/portal/src/assets/gnarengine-logo-black.png +0 -0
- package/bootstrap/services/portal/src/assets/home.svg +3 -0
- package/bootstrap/services/portal/src/assets/link.svg +3 -0
- package/bootstrap/services/portal/src/assets/lock.svg +3 -0
- package/bootstrap/services/portal/src/assets/package.svg +4 -0
- package/bootstrap/services/portal/src/assets/raffle.svg +3 -0
- package/bootstrap/services/portal/src/assets/settings.svg +4 -0
- package/bootstrap/services/portal/src/assets/shopping-bag.svg +3 -0
- package/bootstrap/services/portal/src/assets/user-black.svg +3 -0
- package/bootstrap/services/portal/src/assets/user.svg +3 -0
- package/bootstrap/services/portal/src/assets/users.svg +3 -0
- package/bootstrap/services/portal/src/assets/wallet.svg +3 -0
- package/bootstrap/services/portal/src/css/style.css +1007 -0
- package/bootstrap/services/portal/src/data/data.js +70 -0
- package/bootstrap/services/portal/src/features/attributeFormRow/AttributeFormRow.jsx +32 -0
- package/bootstrap/services/portal/src/features/billingShipping/BillingShipping.jsx +160 -0
- package/bootstrap/services/portal/src/features/crud/crudEdit.less +230 -0
- package/bootstrap/services/portal/src/features/crud/crudList.less +134 -0
- package/bootstrap/services/portal/src/features/crud/crudPage.less +31 -0
- package/bootstrap/services/portal/src/features/crudContact/CrudContactList.jsx +108 -0
- package/bootstrap/services/portal/src/features/crudContact/CrudContactSingle.jsx +243 -0
- package/bootstrap/services/portal/src/features/crudOrder/CrudOrderList.jsx +109 -0
- package/bootstrap/services/portal/src/features/crudOrder/CrudOrderSingle.jsx +315 -0
- package/bootstrap/services/portal/src/features/crudProducts/CrudProductList.jsx +104 -0
- package/bootstrap/services/portal/src/features/crudProducts/CrudProductSingle.jsx +388 -0
- package/bootstrap/services/portal/src/features/crudRaffles/CrudRafflesList.jsx +104 -0
- package/bootstrap/services/portal/src/features/crudRaffles/CrudRafflesSingle.jsx +208 -0
- package/bootstrap/services/portal/src/features/crudSubscription/CrudSubscriptionList.jsx +110 -0
- package/bootstrap/services/portal/src/features/crudSubscription/CrudSubscriptionSingle.jsx +261 -0
- package/bootstrap/services/portal/src/features/crudUser/CrudUserList.jsx +107 -0
- package/bootstrap/services/portal/src/features/crudUser/CrudUserSingle.jsx +402 -0
- package/bootstrap/services/portal/src/features/inventoryFormRow/InventoryFormRow.jsx +30 -0
- package/bootstrap/services/portal/src/features/lineItems/LineItems.jsx +113 -0
- package/bootstrap/services/portal/src/features/loginForm/LoginForm.jsx +56 -0
- package/bootstrap/services/portal/src/features/loginForm/loginForm.less +56 -0
- package/bootstrap/services/portal/src/features/notes/Notes.jsx +18 -0
- package/bootstrap/services/portal/src/features/passwordReset/PasswordResetForm.jsx +96 -0
- package/bootstrap/services/portal/src/features/passwordReset/PasswordResetRequestForm.jsx +74 -0
- package/bootstrap/services/portal/src/features/priceFormRow/PriceFormRow.jsx +102 -0
- package/bootstrap/services/portal/src/features/priceFormRow/priceFormRow.less +24 -0
- package/bootstrap/services/portal/src/features/raffleEntriesList/RaffleEntriesList.jsx +99 -0
- package/bootstrap/services/portal/src/features/raffleProductFormRow/RaffleProductFormRow.jsx +46 -0
- package/bootstrap/services/portal/src/features/sidebar/Sidebar.jsx +64 -0
- package/bootstrap/services/portal/src/features/sidebar/sidebar.less +49 -0
- package/bootstrap/services/portal/src/features/skus/Skus.jsx +109 -0
- package/bootstrap/services/portal/src/features/subscriptionSchedule/SubscriptionSchedule.jsx +44 -0
- package/bootstrap/services/portal/src/features/taxonomyFormRow/TaxonomyFormRow.jsx +32 -0
- package/bootstrap/services/portal/src/features/user/User.jsx +54 -0
- package/bootstrap/services/portal/src/features/user/user.less +57 -0
- package/bootstrap/services/portal/src/includes/utilities.js +259 -0
- package/bootstrap/services/portal/src/index.js +14 -0
- package/bootstrap/services/portal/src/layouts/CrudLayout.jsx +50 -0
- package/bootstrap/services/portal/src/layouts/LoginLayout.jsx +17 -0
- package/bootstrap/services/portal/src/layouts/PortalLayout.jsx +48 -0
- package/bootstrap/services/portal/src/layouts/loginLayout.less +33 -0
- package/bootstrap/services/portal/src/layouts/portalLayout.less +67 -0
- package/bootstrap/services/portal/src/pages/contacts/Contacts.jsx +199 -0
- package/bootstrap/services/portal/src/pages/dashboard/Dashboard.jsx +17 -0
- package/bootstrap/services/portal/src/pages/integrations/Integrations.jsx +10 -0
- package/bootstrap/services/portal/src/pages/login/Login.jsx +15 -0
- package/bootstrap/services/portal/src/pages/login/login.less +10 -0
- package/bootstrap/services/portal/src/pages/orders/Orders.jsx +199 -0
- package/bootstrap/services/portal/src/pages/passwordReset/PasswordResetPage.jsx +15 -0
- package/bootstrap/services/portal/src/pages/passwordResetRequest/PasswordResetRequestPage.jsx +15 -0
- package/bootstrap/services/portal/src/pages/payments/Payments.jsx +10 -0
- package/bootstrap/services/portal/src/pages/portal/Portal.jsx +43 -0
- package/bootstrap/services/portal/src/pages/products/Products.jsx +212 -0
- package/bootstrap/services/portal/src/pages/raffleEntries/RaffleEntries.jsx +124 -0
- package/bootstrap/services/portal/src/pages/raffles/Raffles.jsx +186 -0
- package/bootstrap/services/portal/src/pages/reports/Reports.jsx +10 -0
- package/bootstrap/services/portal/src/pages/settings/Settings.jsx +10 -0
- package/bootstrap/services/portal/src/pages/subscriptions/Subscriptions.jsx +199 -0
- package/bootstrap/services/portal/src/pages/users/Users.jsx +193 -0
- package/bootstrap/services/portal/src/pages/users/users.less +25 -0
- package/bootstrap/services/portal/src/slices/authSlice.js +71 -0
- package/bootstrap/services/portal/src/store/configureStore.js +12 -0
- package/bootstrap/services/portal/src/styles/global.less +159 -0
- package/bootstrap/services/portal/src/styles/inputs.less +157 -0
- package/bootstrap/services/portal/src/styles/main.less +26 -0
- package/bootstrap/services/portal/src/ui/collapsible/Collapsible.jsx +97 -0
- package/bootstrap/services/portal/src/ui/collapsible/collapsible.less +23 -0
- package/bootstrap/services/portal/src/ui/customCheckbox/CustomCheckbox.jsx +17 -0
- package/bootstrap/services/portal/src/ui/customCheckbox/customCheckbox.less +42 -0
- package/bootstrap/services/portal/src/ui/customMultiSelect/CustomMultiSelect.jsx +63 -0
- package/bootstrap/services/portal/src/ui/customMultiSelect/CustomMultiSelectPeriod.jsx +63 -0
- package/bootstrap/services/portal/src/ui/customSelect/CustomSelect.jsx +63 -0
- package/bootstrap/services/portal/src/ui/customSelect/customSelect.less +92 -0
- package/bootstrap/services/portal/src/ui/goBack/GoBack.jsx +19 -0
- package/bootstrap/services/portal/src/ui/loader/Loader.jsx +12 -0
- package/bootstrap/services/portal/src/ui/pagination/Pagination.jsx +23 -0
- package/bootstrap/services/portal/src/ui/repeater/Repeater.jsx +29 -0
- package/bootstrap/services/portal/src/ui/saveButton/SaveButton.jsx +69 -0
- package/bootstrap/services/portal/src/ui/saveButton/saveButton.less +0 -0
- package/bootstrap/services/rabbit-mq/Dockerfile.prod +9 -0
- package/bootstrap/services/user/Dockerfile +23 -0
- package/bootstrap/services/user/Dockerfile.prod +37 -0
- package/bootstrap/services/user/README.md +8 -0
- package/bootstrap/services/user/package.json +16 -0
- package/bootstrap/services/user/src/app.js +45 -0
- package/bootstrap/services/user/src/commands/session.handler.js +23 -0
- package/bootstrap/services/user/src/commands/user.handler.js +286 -0
- package/bootstrap/services/user/src/config.js +73 -0
- package/bootstrap/services/user/src/controllers/http.controller.js +156 -0
- package/bootstrap/services/user/src/controllers/message.controller.js +51 -0
- package/bootstrap/services/user/src/db/migrations/01-init.js +50 -0
- package/bootstrap/services/user/src/db/migrations/02-user-service-init.js +63 -0
- package/bootstrap/services/user/src/db/migrations/03-unauth-sessions.js +43 -0
- package/bootstrap/services/user/src/db/seeders/development/01-root-user.js +29 -0
- package/bootstrap/services/user/src/db/seeders/development/02-portal-admin-user.js +27 -0
- package/bootstrap/services/user/src/db/seeders/production/01-root-user.js +29 -0
- package/bootstrap/services/user/src/policies/user.policy.js +81 -0
- package/bootstrap/services/user/src/schema/user.schema.js +69 -0
- package/bootstrap/services/user/src/services/authentication.service.js +127 -0
- package/bootstrap/services/user/src/services/session.service.js +58 -0
- package/bootstrap/services/user/src/services/user.service.js +130 -0
- package/bootstrap/services/user/src/tests/user.test.js +126 -0
- package/package.json +3 -7
- package/src/agent/agent.client.js +28 -0
- package/src/agent/commands.js +48 -0
- package/src/cli.js +30 -0
- package/src/config.js +8 -0
- package/src/control/commands.js +156 -0
- package/src/control/control.client.js +127 -0
- package/src/dev/commands.js +71 -0
- package/src/dev/dev.service.js +320 -0
- package/src/engine/infra.js +142 -0
- package/src/helpers/helpers.js +63 -0
- package/src/profiles/command.js +170 -0
- package/src/profiles/profiles.client.js +101 -0
- package/src/scaffolder/commands.js +123 -0
- package/src/scaffolder/scaffolder.handler.js +252 -0
- package/src/services/client.js +174 -0
- package/templates/service/Dockerfile.hbs +20 -0
- package/templates/service/app.js.hbs +38 -0
- package/templates/service/commands/{{serviceName}}.handler.js.hbs +97 -0
- package/templates/service/config.js.hbs +48 -0
- package/templates/service/controllers/http.controller.js.hbs +87 -0
- package/templates/service/controllers/message.controller.js.hbs +51 -0
- package/templates/service/db/migrations/01-init.js.hbs +50 -0
- package/templates/service/db/migrations/02-{{lowerCase serviceName}}-service-init.js.hbs +23 -0
- package/templates/service/package.json.hbs +18 -0
- package/templates/service/policies/{{serviceName}}.policy.js.hbs +49 -0
- package/templates/service/schema/{{serviceName}}.schema.js.hbs +14 -0
- package/templates/service/services/{{serviceName}}.service.js.hbs +32 -0
- package/dist/cli.js +0 -18
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SESClient } from '@aws-sdk/client-ses';
|
|
2
|
+
import { logger } from './logger.service.js';
|
|
3
|
+
|
|
4
|
+
let sesClientInstance = null;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Get SES Client Instance
|
|
8
|
+
*
|
|
9
|
+
* @returns {SESClient} - SESClient instance
|
|
10
|
+
* @description Returns a singleton instance of the SESClient
|
|
11
|
+
*/
|
|
12
|
+
export const getSesClient = () => {
|
|
13
|
+
if (!sesClientInstance) {
|
|
14
|
+
sesClientInstance = new SESClient({
|
|
15
|
+
region: process.env.NOTIFICATION_AWS_REGION,
|
|
16
|
+
credentials: {
|
|
17
|
+
accessKeyId: process.env.NOTIFICATION_AWS_ACCESS_KEY_ID,
|
|
18
|
+
secretAccessKey: process.env.NOTIFICATION_AWS_SECRET_ACCESS_KEY
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return sesClientInstance;
|
|
23
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>New Order Notification</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: Arial, sans-serif;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
color: #333;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
max-width: 600px;
|
|
15
|
+
margin: auto;
|
|
16
|
+
padding: 20px;
|
|
17
|
+
border: 1px solid #eee;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo {
|
|
21
|
+
text-align: center;
|
|
22
|
+
margin-bottom: 20px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.logo img {
|
|
26
|
+
max-height: 60px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
table {
|
|
36
|
+
width: 100%;
|
|
37
|
+
border-collapse: collapse;
|
|
38
|
+
margin-bottom: 20px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
th, td {
|
|
42
|
+
padding: 10px;
|
|
43
|
+
border: 1px solid #ddd;
|
|
44
|
+
text-align: left;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
th {
|
|
48
|
+
background-color: #f8f8f8;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.totals td {
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.footer {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #777;
|
|
58
|
+
text-align: center;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<div class="container">
|
|
64
|
+
<div class="logo">
|
|
65
|
+
<img src="{{ logoUrl }}" alt="Logo">
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="header">
|
|
69
|
+
New Order Received
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<p>A new order has been placed by <strong>{{order.billingAddress.firstName}} {{order.billingAddress.lastName}}</strong>.</p>
|
|
73
|
+
|
|
74
|
+
<h3>Customer Contact</h3>
|
|
75
|
+
<p>
|
|
76
|
+
Email: <a href="mailto:{{order.billingAddress.email}}">{{order.billingAddress.email}}</a><br>
|
|
77
|
+
Phone: {{order.billingAddress.phone}}
|
|
78
|
+
</p>
|
|
79
|
+
|
|
80
|
+
<h3>Order Summary</h3>
|
|
81
|
+
<table>
|
|
82
|
+
<thead>
|
|
83
|
+
<tr>
|
|
84
|
+
<th>SKU</th>
|
|
85
|
+
<th>Type</th>
|
|
86
|
+
<th>Price</th>
|
|
87
|
+
<th>Qty</th>
|
|
88
|
+
</tr>
|
|
89
|
+
</thead>
|
|
90
|
+
<tbody>
|
|
91
|
+
{{#each order.lineItems}}
|
|
92
|
+
<tr>
|
|
93
|
+
<td>{{sku}}</td>
|
|
94
|
+
<td>{{type}}</td>
|
|
95
|
+
<td>{{currencySymbol}} {{price.price}}</td>
|
|
96
|
+
<td>{{quantity}}</td>
|
|
97
|
+
</tr>
|
|
98
|
+
{{/each}}
|
|
99
|
+
</tbody>
|
|
100
|
+
</table>
|
|
101
|
+
|
|
102
|
+
<table class="totals">
|
|
103
|
+
<tr>
|
|
104
|
+
<td>Subtotal:</td>
|
|
105
|
+
<td style="text-align: right;">{{currencySymbol}} {{order.subTotal}}</td>
|
|
106
|
+
</tr>
|
|
107
|
+
<tr>
|
|
108
|
+
<td>Tax:</td>
|
|
109
|
+
<td style="text-align: right;">{{currencySymbol}} {{order.tax}}</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td>Shipping:</td>
|
|
113
|
+
<td style="text-align: right;">{{currencySymbol}} {{order.shipping}}</td>
|
|
114
|
+
</tr>
|
|
115
|
+
<tr>
|
|
116
|
+
<td>Total:</td>
|
|
117
|
+
<td style="text-align: right;"><strong>{{currencySymbol}} {{order.total}}</strong></td>
|
|
118
|
+
</tr>
|
|
119
|
+
</table>
|
|
120
|
+
|
|
121
|
+
<h3>Billing Address</h3>
|
|
122
|
+
<p>
|
|
123
|
+
{{order.billingAddress.firstName}} {{order.billingAddress.lastName}}<br>
|
|
124
|
+
{{order.billingAddress.addressLine1}}<br>
|
|
125
|
+
{{order.billingAddress.addressLine2}}<br>
|
|
126
|
+
{{order.billingAddress.city}}, {{order.billingAddress.county}}<br>
|
|
127
|
+
{{order.billingAddress.postcode}}<br>
|
|
128
|
+
{{order.billingAddress.country}}
|
|
129
|
+
</p>
|
|
130
|
+
|
|
131
|
+
<div class="footer">
|
|
132
|
+
This is an automated notification from GnarEngine.
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</body>
|
|
136
|
+
</html>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Subscription Cancelled - Admin Notification</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: Arial, sans-serif;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
color: #333;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
max-width: 600px;
|
|
15
|
+
margin: auto;
|
|
16
|
+
padding: 20px;
|
|
17
|
+
border: 1px solid #eee;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo {
|
|
21
|
+
text-align: center;
|
|
22
|
+
margin-bottom: 20px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.logo img {
|
|
26
|
+
max-height: 60px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
color: #e67e22;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.content p {
|
|
37
|
+
margin-bottom: 15px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.details {
|
|
41
|
+
border-top: 1px solid #ccc;
|
|
42
|
+
padding-top: 10px;
|
|
43
|
+
margin-top: 20px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.details strong {
|
|
47
|
+
display: inline-block;
|
|
48
|
+
width: 140px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.footer {
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
color: #777;
|
|
54
|
+
text-align: center;
|
|
55
|
+
margin-top: 30px;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
</head>
|
|
59
|
+
<body>
|
|
60
|
+
<div class="container">
|
|
61
|
+
<div class="logo">
|
|
62
|
+
<img src="{{ logoUrl }}" alt="Logo">
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="header">
|
|
66
|
+
Subscription Cancelled After Failed Payments
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="content">
|
|
70
|
+
<p>A customer's subscription has been <strong>cancelled</strong> after three failed payment attempts.</p>
|
|
71
|
+
|
|
72
|
+
<div class="details">
|
|
73
|
+
<p><strong>Customer Name:</strong> {{firstName}} {{lastName}}</p>
|
|
74
|
+
<p><strong>Email:</strong> {{email}}</p>
|
|
75
|
+
<p><strong>Subscription ID:</strong> {{subscriptionId}}</p>
|
|
76
|
+
<p><strong>Reason:</strong> Payment failed 3 times</p>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<p>Please take any follow-up action if required.</p>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="footer">
|
|
83
|
+
This is an automated message from your store notification system.
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</body>
|
|
87
|
+
</html>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Order Received</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: Arial, sans-serif;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
color: #333;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
max-width: 600px;
|
|
15
|
+
margin: auto;
|
|
16
|
+
padding: 20px;
|
|
17
|
+
border: 1px solid #eee;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo {
|
|
21
|
+
text-align: center;
|
|
22
|
+
margin-bottom: 20px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.logo img {
|
|
26
|
+
max-height: 60px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
table {
|
|
36
|
+
width: 100%;
|
|
37
|
+
border-collapse: collapse;
|
|
38
|
+
margin-bottom: 20px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
th, td {
|
|
42
|
+
padding: 10px;
|
|
43
|
+
border: 1px solid #ddd;
|
|
44
|
+
text-align: left;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
th {
|
|
48
|
+
background-color: #f8f8f8;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.totals td {
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.footer {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #777;
|
|
58
|
+
text-align: center;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<div class="container">
|
|
64
|
+
<div class="logo">
|
|
65
|
+
<img src="{{ logoUrl }}" alt="Logo">
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="header">
|
|
69
|
+
Thank you for your order, {{order.billingAddress.firstName}}!
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<p>We've received your order and are now processing it. Here are the details:</p>
|
|
73
|
+
|
|
74
|
+
<h3>Order Summary</h3>
|
|
75
|
+
<table>
|
|
76
|
+
<thead>
|
|
77
|
+
<tr>
|
|
78
|
+
<th>SKU</th>
|
|
79
|
+
<th>Type</th>
|
|
80
|
+
<th>Price</th>
|
|
81
|
+
<th>Qty</th>
|
|
82
|
+
</tr>
|
|
83
|
+
</thead>
|
|
84
|
+
<tbody>
|
|
85
|
+
{{#each order.lineItems}}
|
|
86
|
+
<tr>
|
|
87
|
+
<td>{{sku}}</td>
|
|
88
|
+
<td>{{type}}</td>
|
|
89
|
+
<td>{{currencySymbol}} {{price.price}}</td>
|
|
90
|
+
<td>{{quantity}}</td>
|
|
91
|
+
</tr>
|
|
92
|
+
{{/each}}
|
|
93
|
+
</tbody>
|
|
94
|
+
</table>
|
|
95
|
+
|
|
96
|
+
<table class="totals">
|
|
97
|
+
<tr>
|
|
98
|
+
<td>Subtotal:</td>
|
|
99
|
+
<td style="text-align: right;">{{currencySymbol}} {{order.subTotal}}</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td>Tax:</td>
|
|
103
|
+
<td style="text-align: right;">{{currencySymbol}} {{order.tax}}</td>
|
|
104
|
+
</tr>
|
|
105
|
+
<tr>
|
|
106
|
+
<td>Shipping:</td>
|
|
107
|
+
<td style="text-align: right;">{{currencySymbol}} {{order.shipping}}</td>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<td>Total:</td>
|
|
111
|
+
<td style="text-align: right;"><strong>{{currencySymbol}} {{order.total}}</strong></td>
|
|
112
|
+
</tr>
|
|
113
|
+
</table>
|
|
114
|
+
|
|
115
|
+
<h3>Billing Information</h3>
|
|
116
|
+
<p>
|
|
117
|
+
{{order.billingAddress.firstName}} {{order.billingAddress.lastName}}<br>
|
|
118
|
+
{{order.billingAddress.addressLine1}}<br>
|
|
119
|
+
{{order.billingAddress.addressLine2}}<br>
|
|
120
|
+
{{order.billingAddress.city}}, {{order.billingAddress.county}}<br>
|
|
121
|
+
{{order.billingAddress.postcode}}<br>
|
|
122
|
+
{{order.billingAddress.country}}<br>
|
|
123
|
+
Phone: {{order.billingAddress.phone}}<br>
|
|
124
|
+
Email: {{order.billingAddress.email}}
|
|
125
|
+
</p>
|
|
126
|
+
|
|
127
|
+
<div class="footer">
|
|
128
|
+
If you have any questions, please contact us at support@gnar.co.uk
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</body>
|
|
132
|
+
</html>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Subscription Cancelled</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: Arial, sans-serif;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
color: #333;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
max-width: 600px;
|
|
15
|
+
margin: auto;
|
|
16
|
+
padding: 20px;
|
|
17
|
+
border: 1px solid #eee;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo {
|
|
21
|
+
text-align: center;
|
|
22
|
+
margin-bottom: 20px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.logo img {
|
|
26
|
+
max-height: 60px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
color: #c0392b;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.content p {
|
|
37
|
+
margin-bottom: 15px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.footer {
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
color: #777;
|
|
43
|
+
text-align: center;
|
|
44
|
+
margin-top: 30px;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
</head>
|
|
48
|
+
<body>
|
|
49
|
+
<div class="container">
|
|
50
|
+
<div class="logo">
|
|
51
|
+
<img src="{{ logoUrl }}" alt="Logo">
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="header">
|
|
55
|
+
Your Subscription Has Been Cancelled
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="content">
|
|
59
|
+
<p>Hi {{firstName}},</p>
|
|
60
|
+
|
|
61
|
+
<p>Unfortunately, we were unable to process your subscription payment after three attempts.</p>
|
|
62
|
+
|
|
63
|
+
<p>As a result, your subscription has now been <strong>cancelled</strong>.</p>
|
|
64
|
+
|
|
65
|
+
<p>If you'd like to continue enjoying our services, you'll need to purchase a new subscription.</p>
|
|
66
|
+
|
|
67
|
+
<p>You can do this by visiting your account and selecting a new plan that suits you.</p>
|
|
68
|
+
|
|
69
|
+
<p>If you believe this was a mistake or have updated your payment information, please contact our support team.</p>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="footer">
|
|
73
|
+
If you have any questions, feel free to contact us at support@gnar.co.uk
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</body>
|
|
77
|
+
</html>
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Dockerfile for Portal Service
|
|
2
|
+
FROM node:20-alpine
|
|
3
|
+
|
|
4
|
+
# Set the working directory
|
|
5
|
+
WORKDIR /usr/gnar_engine/app
|
|
6
|
+
|
|
7
|
+
# Copy package.json and package-lock.json
|
|
8
|
+
COPY ./services/portal/package*.json ./
|
|
9
|
+
|
|
10
|
+
# Copy public directory
|
|
11
|
+
COPY ./services/portal/public ./public
|
|
12
|
+
|
|
13
|
+
# Copy local Lib packages
|
|
14
|
+
COPY ./Lib ./Lib
|
|
15
|
+
|
|
16
|
+
# Install app dependencies
|
|
17
|
+
RUN npm install
|
|
18
|
+
|
|
19
|
+
# Expose the port the service will run on
|
|
20
|
+
EXPOSE 3000
|
|
21
|
+
|
|
22
|
+
# Start the application
|
|
23
|
+
CMD ["npm", "run", "start"]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Step 1: Build the application
|
|
2
|
+
FROM node:20-alpine AS build
|
|
3
|
+
|
|
4
|
+
# Set working directory
|
|
5
|
+
WORKDIR /usr/gnar_engine/app
|
|
6
|
+
|
|
7
|
+
# Copy package.json and package-lock.json
|
|
8
|
+
COPY ./services/portal/package*.json ./
|
|
9
|
+
|
|
10
|
+
# Copy local Lib packages
|
|
11
|
+
COPY ./Lib ./Lib
|
|
12
|
+
|
|
13
|
+
# Copy the rest of the application code
|
|
14
|
+
COPY ./services/portal/src ./src
|
|
15
|
+
COPY ./services/portal/public ./public
|
|
16
|
+
|
|
17
|
+
# Copy front-end environment variables
|
|
18
|
+
ARG ENV_ENV=production
|
|
19
|
+
COPY .env.public.${ENV_ENV} ./.env
|
|
20
|
+
|
|
21
|
+
# Install app dependencies
|
|
22
|
+
RUN npm install
|
|
23
|
+
|
|
24
|
+
# Build the React application
|
|
25
|
+
RUN npm run build
|
|
26
|
+
|
|
27
|
+
# Step 2: Serve the application with Nginx
|
|
28
|
+
FROM nginx:alpine
|
|
29
|
+
|
|
30
|
+
# Copy custom Nginx config
|
|
31
|
+
COPY ./services/portal/nginx.conf /etc/nginx/conf.d/default.conf
|
|
32
|
+
|
|
33
|
+
# Copy the built assets from the build step
|
|
34
|
+
COPY --from=build /usr/gnar_engine/app/build /usr/share/nginx/html
|
|
35
|
+
|
|
36
|
+
# Expose the port for the web server
|
|
37
|
+
EXPOSE 3000
|
|
38
|
+
|
|
39
|
+
# Start the Nginx server to serve the app
|
|
40
|
+
CMD ["nginx", "-g", "daemon off;"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# School Consultancy Programme - Front End
|
|
2
|
+
|
|
3
|
+
React application for student tracking.
|
|
4
|
+
|
|
5
|
+
### Deploy
|
|
6
|
+
|
|
7
|
+
Build application locally and deploy with scp. Production server SSH access required.
|
|
8
|
+
|
|
9
|
+
``` bash
|
|
10
|
+
# Checkout local production branch
|
|
11
|
+
git branch checkout production
|
|
12
|
+
|
|
13
|
+
# Build
|
|
14
|
+
npm run build-style
|
|
15
|
+
npm run build
|
|
16
|
+
|
|
17
|
+
# Deploy
|
|
18
|
+
npm run deploy
|
|
19
|
+
|
|
20
|
+
# Clear production caches
|
|
21
|
+
|
|
22
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gnar_engine_portal",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@react-pdf/renderer": "^3.4.4",
|
|
7
|
+
"@reduxjs/toolkit": "^2.2.6",
|
|
8
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
9
|
+
"@testing-library/react": "^13.4.0",
|
|
10
|
+
"@testing-library/user-event": "^13.5.0",
|
|
11
|
+
"@gnar-engine/js-client": "file:/usr/gnar_engine/app/Lib/js-client",
|
|
12
|
+
"chart.js": "^4.4.3",
|
|
13
|
+
"crypto-js": "^4.2.0",
|
|
14
|
+
"html-to-image": "^1.11.11",
|
|
15
|
+
"react": "^18.3.1",
|
|
16
|
+
"react-axios": "^2.0.6",
|
|
17
|
+
"react-chartjs-2": "^5.2.0",
|
|
18
|
+
"react-datepicker": "^7.3.0",
|
|
19
|
+
"react-dom": "^18.3.1",
|
|
20
|
+
"react-redux": "^9.1.2",
|
|
21
|
+
"react-router-dom": "^6.24.0",
|
|
22
|
+
"react-scripts": "5.0.1",
|
|
23
|
+
"redux-toolkit": "^1.1.2",
|
|
24
|
+
"web-vitals": "^2.1.4"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
|
|
28
|
+
"less": "^4.2.0",
|
|
29
|
+
"lessc": "^1.0.2"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"start": "react-scripts start",
|
|
33
|
+
"build": "react-scripts build",
|
|
34
|
+
"test": "react-scripts test",
|
|
35
|
+
"eject": "react-scripts eject",
|
|
36
|
+
"build-style": "lessc src/styles/main.less src/css/style.css"
|
|
37
|
+
},
|
|
38
|
+
"eslintConfig": {
|
|
39
|
+
"extends": [
|
|
40
|
+
"react-app",
|
|
41
|
+
"react-app/jest"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"browserslist": {
|
|
45
|
+
"production": [
|
|
46
|
+
">0.2%",
|
|
47
|
+
"not dead",
|
|
48
|
+
"not op_mini all"
|
|
49
|
+
],
|
|
50
|
+
"development": [
|
|
51
|
+
"last 1 chrome version",
|
|
52
|
+
"last 1 firefox version",
|
|
53
|
+
"last 1 safari version"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"workspaces": [
|
|
57
|
+
"./Lib/*"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="icon" href="#" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<meta name="theme-color" content="#000000" />
|
|
8
|
+
<title>GNAR Engine</title>
|
|
9
|
+
<meta
|
|
10
|
+
name="description"
|
|
11
|
+
content="Gnar Engine."
|
|
12
|
+
/>
|
|
13
|
+
<link rel="apple-touch-icon" href="#" />
|
|
14
|
+
<!--
|
|
15
|
+
manifest.json provides metadata used when your web app is installed on a
|
|
16
|
+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
17
|
+
-->
|
|
18
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
19
|
+
<!--
|
|
20
|
+
Notice the use of %PUBLIC_URL% in the tags above.
|
|
21
|
+
It will be replaced with the URL of the `public` folder during the build.
|
|
22
|
+
Only files inside the `public` folder can be referenced from the HTML.
|
|
23
|
+
|
|
24
|
+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
25
|
+
work correctly both with client-side routing and a non-root public URL.
|
|
26
|
+
Learn how to configure a non-root public URL by running `npm run build`.
|
|
27
|
+
-->
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
+
<div id="root"></div>
|
|
32
|
+
<!--
|
|
33
|
+
This HTML file is a template.
|
|
34
|
+
If you open it directly in the browser, you will see an empty page.
|
|
35
|
+
|
|
36
|
+
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
+
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
+
|
|
39
|
+
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
+
-->
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
Binary file
|
|
Binary file
|