startx 0.0.1 → 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.
Files changed (154) hide show
  1. package/.prettierignore +0 -13
  2. package/.prettierrc.js +52 -52
  3. package/.vscode/launch.json +32 -0
  4. package/.vscode/settings.json +9 -3
  5. package/apps/core-server/.env.example +18 -24
  6. package/apps/core-server/Dockerfile +35 -61
  7. package/apps/core-server/eslint.config.ts +7 -0
  8. package/apps/core-server/package.json +41 -52
  9. package/apps/core-server/src/config/custom-type.ts +2 -40
  10. package/apps/core-server/src/events/index.ts +37 -37
  11. package/apps/core-server/src/index.ts +4 -13
  12. package/apps/core-server/src/middlewares/auth-middleware.ts +24 -7
  13. package/apps/core-server/src/middlewares/cors-middleware.ts +7 -6
  14. package/apps/core-server/src/middlewares/error-middleware.ts +7 -4
  15. package/apps/core-server/src/middlewares/logger-middleware.ts +81 -21
  16. package/apps/core-server/src/middlewares/notfound-middleware.ts +6 -14
  17. package/apps/core-server/src/middlewares/serve-static.ts +30 -24
  18. package/apps/core-server/src/routes/files/router.ts +9 -7
  19. package/apps/core-server/src/routes/server.ts +30 -36
  20. package/apps/core-server/tsdown.config.ts +4 -3
  21. package/biome.json +58 -60
  22. package/configs/eslint-config/package.json +16 -19
  23. package/configs/eslint-config/src/configs/base.ts +185 -225
  24. package/configs/eslint-config/src/configs/extend.ts +3 -0
  25. package/configs/eslint-config/src/configs/frontend.ts +81 -56
  26. package/configs/eslint-config/src/configs/node.ts +6 -6
  27. package/configs/eslint-config/src/plugin.ts +1 -0
  28. package/configs/eslint-config/src/rules/index.ts +8 -12
  29. package/configs/eslint-config/src/rules/no-json-parse-json-stringify.test.ts +30 -17
  30. package/configs/eslint-config/src/rules/no-json-parse-json-stringify.ts +52 -49
  31. package/configs/eslint-config/src/rules/no-uncaught-json-parse.ts +43 -45
  32. package/configs/tsdown-config/package.json +10 -3
  33. package/configs/typescript-config/package.json +10 -1
  34. package/configs/typescript-config/tsconfig.common.json +3 -3
  35. package/configs/vitest-config/dist/base.mjs +1 -0
  36. package/configs/vitest-config/dist/frontend.mjs +1 -0
  37. package/configs/vitest-config/dist/node.mjs +1 -0
  38. package/configs/vitest-config/package.json +12 -0
  39. package/configs/vitest-config/src/base.ts +17 -29
  40. package/configs/vitest-config/src/index.ts +1 -0
  41. package/package.json +21 -13
  42. package/packages/@repo/constants/eslint.config.ts +4 -0
  43. package/packages/@repo/constants/package.json +16 -0
  44. package/packages/@repo/constants/src/index.ts +8 -8
  45. package/packages/@repo/db/eslint.config.ts +4 -0
  46. package/packages/@repo/db/package.json +16 -8
  47. package/packages/@repo/db/src/index.ts +26 -20
  48. package/packages/@repo/db/src/schema/common.ts +45 -49
  49. package/packages/@repo/env/eslint.config.ts +4 -0
  50. package/packages/@repo/env/package.json +39 -0
  51. package/packages/@repo/env/src/default-env.ts +12 -0
  52. package/packages/@repo/env/src/define-env.ts +70 -0
  53. package/packages/@repo/env/src/index.ts +2 -0
  54. package/packages/@repo/env/src/utils.ts +52 -0
  55. package/packages/@repo/env/tsconfig.json +7 -0
  56. package/packages/@repo/lib/eslint.config.ts +4 -0
  57. package/packages/@repo/lib/package.json +34 -34
  58. package/packages/@repo/lib/src/bucket-module/file-storage.ts +50 -49
  59. package/packages/@repo/lib/src/bucket-module/index.ts +3 -0
  60. package/packages/@repo/lib/src/bucket-module/s3-storage.ts +120 -114
  61. package/packages/@repo/lib/src/bucket-module/utils.ts +10 -11
  62. package/packages/@repo/lib/src/{cookie-module.ts → cookie-module/cookie-module.ts} +48 -42
  63. package/packages/@repo/lib/src/cookie-module/index.ts +1 -0
  64. package/packages/@repo/lib/src/extra/index.ts +1 -0
  65. package/packages/@repo/lib/src/extra/pagination-module.ts +35 -0
  66. package/packages/@repo/lib/src/{token-module.ts → extra/token-module.ts} +12 -5
  67. package/packages/@repo/lib/src/file-system-module/index.ts +170 -0
  68. package/packages/@repo/lib/src/{hashing-module.ts → hashing-module/index.ts} +9 -9
  69. package/packages/@repo/lib/src/index.ts +0 -26
  70. package/packages/@repo/lib/src/mail-module/index.ts +2 -0
  71. package/packages/@repo/lib/src/mail-module/mock.ts +8 -8
  72. package/packages/@repo/lib/src/mail-module/nodemailer.ts +17 -7
  73. package/packages/@repo/lib/src/notification-module/index.ts +1 -172
  74. package/packages/@repo/lib/src/notification-module/push-notification.ts +97 -90
  75. package/packages/@repo/lib/src/{oauth2-client.ts → oauth2-module/index.ts} +107 -109
  76. package/packages/@repo/lib/src/otp-module/index.ts +91 -0
  77. package/packages/@repo/lib/src/session-module/index.ts +113 -0
  78. package/packages/@repo/lib/src/utils.ts +43 -42
  79. package/packages/@repo/lib/src/validation-module/index.ts +242 -0
  80. package/packages/@repo/logger/eslint.config.ts +4 -0
  81. package/packages/@repo/logger/package.json +40 -0
  82. package/packages/@repo/logger/src/index.ts +2 -0
  83. package/packages/@repo/logger/src/logger.ts +72 -0
  84. package/packages/@repo/{lib/src/logger-module → logger/src}/memory-profiler.ts +64 -65
  85. package/packages/@repo/logger/tsconfig.json +7 -0
  86. package/packages/@repo/mail/eslint.config.ts +4 -0
  87. package/packages/@repo/mail/package.json +10 -3
  88. package/packages/@repo/mail/src/emails/admin/OtpEmail.tsx +169 -168
  89. package/packages/@repo/mail/src/index.ts +1 -2
  90. package/packages/@repo/mail/tsconfig.json +3 -3
  91. package/packages/@repo/redis/dist/index.d.mts +3 -0
  92. package/packages/@repo/redis/dist/index.mjs +5 -0
  93. package/packages/@repo/redis/dist/lib/redis-client.d.mts +7 -0
  94. package/packages/@repo/redis/dist/lib/redis-client.mjs +25 -0
  95. package/packages/@repo/redis/dist/lib/redis-client.mjs.map +1 -0
  96. package/packages/@repo/redis/dist/lib/redis-module.d.mts +5 -0
  97. package/packages/@repo/redis/dist/lib/redis-module.mjs +6 -0
  98. package/packages/@repo/redis/dist/lib/redis-module.mjs.map +1 -0
  99. package/packages/@repo/redis/eslint.config.ts +4 -0
  100. package/packages/@repo/redis/package.json +13 -10
  101. package/packages/@repo/redis/src/index.ts +2 -2
  102. package/packages/@repo/redis/src/lib/redis-client.ts +36 -23
  103. package/packages/@repo/redis/src/lib/redis-module.ts +69 -3
  104. package/packages/cli/dist/index.mjs +203 -0
  105. package/packages/cli/eslint.config.ts +4 -0
  106. package/packages/cli/package.json +44 -0
  107. package/packages/cli/tsconfig.json +12 -0
  108. package/packages/cli/tsdown.config.ts +17 -0
  109. package/packages/ui/components.json +0 -1
  110. package/packages/ui/eslint.config.ts +4 -0
  111. package/packages/ui/package.json +16 -3
  112. package/packages/ui/postcss.config.mjs +9 -9
  113. package/packages/ui/src/components/lib/utils.ts +53 -53
  114. package/packages/ui/src/components/ui/alert-dialog.tsx +118 -116
  115. package/packages/ui/src/components/ui/avatar.tsx +52 -53
  116. package/packages/ui/src/components/ui/badge.tsx +45 -46
  117. package/packages/ui/src/components/ui/breadcrumb.tsx +108 -109
  118. package/packages/ui/src/components/ui/card.tsx +91 -92
  119. package/packages/ui/src/components/ui/carousel.tsx +243 -243
  120. package/packages/ui/src/components/ui/checkbox.tsx +32 -32
  121. package/packages/ui/src/components/ui/command.tsx +144 -155
  122. package/packages/ui/src/components/ui/dialog.tsx +124 -127
  123. package/packages/ui/src/components/ui/form.tsx +166 -165
  124. package/packages/ui/src/components/ui/input-otp.tsx +74 -76
  125. package/packages/ui/src/components/ui/input.tsx +19 -21
  126. package/packages/ui/src/components/ui/multiple-select.tsx +4 -4
  127. package/packages/ui/src/{components/lucide.tsx → lucide.ts} +3 -3
  128. package/packages/ui/tailwind.config.ts +94 -94
  129. package/packages/ui/tsconfig.json +7 -1
  130. package/pnpm-workspace.yaml +41 -1
  131. package/turbo.json +20 -27
  132. package/apps/core-server/eslint.config.mjs +0 -47
  133. package/configs/eslint-config/src/rules/no-dynamic-import-template.ts +0 -32
  134. package/configs/eslint-config/src/rules/no-plain-errors.ts +0 -50
  135. package/configs/eslint-config/tsdown.config.ts +0 -11
  136. package/packages/@repo/constants/eslint.config.mjs +0 -21
  137. package/packages/@repo/db/eslint.config.mjs +0 -21
  138. package/packages/@repo/lib/eslint.config.mjs +0 -49
  139. package/packages/@repo/lib/src/command-module.ts +0 -77
  140. package/packages/@repo/lib/src/constants.ts +0 -3
  141. package/packages/@repo/lib/src/custom-type.ts +0 -54
  142. package/packages/@repo/lib/src/env.ts +0 -13
  143. package/packages/@repo/lib/src/file-system/index.ts +0 -90
  144. package/packages/@repo/lib/src/logger-module/log-config.ts +0 -16
  145. package/packages/@repo/lib/src/logger-module/logger.ts +0 -78
  146. package/packages/@repo/lib/src/mail-module/api.ts +0 -0
  147. package/packages/@repo/lib/src/otp-module.ts +0 -98
  148. package/packages/@repo/lib/src/pagination-module.ts +0 -49
  149. package/packages/@repo/lib/src/user-session.ts +0 -117
  150. package/packages/@repo/lib/src/validation-module.ts +0 -187
  151. package/packages/@repo/mail/tsconfig.build.json +0 -14
  152. package/packages/@repo/mail/tsdown.config.ts +0 -9
  153. package/packages/@repo/redis/eslint.config.mjs +0 -8
  154. package/packages/ui/eslint.config.mjs +0 -18
@@ -1,65 +1,64 @@
1
-
2
- export class MemoryProfiler {
3
- private startUsage: number | null = null;
4
- private lastUsage: number | null = null;
5
- private totalDelta = 0;
6
- private state: "off" | "on" = "on";
7
- private startTime: number | null = null;
8
- private lastTime: number | null = null;
9
-
10
- setState(state: "on" | "off") {
11
- this.state = state;
12
- }
13
-
14
- start(): void {
15
- const usage = process.memoryUsage().heapUsed;
16
- const now = Date.now();
17
- this.startUsage = usage;
18
- this.lastUsage = usage;
19
- this.startTime = now;
20
- this.lastTime = now;
21
- this.totalDelta = 0;
22
-
23
- if (this.state === "off") return;
24
- console.log(`[Profiler] Started at ${this.formatMB(usage)}`);
25
- }
26
-
27
- at(label: string = ""): void {
28
- if (this.startUsage === null || this.startTime === null) {
29
- throw new Error("Profiler not started. Call .start() first.");
30
- }
31
-
32
- const usage = process.memoryUsage().heapUsed;
33
- const now = Date.now();
34
-
35
- const deltaFromStart = usage - this.startUsage;
36
- const deltaFromLast = usage - (this.lastUsage ?? usage);
37
-
38
- const timeFromStart = now - this.startTime;
39
- const timeFromLast = now - (this.lastTime ?? now);
40
-
41
- this.totalDelta = deltaFromStart;
42
-
43
- if (this.state === "on") {
44
- console.log(
45
- `[Profiler] ${label ? label + " - " : ""}` +
46
- `since start: ${this.formatMB(deltaFromStart)} | ${this.formatMS(timeFromStart)}, ` +
47
- `since last: ${this.formatMB(deltaFromLast)} | ${this.formatMS(timeFromLast)}, ` +
48
- `current heap: ${this.formatMB(usage)}`
49
- );
50
- }
51
-
52
- this.lastUsage = usage;
53
- this.lastTime = now;
54
- }
55
-
56
- private formatMB(bytes: number): string {
57
- return (bytes / 1024 / 1024).toFixed(2) + " MB";
58
- }
59
-
60
- private formatMS(ms: number): string {
61
- if (ms < 1000) return `${ms} ms`;
62
- const sec = (ms / 1000).toFixed(2);
63
- return `${sec} s`;
64
- }
65
- }
1
+ import { logger } from "./logger.js";
2
+
3
+ export class MemoryProfiler {
4
+ private startUsage: number | null = null;
5
+ private lastUsage: number | null = null;
6
+ private startTime: number | null = null;
7
+ private lastTime: number | null = null;
8
+ private state: "off" | "on" = "on";
9
+
10
+ setState(state: "on" | "off") {
11
+ this.state = state;
12
+ }
13
+
14
+ start(): void {
15
+ const usage = process.memoryUsage().heapUsed;
16
+ const now = Date.now();
17
+
18
+ this.startUsage = usage;
19
+ this.lastUsage = usage;
20
+ this.startTime = now;
21
+ this.lastTime = now;
22
+
23
+ if (this.state === "off") return;
24
+
25
+ logger.info("Profiler started", {
26
+ logType: "steps",
27
+ heap: this.formatMB(usage),
28
+ });
29
+ }
30
+
31
+ at(label = ""): void {
32
+ if (!this.startUsage || !this.startTime) {
33
+ throw new Error("Profiler not started. Call .start() first.");
34
+ }
35
+
36
+ const usage = process.memoryUsage().heapUsed;
37
+ const now = Date.now();
38
+
39
+ const deltaFromStart = usage - this.startUsage;
40
+ const deltaFromLast = usage - (this.lastUsage ?? usage);
41
+
42
+ const timeFromStart = now - this.startTime;
43
+ const timeFromLast = now - (this.lastTime ?? now);
44
+
45
+ if (this.state === "on") {
46
+ logger.info("Profiler checkpoint", {
47
+ logType: "steps",
48
+ label,
49
+ sinceStartMB: this.formatMB(deltaFromStart),
50
+ sinceLastMB: this.formatMB(deltaFromLast),
51
+ sinceStartMS: timeFromStart,
52
+ sinceLastMS: timeFromLast,
53
+ currentHeap: this.formatMB(usage),
54
+ });
55
+ }
56
+
57
+ this.lastUsage = usage;
58
+ this.lastTime = now;
59
+ }
60
+
61
+ private formatMB(bytes: number): number {
62
+ return Number((bytes / 1024 / 1024).toFixed(2));
63
+ }
64
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "typescript-config/tsconfig.node.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "./src"
5
+ },
6
+ "include": ["src/**/*.ts"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { baseConfig } from "eslint-config/base";
2
+ import { extend } from "eslint-config/extend";
3
+
4
+ export default extend(baseConfig);
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@repo/email",
2
+ "name": "@repo/mail",
3
3
  "type": "module",
4
4
  "version": "1.0.0",
5
5
  "description": "",
@@ -14,8 +14,7 @@
14
14
  "@react-email/preview-server": "catalog:",
15
15
  "@types/react": "catalog:",
16
16
  "@types/react-dom": "catalog:",
17
- "react-email": "catalog:",
18
- "tsdown-config": "workspace:*"
17
+ "react-email": "catalog:"
19
18
  },
20
19
  "dependencies": {
21
20
  "@react-email/components": "catalog:",
@@ -25,5 +24,13 @@
25
24
  "react": "catalog:",
26
25
  "react-dom": "catalog:",
27
26
  "typescript-config": "workspace:*"
27
+ },
28
+ "startx": {
29
+ "tags": [
30
+ "node"
31
+ ],
32
+ "requiredDevDeps": [
33
+ "typescript-config"
34
+ ]
28
35
  }
29
36
  }
@@ -1,168 +1,169 @@
1
- import {
2
- Body,
3
- Container,
4
- Font,
5
- Head,
6
- Heading,
7
- Hr,
8
- Html,
9
- Img,
10
- Link,
11
- Preview,
12
- Section,
13
- Text,
14
- } from "@react-email/components";
15
-
16
- export default function VerifyEmailOtp({
17
- verificationCode = "596853",
18
- }: {
19
- verificationCode: string;
20
- }) {
21
- return (
22
- <Html>
23
- <Head>
24
- <Font
25
- fontFamily="Public Sans"
26
- fallbackFontFamily="Helvetica"
27
- webFont={{
28
- url: "https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600&display=swap",
29
- format: "woff2",
30
- }}
31
- fontWeight={400}
32
- fontStyle="normal"
33
- />
34
- </Head>{" "}
35
- <Body style={main}>
36
- <Preview>App verification</Preview>
37
- <Container style={container}>
38
- <Section style={coverSection}>
39
- <Section style={{ paddingInline: "35px", paddingTop: "12px" }}>
40
- <Img
41
- src={`${"https://app.com"}/logo/app-logo.png`}
42
- alt="App"
43
- // width="64"
44
- height="24px"
45
- />
46
- </Section>
47
- <Section style={upperSection}>
48
- <Heading style={h1}>Verify your email address</Heading>
49
- <Text style={mainText}>Your One-Time Password (OTP) for logging into App is:</Text>
50
- <Section style={verificationSection}>
51
- <Text style={verifyText}>Verification code</Text>
52
-
53
- <Text style={codeText}>{verificationCode}</Text>
54
- </Section>
55
- </Section>
56
- <Hr />
57
- <Section style={lowerSection}>
58
- <Text style={cautionText}>
59
- This OTP is valid for 10 minutes. Please do not share this code with anyone for
60
- security reasons. If you did not request this, please ignore this email or contact
61
- our support team immediately.
62
- </Text>
63
- </Section>
64
- </Section>
65
- <Text style={footerText}>
66
- This message was produced and distributed by App, Ltd.{" "}
67
- <Link href="https://app.com" target="_blank" style={link}>
68
- App.com
69
- </Link>
70
- <br />
71
- View our{" "}
72
- <Link href="https://app.com/privacy-policy" target="_blank" style={link}>
73
- privacy policy
74
- </Link>
75
- .
76
- </Text>
77
- </Container>
78
- </Body>
79
- </Html>
80
- );
81
- }
82
-
83
- const main = {
84
- backgroundColor: "#fff",
85
- color: "#212121",
86
- };
87
-
88
- const container = {
89
- padding: "20px",
90
- margin: "0 auto",
91
- backgroundColor: "#eee",
92
- };
93
-
94
- const h1 = {
95
- color: "#333",
96
- fontFamily:
97
- "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
98
- fontSize: "20px",
99
- fontWeight: "bold",
100
- marginBottom: "15px",
101
- };
102
-
103
- const link = {
104
- color: "#2754C5",
105
- fontFamily:
106
- "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
107
- fontSize: "14px",
108
- textDecoration: "underline",
109
- };
110
-
111
- const text = {
112
- color: "#333",
113
- fontFamily:
114
- "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
115
- fontSize: "14px",
116
- margin: "24px 0",
117
- };
118
-
119
- const imageSection = {
120
- backgroundColor: "#fff",
121
- display: "flex",
122
- padding: "20px 0",
123
- alignItems: "center",
124
- justifyContent: "center",
125
- };
126
-
127
- const coverSection = { backgroundColor: "#fff" };
128
-
129
- const upperSection = { padding: "12px 35px" };
130
-
131
- const lowerSection = { padding: "25px 35px" };
132
-
133
- const footerText = {
134
- ...text,
135
- fontSize: "12px",
136
- padding: "0 20px",
137
- };
138
-
139
- const verifyText = {
140
- ...text,
141
- margin: 0,
142
- fontWeight: "bold",
143
- textAlign: "center" as const,
144
- };
145
-
146
- const codeText = {
147
- ...text,
148
- fontWeight: "bold",
149
- fontSize: "36px",
150
- margin: "10px 0",
151
- textAlign: "center" as const,
152
- };
153
-
154
- const validityText = {
155
- ...text,
156
- margin: "0px",
157
- textAlign: "center" as const,
158
- };
159
-
160
- const verificationSection = {
161
- display: "flex",
162
- alignItems: "center",
163
- justifyContent: "center",
164
- };
165
-
166
- const mainText = { ...text, marginBottom: "14px" };
167
-
168
- const cautionText = { ...text, margin: "0px" };
1
+ import {
2
+ Body,
3
+ Container,
4
+ Font,
5
+ Head,
6
+ Heading,
7
+ Hr,
8
+ Html,
9
+ Img,
10
+ Link,
11
+ Preview,
12
+ Section,
13
+ Text,
14
+ } from "@react-email/components";
15
+ import React from "react";
16
+
17
+ export default function VerifyEmailOtp({
18
+ verificationCode = "596853",
19
+ }: {
20
+ verificationCode: string;
21
+ }) {
22
+ return (
23
+ <Html>
24
+ <Head>
25
+ <Font
26
+ fontFamily="Public Sans"
27
+ fallbackFontFamily="Helvetica"
28
+ webFont={{
29
+ url: "https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600&display=swap",
30
+ format: "woff2",
31
+ }}
32
+ fontWeight={400}
33
+ fontStyle="normal"
34
+ />
35
+ </Head>{" "}
36
+ <Body style={main}>
37
+ <Preview>App verification</Preview>
38
+ <Container style={container}>
39
+ <Section style={coverSection}>
40
+ <Section style={{ paddingInline: "35px", paddingTop: "12px" }}>
41
+ <Img
42
+ src={`${"https://app.com"}/logo/app-logo.png`}
43
+ alt="App"
44
+ // width="64"
45
+ height="24px"
46
+ />
47
+ </Section>
48
+ <Section style={upperSection}>
49
+ <Heading style={h1}>Verify your email address</Heading>
50
+ <Text style={mainText}>Your One-Time Password (OTP) for logging into App is:</Text>
51
+ <Section style={verificationSection}>
52
+ <Text style={verifyText}>Verification code</Text>
53
+
54
+ <Text style={codeText}>{verificationCode}</Text>
55
+ </Section>
56
+ </Section>
57
+ <Hr />
58
+ <Section style={lowerSection}>
59
+ <Text style={cautionText}>
60
+ This OTP is valid for 10 minutes. Please do not share this code with anyone for
61
+ security reasons. If you did not request this, please ignore this email or contact
62
+ our support team immediately.
63
+ </Text>
64
+ </Section>
65
+ </Section>
66
+ <Text style={footerText}>
67
+ This message was produced and distributed by App, Ltd.{" "}
68
+ <Link href="https://app.com" target="_blank" style={link}>
69
+ App.com
70
+ </Link>
71
+ <br />
72
+ View our{" "}
73
+ <Link href="https://app.com/privacy-policy" target="_blank" style={link}>
74
+ privacy policy
75
+ </Link>
76
+ .
77
+ </Text>
78
+ </Container>
79
+ </Body>
80
+ </Html>
81
+ );
82
+ }
83
+
84
+ const main = {
85
+ backgroundColor: "#fff",
86
+ color: "#212121",
87
+ };
88
+
89
+ const container = {
90
+ padding: "20px",
91
+ margin: "0 auto",
92
+ backgroundColor: "#eee",
93
+ };
94
+
95
+ const h1 = {
96
+ color: "#333",
97
+ fontFamily:
98
+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
99
+ fontSize: "20px",
100
+ fontWeight: "bold",
101
+ marginBottom: "15px",
102
+ };
103
+
104
+ const link = {
105
+ color: "#2754C5",
106
+ fontFamily:
107
+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
108
+ fontSize: "14px",
109
+ textDecoration: "underline",
110
+ };
111
+
112
+ const text = {
113
+ color: "#333",
114
+ fontFamily:
115
+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
116
+ fontSize: "14px",
117
+ margin: "24px 0",
118
+ };
119
+
120
+ const imageSection = {
121
+ backgroundColor: "#fff",
122
+ display: "flex",
123
+ padding: "20px 0",
124
+ alignItems: "center",
125
+ justifyContent: "center",
126
+ };
127
+
128
+ const coverSection = { backgroundColor: "#fff" };
129
+
130
+ const upperSection = { padding: "12px 35px" };
131
+
132
+ const lowerSection = { padding: "25px 35px" };
133
+
134
+ const footerText = {
135
+ ...text,
136
+ fontSize: "12px",
137
+ padding: "0 20px",
138
+ };
139
+
140
+ const verifyText = {
141
+ ...text,
142
+ margin: 0,
143
+ fontWeight: "bold",
144
+ textAlign: "center" as const,
145
+ };
146
+
147
+ const codeText = {
148
+ ...text,
149
+ fontWeight: "bold",
150
+ fontSize: "36px",
151
+ margin: "10px 0",
152
+ textAlign: "center" as const,
153
+ };
154
+
155
+ const validityText = {
156
+ ...text,
157
+ margin: "0px",
158
+ textAlign: "center" as const,
159
+ };
160
+
161
+ const verificationSection = {
162
+ display: "flex",
163
+ alignItems: "center",
164
+ justifyContent: "center",
165
+ };
166
+
167
+ const mainText = { ...text, marginBottom: "14px" };
168
+
169
+ const cautionText = { ...text, margin: "0px" };
@@ -1,13 +1,12 @@
1
1
  import { render } from "@react-email/render";
2
2
 
3
3
  import VerifyEmailOtp from "./emails/admin/OtpEmail.js";
4
-
5
4
  export class AdminEmailTemplate {
6
5
  static getOtpEmail = async (props: { otp: string }) => {
7
6
  return await render(
8
7
  VerifyEmailOtp({
9
8
  verificationCode: props.otp,
10
- }),
9
+ })
11
10
  );
12
11
  };
13
12
  }
@@ -1,13 +1,13 @@
1
1
  {
2
- "extends": "typescript-config/tsconfig.common.json",
2
+ "extends": "typescript-config/tsconfig.frontend.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": ".",
5
5
  "types": ["node"],
6
6
  "baseUrl": "src",
7
- "jsx": "react-jsx",
7
+ "jsx": "react",
8
8
  "tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
9
9
  "experimentalDecorators": true,
10
10
  "emitDecoratorMetadata": true
11
11
  },
12
- "include": ["src/**/*.ts"]
12
+ "include": ["src/**/*.ts", "src/**/*.tsx"]
13
13
  }
@@ -0,0 +1,3 @@
1
+ import { redisClient } from "./lib/redis-client.mjs";
2
+ export * from "ioredis";
3
+ export { redisClient };
@@ -0,0 +1,5 @@
1
+ import { redisClient } from "./lib/redis-client.mjs";
2
+
3
+ export * from "ioredis"
4
+
5
+ export { redisClient };
@@ -0,0 +1,7 @@
1
+ import { Redis } from "ioredis";
2
+
3
+ //#region src/lib/redis-client.d.ts
4
+ declare const redisClient: Redis;
5
+ //#endregion
6
+ export { redisClient };
7
+ //# sourceMappingURL=redis-client.d.mts.map
@@ -0,0 +1,25 @@
1
+ import { Redis } from "ioredis";
2
+
3
+ //#region src/lib/redis-client.ts
4
+ const redisClient = new Redis({
5
+ host: process.env.REDIS_HOST,
6
+ port: Number(process.env.REDIS_PORT),
7
+ username: process.env.REDIS_USERNAME,
8
+ password: process.env.REDIS_PASSWORD
9
+ });
10
+ function setEventListeners() {
11
+ redisClient.on("error", (error) => {
12
+ console.log("Could not establish a connection with redis. " + error);
13
+ });
14
+ redisClient.on("connect", (error) => {
15
+ if (error) {
16
+ console.log("Could not establish a connection with redis. " + error);
17
+ }
18
+ console.log("Connected to redis successfully");
19
+ });
20
+ }
21
+ setEventListeners();
22
+
23
+ //#endregion
24
+ export { redisClient };
25
+ //# sourceMappingURL=redis-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-client.mjs","names":[],"sources":["../../src/lib/redis-client.ts"],"sourcesContent":["import { Redis } from \"ioredis\";\r\n\r\nexport const redisClient = new Redis({\r\n host: process.env.REDIS_HOST,\r\n port: Number(process.env.REDIS_PORT),\r\n username: process.env.REDIS_USERNAME,\r\n password: process.env.REDIS_PASSWORD,\r\n});\r\n\r\nfunction setEventListeners() {\r\n redisClient.on(\"error\", (error: string) => {\r\n console.log(\"Could not establish a connection with redis. \" + error);\r\n });\r\n redisClient.on(\"connect\", (error: string) => {\r\n if (error) {\r\n console.log(\"Could not establish a connection with redis. \" + error);\r\n }\r\n console.log(\"Connected to redis successfully\");\r\n });\r\n}\r\n\r\nsetEventListeners();\r\n\r\n"],"mappings":";;;AAEA,MAAa,cAAc,IAAI,MAAM;CACnC,MAAM,QAAQ,IAAI;CAClB,MAAM,OAAO,QAAQ,IAAI,WAAW;CACpC,UAAU,QAAQ,IAAI;CACtB,UAAU,QAAQ,IAAI;CACvB,CAAC;AAEF,SAAS,oBAAoB;AAC3B,aAAY,GAAG,UAAU,UAAkB;AACzC,UAAQ,IAAI,kDAAkD,MAAM;GACpE;AACF,aAAY,GAAG,YAAY,UAAkB;AAC3C,MAAI,OAAO;AACT,WAAQ,IAAI,kDAAkD,MAAM;;AAEtE,UAAQ,IAAI,kCAAkC;GAC9C;;AAGJ,mBAAmB"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/redis-module.d.ts
2
+ declare class RedisModule {}
3
+ //#endregion
4
+ export { RedisModule };
5
+ //# sourceMappingURL=redis-module.d.mts.map
@@ -0,0 +1,6 @@
1
+ //#region src/lib/redis-module.ts
2
+ var RedisModule = class {};
3
+
4
+ //#endregion
5
+ export { RedisModule };
6
+ //# sourceMappingURL=redis-module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-module.mjs","names":[],"sources":["../../src/lib/redis-module.ts"],"sourcesContent":["export class RedisModule {\r\n //\r\n}\r\n"],"mappings":";AAAA,IAAa,cAAb,MAAyB"}
@@ -0,0 +1,4 @@
1
+ import { baseConfig } from "eslint-config/base";
2
+ import { extend } from "eslint-config/extend";
3
+
4
+ export default extend(baseConfig);