vintasend 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 (102) hide show
  1. package/.editorconfig +9 -0
  2. package/biome.json +34 -0
  3. package/package.json +13 -0
  4. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/Dockerfile +21 -0
  5. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/Dockerfile.notifications-worker +33 -0
  6. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/README.md +36 -0
  7. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/biome.json +46 -0
  8. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/components.json +21 -0
  9. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/docker-compose.yml +86 -0
  10. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.ts +7 -0
  11. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/package-lock.json +9552 -0
  12. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/package.json +55 -0
  13. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/postcss.config.mjs +8 -0
  14. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/public/file.svg +1 -0
  15. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/public/globe.svg +1 -0
  16. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/public/next.svg +1 -0
  17. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/public/vercel.svg +1 -0
  18. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/public/window.svg +1 -0
  19. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/schema.prisma +94 -0
  20. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.ts +21 -0
  21. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.ts +71 -0
  22. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.ts +68 -0
  23. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.ts +68 -0
  24. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.ts +80 -0
  25. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.ts +68 -0
  26. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.tsx +100 -0
  27. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.tsx +105 -0
  28. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.tsx +130 -0
  29. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.tsx +48 -0
  30. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.tsx +26 -0
  31. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/favicon.ico +0 -0
  32. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/globals.css +72 -0
  33. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.tsx +34 -0
  34. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.tsx +101 -0
  35. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.tsx +26 -0
  36. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.tsx +58 -0
  37. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.tsx +141 -0
  38. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.tsx +59 -0
  39. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.tsx +50 -0
  40. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.tsx +56 -0
  41. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.tsx +79 -0
  42. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.tsx +30 -0
  43. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.tsx +11 -0
  44. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.tsx +122 -0
  45. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.tsx +200 -0
  46. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.tsx +178 -0
  47. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.tsx +22 -0
  48. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.tsx +26 -0
  49. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.tsx +256 -0
  50. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.tsx +160 -0
  51. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.tsx +22 -0
  52. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.ts +76 -0
  53. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.ts +24 -0
  54. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/email.ts +1 -0
  55. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.ts +42 -0
  56. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/auth.ts +20 -0
  57. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.ts +16 -0
  58. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.ts +40 -0
  59. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.ts +16 -0
  60. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.ts +6 -0
  61. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.ts +29 -0
  62. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.ts +1 -0
  63. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/worker.ts +17 -0
  64. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.ts +21 -0
  65. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.ts +84 -0
  66. package/src/examples/nextjs-prisma-nodemailer-pug-temporal/tsconfig.json +27 -0
  67. package/src/implementations/vintasend-nodemailer/.editorconfig +9 -0
  68. package/src/implementations/vintasend-nodemailer/biome.json +34 -0
  69. package/src/implementations/vintasend-nodemailer/index.ts +1 -0
  70. package/src/implementations/vintasend-nodemailer/nodemailer-notification-adapter.ts +50 -0
  71. package/src/implementations/vintasend-nodemailer/package.json +17 -0
  72. package/src/implementations/vintasend-prisma/.editorconfig +9 -0
  73. package/src/implementations/vintasend-prisma/biome.json +34 -0
  74. package/src/implementations/vintasend-prisma/index.ts +1 -0
  75. package/src/implementations/vintasend-prisma/package.json +16 -0
  76. package/src/implementations/vintasend-prisma/prisma-notification-backend.ts +516 -0
  77. package/src/implementations/vintasend-prisma/schema.prisma.example +49 -0
  78. package/src/implementations/vintasend-pug/.editorconfig +9 -0
  79. package/src/implementations/vintasend-pug/biome.json +34 -0
  80. package/src/implementations/vintasend-pug/index.ts +1 -0
  81. package/src/implementations/vintasend-pug/package.json +17 -0
  82. package/src/implementations/vintasend-pug/pug-email-template-renderer.ts +34 -0
  83. package/src/implementations/vintasend-winston/.editorconfig +9 -0
  84. package/src/implementations/vintasend-winston/biome.json +34 -0
  85. package/src/implementations/vintasend-winston/index.ts +1 -0
  86. package/src/implementations/vintasend-winston/package.json +15 -0
  87. package/src/implementations/vintasend-winston/winston-logger.ts +29 -0
  88. package/src/index.ts +3 -0
  89. package/src/services/loggers/base-logger.ts +5 -0
  90. package/src/services/notification-adapters/base-notification-adapter.ts +20 -0
  91. package/src/services/notification-backends/base-notification-backend.ts +43 -0
  92. package/src/services/notification-context-registry.ts +46 -0
  93. package/src/services/notification-queue-service/base-notification-queue-service.ts +5 -0
  94. package/src/services/notification-service.ts +237 -0
  95. package/src/services/notification-template-renderers/base-email-template-renderer.ts +20 -0
  96. package/src/services/notification-template-renderers/base-notification-template-renderer.ts +7 -0
  97. package/src/types/identifier.ts +3 -0
  98. package/src/types/json-values.ts +25 -0
  99. package/src/types/notification-status.ts +6 -0
  100. package/src/types/notification-type.ts +1 -0
  101. package/src/types/notification.ts +59 -0
  102. package/src/types/uuid.ts +4 -0
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [{src,scripts}/**.{ts,json,js}]
4
+ end_of_line = crlf
5
+ charset = utf-8
6
+ trim_trailing_whitespace = true
7
+ insert_final_newline = true
8
+ indent_style = space
9
+ indent_size = 2
package/biome.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "ignore": []
11
+ },
12
+ "formatter": {
13
+ "enabled": true,
14
+ "indentStyle": "space",
15
+ "indentWidth": 2,
16
+ "lineWidth": 100
17
+ },
18
+ "organizeImports": {
19
+ "enabled": true
20
+ },
21
+ "linter": {
22
+ "enabled": true,
23
+ "rules": {
24
+ "recommended": true
25
+ }
26
+ },
27
+ "javascript": {
28
+ "formatter": {
29
+ "quoteStyle": "single",
30
+ "semicolons": "always",
31
+ "trailingCommas": "all"
32
+ }
33
+ }
34
+ }
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "vintasend",
3
+ "version": "0.1.0",
4
+ "scripts": {
5
+ "lint": "biome check .",
6
+ "format": "biome format .",
7
+ "check": "biome check --apply ."
8
+ },
9
+ "devDependencies": {
10
+ "@biomejs/biome": "1.9.4",
11
+ "@types/node": "^22.13.1"
12
+ }
13
+ }
@@ -0,0 +1,21 @@
1
+ FROM node:18-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ # Copy dependency definitions
6
+ COPY package*.json ./
7
+
8
+ # Install dependencies
9
+ RUN npm install
10
+
11
+ # Copy the rest of the application code
12
+ COPY . .
13
+
14
+ # Build the Next.js application
15
+ RUN npm run build
16
+
17
+ # Expose port 3000
18
+ EXPOSE 3000
19
+
20
+ # Start the app
21
+ CMD [ "npm", "start" ]
@@ -0,0 +1,33 @@
1
+
2
+ FROM node:18-alpine
3
+
4
+ WORKDIR /app
5
+
6
+ # Copy dependency definitions
7
+ COPY package*.json ./
8
+
9
+ # Install dependencies
10
+ RUN npm install
11
+
12
+ RUN mkdir -p src/vintasend-ts/services
13
+ RUN mkdir -p src/vintasend-ts/types
14
+ RUN mkdir -p src/vintasend-nodemailer
15
+ RUN mkdir -p src/vintasend-prisma
16
+ RUN mkdir -p src/vintasend-pug
17
+ RUN mkdir -p src/vintasend-winston
18
+
19
+ COPY ../../services ./src/vintasend-ts/services
20
+ COPY ../../types ./src/vintasend-ts/types
21
+ COPY ../../implementations/vintasend-nodemailer ./src/vintasend-nodemailer
22
+ COPY ../../implementations/vintasend-prisma ./src/vintasend-prisma
23
+ COPY ../../implementations/vintasend-pug ./src/vintasend-pug
24
+ COPY ../../implementations/vintasend-winston ./src/vintasend-winston
25
+
26
+ # Copy the rest of the application code
27
+ COPY . .
28
+
29
+ # Build the application
30
+ RUN npm run build
31
+
32
+ # Start the Temporal worker
33
+ CMD [ "npm", "run", "notifications-worker" ]
@@ -0,0 +1,36 @@
1
+ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "formatter": {
4
+ "enabled": true,
5
+ "indentStyle": "space",
6
+ "indentWidth": 2,
7
+ "lineWidth": 100
8
+ },
9
+ "organizeImports": {
10
+ "enabled": true
11
+ },
12
+ "linter": {
13
+ "enabled": true,
14
+ "rules": {
15
+ "recommended": true,
16
+ "correctness": {
17
+ "noUnusedVariables": "error",
18
+ "useHookAtTopLevel": "error",
19
+ "noUnusedPrivateClassMembers": "error",
20
+ "noVoidElementsWithChildren": "error",
21
+ "noChildrenProp": "error"
22
+ },
23
+ "suspicious": {
24
+ "noExplicitAny": "error",
25
+ "noArrayIndexKey": "error",
26
+ "noConsoleLog": "error"
27
+ },
28
+ "security": {
29
+ "noDangerouslySetInnerHtml": "error"
30
+ },
31
+ "a11y": {
32
+ "useButtonType": "error",
33
+ "useValidAnchor": "error",
34
+ "noSvgWithoutTitle": "error",
35
+ "useKeyWithClickEvents": "error"
36
+ }
37
+ }
38
+ },
39
+ "javascript": {
40
+ "formatter": {
41
+ "quoteStyle": "single",
42
+ "semicolons": "always",
43
+ "trailingCommas": "all"
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "default",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "tailwind.config.ts",
8
+ "css": "src/app/globals.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/components/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide"
21
+ }
@@ -0,0 +1,86 @@
1
+ version: '3.8'
2
+ services:
3
+ app:
4
+ build:
5
+ context: .
6
+ dockerfile: Dockerfile
7
+ ports:
8
+ - "3000:3000"
9
+ environment:
10
+ - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/app_db?schema=public
11
+ - MAIL_HOST=mailpit
12
+ - MAIL_PORT=1025
13
+ depends_on:
14
+ - postgres
15
+ - mailpit
16
+ volumes:
17
+ - ./:/app
18
+
19
+ worker:
20
+ build:
21
+ context: .
22
+ dockerfile: Dockerfile.notifications-worker
23
+ environment:
24
+ - TEMPORAL_ADDRESS=temporal:7233
25
+ depends_on:
26
+ - temporal
27
+ - mailpit
28
+ volumes:
29
+ - ./:/app
30
+
31
+ temporal:
32
+ image: temporalio/auto-setup:1.20.0
33
+ ports:
34
+ - "7233:7233"
35
+ - "8233:8233"
36
+ environment:
37
+ - DB=postgresql
38
+ - DB_PORT=5432
39
+ - POSTGRES_USER=temporal
40
+ - POSTGRES_PWD=temporal
41
+ - POSTGRES_SEEDS=temporal-postgresql:5432
42
+ - DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml
43
+ depends_on:
44
+ - temporal-postgresql
45
+
46
+ temporal-postgresql:
47
+ image: postgres:13
48
+ environment:
49
+ POSTGRES_USER: temporal
50
+ POSTGRES_PASSWORD: temporal
51
+ POSTGRES_DB: temporal
52
+ volumes:
53
+ - temporal-pgdata:/var/lib/postgresql/data
54
+
55
+ temporal-web:
56
+ image: temporalio/web:1.15.0
57
+ environment:
58
+ - TEMPORAL_GRPC_ENDPOINT=temporal:7233
59
+ - TEMPORAL_PERMIT_WRITE_API=true
60
+ ports:
61
+ - "8088:8088"
62
+ depends_on:
63
+ - temporal
64
+
65
+ postgres:
66
+ image: postgres:13
67
+ restart: always
68
+ environment:
69
+ POSTGRES_USER: postgres
70
+ POSTGRES_PASSWORD: postgres
71
+ POSTGRES_DB: app_db
72
+ ports:
73
+ - "5432:5432"
74
+ volumes:
75
+ - pgdata:/var/lib/postgresql/data
76
+
77
+ mailpit:
78
+ image: axllent/mailpit
79
+ restart: always
80
+ ports:
81
+ - "1025:1025" # SMTP
82
+ - "8025:8025" # Web UI
83
+
84
+ volumes:
85
+ pgdata:
86
+ temporal-pgdata:
@@ -0,0 +1,7 @@
1
+ import type { NextConfig } from "next";
2
+
3
+ const nextConfig: NextConfig = {
4
+ /* config options here */
5
+ };
6
+
7
+ export default nextConfig;