@bernierllc/email 1.0.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 (53) hide show
  1. package/.eslintrc.json +112 -0
  2. package/.flake8 +18 -0
  3. package/.github/workflows/ci.yml +300 -0
  4. package/EXTRACTION_SUMMARY.md +265 -0
  5. package/IMPLEMENTATION_STATUS.md +159 -0
  6. package/LICENSE +7 -0
  7. package/OPEN_SOURCE_SETUP.md +420 -0
  8. package/PACKAGE_USAGE.md +471 -0
  9. package/README.md +232 -0
  10. package/examples/fastapi-example/main.py +257 -0
  11. package/examples/nextjs-example/next-env.d.ts +13 -0
  12. package/examples/nextjs-example/package.json +26 -0
  13. package/examples/nextjs-example/pages/admin/templates.tsx +157 -0
  14. package/examples/nextjs-example/tsconfig.json +28 -0
  15. package/package.json +32 -0
  16. package/packages/core/package.json +70 -0
  17. package/packages/core/rollup.config.js +37 -0
  18. package/packages/core/specification.md +416 -0
  19. package/packages/core/src/adapters/supabase.ts +291 -0
  20. package/packages/core/src/core/scheduler.ts +356 -0
  21. package/packages/core/src/core/template-manager.ts +388 -0
  22. package/packages/core/src/index.ts +30 -0
  23. package/packages/core/src/providers/base.ts +104 -0
  24. package/packages/core/src/providers/sendgrid.ts +368 -0
  25. package/packages/core/src/types/provider.ts +91 -0
  26. package/packages/core/src/types/scheduled.ts +78 -0
  27. package/packages/core/src/types/template.ts +97 -0
  28. package/packages/core/tsconfig.json +23 -0
  29. package/packages/python/README.md +106 -0
  30. package/packages/python/email_template_manager/__init__.py +66 -0
  31. package/packages/python/email_template_manager/config.py +98 -0
  32. package/packages/python/email_template_manager/core/magic_links.py +245 -0
  33. package/packages/python/email_template_manager/core/manager.py +344 -0
  34. package/packages/python/email_template_manager/core/scheduler.py +473 -0
  35. package/packages/python/email_template_manager/exceptions.py +67 -0
  36. package/packages/python/email_template_manager/models/magic_link.py +59 -0
  37. package/packages/python/email_template_manager/models/scheduled.py +78 -0
  38. package/packages/python/email_template_manager/models/template.py +90 -0
  39. package/packages/python/email_template_manager/providers/aws_ses.py +44 -0
  40. package/packages/python/email_template_manager/providers/base.py +94 -0
  41. package/packages/python/email_template_manager/providers/sendgrid.py +325 -0
  42. package/packages/python/email_template_manager/providers/smtp.py +44 -0
  43. package/packages/python/pyproject.toml +133 -0
  44. package/packages/python/setup.py +93 -0
  45. package/packages/python/specification.md +930 -0
  46. package/packages/react/README.md +13 -0
  47. package/packages/react/package.json +105 -0
  48. package/packages/react/rollup.config.js +37 -0
  49. package/packages/react/specification.md +569 -0
  50. package/packages/react/src/index.ts +20 -0
  51. package/packages/react/tsconfig.json +24 -0
  52. package/src/index.js +1 -0
  53. package/test_package.py +125 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,112 @@
1
+ //
2
+ // Copyright (c) 2025 Bernier LLC
3
+ //
4
+ // This file is licensed to the client under a limited-use license.
5
+ // The client may use and modify this code *only within the scope of the project it was delivered for*.
6
+ // Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
7
+ //
8
+ {
9
+ "extends": [
10
+ "plugin:react/recommended",
11
+ "plugin:react-hooks/recommended",
12
+ "plugin:jsx-a11y/recommended",
13
+ "plugin:@typescript-eslint/recommended"
14
+ ],
15
+ "plugins": [
16
+ "react",
17
+ "react-hooks",
18
+ "jsx-a11y",
19
+ "@typescript-eslint"
20
+ ],
21
+ "rules": {
22
+ "no-object-rendering": "error",
23
+ "react/jsx-no-undef": "error",
24
+ "react/jsx-uses-react": "error",
25
+ "react/jsx-uses-vars": "error",
26
+ "react/no-unescaped-entities": "error",
27
+ "react/no-unknown-property": "error",
28
+ "react/self-closing-comp": "error",
29
+ "react/jsx-key": "error",
30
+ "react/jsx-no-duplicate-props": "error",
31
+ "react/jsx-no-target-blank": "error",
32
+ "react/jsx-pascal-case": "error",
33
+ "react/jsx-wrap-multilines": "error",
34
+ "react/jsx-curly-brace-presence": ["error", { "props": "never", "children": "never" }],
35
+ "@typescript-eslint/no-unused-vars": "error",
36
+ "@typescript-eslint/no-explicit-any": "warn",
37
+ "@typescript-eslint/explicit-function-return-type": "off",
38
+ "@typescript-eslint/explicit-module-boundary-types": "off",
39
+ "@typescript-eslint/no-non-null-assertion": "warn",
40
+ "react-hooks/rules-of-hooks": "error",
41
+ "react-hooks/exhaustive-deps": "warn",
42
+ "jsx-a11y/alt-text": "error",
43
+ "jsx-a11y/anchor-has-content": "error",
44
+ "jsx-a11y/anchor-is-valid": "error",
45
+ "jsx-a11y/aria-props": "error",
46
+ "jsx-a11y/aria-proptypes": "error",
47
+ "jsx-a11y/aria-unsupported-elements": "error",
48
+ "jsx-a11y/heading-has-content": "error",
49
+ "jsx-a11y/iframe-has-title": "error",
50
+ "jsx-a11y/img-redundant-alt": "error",
51
+ "jsx-a11y/no-access-key": "error",
52
+ "jsx-a11y/no-distracting-elements": "error",
53
+ "jsx-a11y/no-redundant-roles": "error",
54
+ "jsx-a11y/role-has-required-aria-props": "error",
55
+ "jsx-a11y/role-supports-aria-props": "error",
56
+ "jsx-a11y/scope": "error",
57
+ "jsx-a11y/label-has-associated-control": "error",
58
+ "jsx-a11y/control-has-associated-label": "error",
59
+ "jsx-a11y/click-events-have-key-events": "error",
60
+ "jsx-a11y/no-static-element-interactions": "error",
61
+ "jsx-a11y/interactive-supports-focus": "error",
62
+ "jsx-a11y/no-noninteractive-element-interactions": "error",
63
+ "jsx-a11y/no-noninteractive-tabindex": "error",
64
+ "jsx-a11y/tabindex-no-positive": "error",
65
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
66
+ "jsx-a11y/media-has-caption": "error",
67
+ "jsx-a11y/no-autofocus": "error",
68
+ "no-console": "warn",
69
+ "no-debugger": "error",
70
+ "no-unused-vars": "off",
71
+ "prefer-const": "error",
72
+ "no-var": "error"
73
+ },
74
+ "settings": {
75
+ "react": {
76
+ "version": "detect"
77
+ }
78
+ },
79
+ "overrides": [
80
+ {
81
+ "files": ["**/*.ts", "**/*.tsx"],
82
+ "rules": {
83
+ "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
84
+ "@typescript-eslint/explicit-function-return-type": "off"
85
+ }
86
+ },
87
+ {
88
+ "files": ["**/forms/**/*.tsx", "**/*Form*.tsx", "**/*form*.tsx"],
89
+ "rules": {
90
+ "jsx-a11y/label-has-associated-control": "error",
91
+ "jsx-a11y/control-has-associated-label": "error",
92
+ "jsx-a11y/no-autofocus": "error"
93
+ }
94
+ },
95
+ {
96
+ "files": ["**/navigation/**/*.tsx", "**/*Nav*.tsx", "**/*nav*.tsx"],
97
+ "rules": {
98
+ "jsx-a11y/click-events-have-key-events": "error",
99
+ "jsx-a11y/no-static-element-interactions": "error",
100
+ "jsx-a11y/interactive-supports-focus": "error"
101
+ }
102
+ },
103
+ {
104
+ "files": ["**/modal/**/*.tsx", "**/*Modal*.tsx", "**/*modal*.tsx", "**/*Dialog*.tsx", "**/*dialog*.tsx"],
105
+ "rules": {
106
+ "jsx-a11y/no-autofocus": "error",
107
+ "jsx-a11y/click-events-have-key-events": "error",
108
+ "jsx-a11y/no-static-element-interactions": "error"
109
+ }
110
+ }
111
+ ]
112
+ }
package/.flake8 ADDED
@@ -0,0 +1,18 @@
1
+ [flake8]
2
+ # Disable checks for:
3
+ # E501: line too long
4
+ # E201/E202: whitespace after/before '(', '[', or '{'
5
+ # E203: whitespace before ':'
6
+ # E211: whitespace before '('
7
+ # E221/E222/E223/E224/E225/E226/E227/E228: multiple spacing errors
8
+ # E231/E241/E242: missing or extra whitespace after/before comma
9
+ # E261/E262: spaces before inline comment
10
+ # E301/E302/E303/E304: blank line related
11
+ # W291/W292/W293: trailing whitespace and newline issues
12
+ # W391: blank line at end of file
13
+ # Add more codes as needed
14
+
15
+ ignore = E201,E202,E203,E211,E221,E222,E223,E224,E225,E226,E227,E228,E231,E241,E242,E261,E262,E301,E302,E303,E304,E501,W291,W292,W293,W391
16
+
17
+ # Optionally, you can also raise the line length limit to avoid triggering it in other tools
18
+ max-line-length = 999
@@ -0,0 +1,300 @@
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ jobs:
10
+ # Python package testing
11
+ python-test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
16
+
17
+ services:
18
+ postgres:
19
+ image: postgres:14
20
+ env:
21
+ POSTGRES_PASSWORD: postgres
22
+ POSTGRES_DB: email_templates_test
23
+ options: >-
24
+ --health-cmd pg_isready
25
+ --health-interval 10s
26
+ --health-timeout 5s
27
+ --health-retries 5
28
+ ports:
29
+ - 5432:5432
30
+
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+
34
+ - name: Set up Python ${{ matrix.python-version }}
35
+ uses: actions/setup-python@v4
36
+ with:
37
+ python-version: ${{ matrix.python-version }}
38
+
39
+ - name: Cache pip dependencies
40
+ uses: actions/cache@v3
41
+ with:
42
+ path: ~/.cache/pip
43
+ key: ${{ runner.os }}-pip-${{ hashFiles('packages/python/requirements*.txt') }}
44
+ restore-keys: |
45
+ ${{ runner.os }}-pip-
46
+
47
+ - name: Install dependencies
48
+ run: |
49
+ cd packages/python
50
+ python -m pip install --upgrade pip
51
+ pip install -e .[dev,sendgrid,fastapi,all]
52
+
53
+ - name: Run linting
54
+ run: |
55
+ cd packages/python
56
+ black --check .
57
+ isort --check-only .
58
+ mypy .
59
+
60
+ - name: Run tests
61
+ env:
62
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/email_templates_test
63
+ SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY_TEST }}
64
+ run: |
65
+ cd packages/python
66
+ pytest --cov=email_template_manager --cov-report=xml
67
+
68
+ - name: Upload coverage to Codecov
69
+ uses: codecov/codecov-action@v3
70
+ with:
71
+ file: packages/python/coverage.xml
72
+ flags: python
73
+ name: python-${{ matrix.python-version }}
74
+
75
+ # Node.js package testing
76
+ node-test:
77
+ runs-on: ubuntu-latest
78
+ strategy:
79
+ matrix:
80
+ node-version: [16, 18, 20]
81
+
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+
85
+ - name: Use Node.js ${{ matrix.node-version }}
86
+ uses: actions/setup-node@v4
87
+ with:
88
+ node-version: ${{ matrix.node-version }}
89
+ cache: 'npm'
90
+
91
+ - name: Install dependencies
92
+ run: npm ci
93
+
94
+ - name: Run linting
95
+ run: npm run lint
96
+
97
+ - name: Run type checking
98
+ run: npm run type-check
99
+
100
+ - name: Run tests
101
+ env:
102
+ SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY_TEST }}
103
+ run: npm run test:coverage
104
+
105
+ - name: Build packages
106
+ run: npm run build
107
+
108
+ - name: Upload coverage to Codecov
109
+ uses: codecov/codecov-action@v3
110
+ with:
111
+ file: coverage/lcov.info
112
+ flags: javascript
113
+ name: node-${{ matrix.node-version }}
114
+
115
+ # Integration tests
116
+ integration-test:
117
+ runs-on: ubuntu-latest
118
+ needs: [python-test, node-test]
119
+
120
+ services:
121
+ postgres:
122
+ image: postgres:14
123
+ env:
124
+ POSTGRES_PASSWORD: postgres
125
+ POSTGRES_DB: email_templates_test
126
+ options: >-
127
+ --health-cmd pg_isready
128
+ --health-interval 10s
129
+ --health-timeout 5s
130
+ --health-retries 5
131
+ ports:
132
+ - 5432:5432
133
+
134
+ steps:
135
+ - uses: actions/checkout@v4
136
+
137
+ - name: Set up Python
138
+ uses: actions/setup-python@v4
139
+ with:
140
+ python-version: "3.11"
141
+
142
+ - name: Set up Node.js
143
+ uses: actions/setup-node@v4
144
+ with:
145
+ node-version: 18
146
+ cache: 'npm'
147
+
148
+ - name: Install Python dependencies
149
+ run: |
150
+ cd packages/python
151
+ pip install -e .[all]
152
+
153
+ - name: Install Node.js dependencies
154
+ run: npm ci
155
+
156
+ - name: Build Node.js packages
157
+ run: npm run build
158
+
159
+ - name: Run FastAPI example
160
+ env:
161
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/email_templates_test
162
+ SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY_TEST }}
163
+ run: |
164
+ cd examples/fastapi-example
165
+ pip install -r requirements.txt
166
+ python -m pytest test_integration.py || true
167
+
168
+ - name: Run Next.js example build
169
+ env:
170
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/email_templates_test
171
+ SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY_TEST }}
172
+ run: |
173
+ cd examples/nextjs-example
174
+ npm install
175
+ npm run build
176
+
177
+ # Security scanning
178
+ security:
179
+ runs-on: ubuntu-latest
180
+ steps:
181
+ - uses: actions/checkout@v4
182
+
183
+ - name: Run Python security scan
184
+ run: |
185
+ cd packages/python
186
+ pip install safety bandit
187
+ safety check
188
+ bandit -r email_template_manager/
189
+
190
+ - name: Run Node.js security scan
191
+ run: |
192
+ npm audit --audit-level moderate
193
+
194
+ # Python package publishing
195
+ publish-python:
196
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
197
+ needs: [python-test, integration-test, security]
198
+ runs-on: ubuntu-latest
199
+
200
+ steps:
201
+ - uses: actions/checkout@v4
202
+
203
+ - name: Set up Python
204
+ uses: actions/setup-python@v4
205
+ with:
206
+ python-version: "3.11"
207
+
208
+ - name: Install build dependencies
209
+ run: |
210
+ python -m pip install --upgrade pip
211
+ pip install build twine
212
+
213
+ - name: Build package
214
+ run: |
215
+ cd packages/python
216
+ python -m build
217
+
218
+ - name: Check package
219
+ run: |
220
+ cd packages/python
221
+ twine check dist/*
222
+
223
+ - name: Publish to PyPI
224
+ env:
225
+ TWINE_USERNAME: __token__
226
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
227
+ run: |
228
+ cd packages/python
229
+ twine upload dist/* --skip-existing
230
+
231
+ # NPM package publishing
232
+ publish-npm:
233
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
234
+ needs: [node-test, integration-test, security]
235
+ runs-on: ubuntu-latest
236
+
237
+ steps:
238
+ - uses: actions/checkout@v4
239
+
240
+ - name: Set up Node.js
241
+ uses: actions/setup-node@v4
242
+ with:
243
+ node-version: 18
244
+ cache: 'npm'
245
+ registry-url: 'https://registry.npmjs.org'
246
+
247
+ - name: Install dependencies
248
+ run: npm ci
249
+
250
+ - name: Build packages
251
+ run: npm run build
252
+
253
+ - name: Create release pull request or publish
254
+ id: changesets
255
+ uses: changesets/action@v1
256
+ with:
257
+ publish: npm run release
258
+ commit: "chore: release packages"
259
+ title: "chore: release packages"
260
+ env:
261
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
262
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
263
+
264
+ # Docker image building
265
+ docker:
266
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
267
+ needs: [python-test, node-test]
268
+ runs-on: ubuntu-latest
269
+
270
+ steps:
271
+ - uses: actions/checkout@v4
272
+
273
+ - name: Set up Docker Buildx
274
+ uses: docker/setup-buildx-action@v3
275
+
276
+ - name: Login to Docker Hub
277
+ uses: docker/login-action@v3
278
+ with:
279
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
280
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
281
+
282
+ - name: Build and push API server image
283
+ uses: docker/build-push-action@v5
284
+ with:
285
+ context: .
286
+ file: docker/api.Dockerfile
287
+ push: true
288
+ tags: |
289
+ email-template-manager/api:latest
290
+ email-template-manager/api:${{ github.sha }}
291
+
292
+ - name: Build and push worker image
293
+ uses: docker/build-push-action@v5
294
+ with:
295
+ context: .
296
+ file: docker/worker.Dockerfile
297
+ push: true
298
+ tags: |
299
+ email-template-manager/worker:latest
300
+ email-template-manager/worker:${{ github.sha }}
@@ -0,0 +1,265 @@
1
+ # Email Template Manager - Extraction Summary
2
+
3
+ ## Overview
4
+
5
+ This document summarizes the email management functionality extracted from the Event Venue Platform and shows how it can be packaged as a standalone, reusable component library.
6
+
7
+ ## Extracted Functionality
8
+
9
+ ### From the Original Venue Platform
10
+
11
+ The following email-related features were identified and extracted from the existing venue platform specifications:
12
+
13
+ #### 1. **Email Template Management** (from `plans/backoffice/data_and_api.md`)
14
+
15
+ - **EmailTemplate Model**: Template storage with HTML/text content, variables, and metadata
16
+ - **Template CRUD Operations**: Create, read, update, delete templates
17
+ - **Variable System**: Liquid-style template variables with type validation
18
+ - **Template Rendering**: Dynamic content generation with variable substitution
19
+
20
+ #### 2. **Email Scheduling** (from `plans/backoffice/data_and_api.md`)
21
+
22
+ - **ScheduledEmail Model**: Queue system for timed email delivery
23
+ - **Trigger Types**: Immediate, relative (days before/after event), and absolute scheduling
24
+ - **Background Processing**: Cron-based email processing with retry logic
25
+ - **Batch Operations**: Send multiple emails efficiently
26
+
27
+ #### 3. **Magic Link Authentication** (from `plans/backoffice/data_and_api.md`)
28
+
29
+ - **MagicLink Model**: Secure, expiring tokens for passwordless authentication
30
+ - **Token Management**: Generation, validation, usage, and expiration
31
+ - **Payload Support**: Embed custom data in magic links
32
+ - **Security**: Token hashing and encryption
33
+
34
+ #### 4. **Admin UI Components** (from `plans/backoffice/ui_specification.md`)
35
+
36
+ - **Template Editor**: Rich HTML editor with live preview
37
+ - **Template List**: Sortable, filterable template management
38
+ - **Email Queue Management**: View and control scheduled emails
39
+ - **Variable Manager**: Define and edit template variables
40
+
41
+ #### 5. **SendGrid Integration** (from `plans/architecture.md`)
42
+
43
+ - **Provider Abstraction**: Support multiple email providers
44
+ - **Webhook Handling**: Process delivery status updates
45
+ - **Error Handling**: Retry logic and failure tracking
46
+
47
+ ## New Component Architecture
48
+
49
+ ### Core Packages
50
+
51
+ #### `@email-template-manager/core` (TypeScript/JavaScript)
52
+
53
+ ```typescript
54
+ import {
55
+ EmailTemplateManager,
56
+ EmailScheduler,
57
+ MagicLinkManager,
58
+ } from "@email-template-manager/core";
59
+
60
+ const manager = new EmailTemplateManager(config);
61
+ const scheduler = new EmailScheduler(manager, emailProvider);
62
+ const magicLinks = new MagicLinkManager(config);
63
+ ```
64
+
65
+ #### `@email-template-manager/react` (React Components)
66
+
67
+ ```typescript
68
+ import {
69
+ EmailTemplateEditor,
70
+ EmailTemplateList,
71
+ ScheduledEmailsManager,
72
+ } from "@email-template-manager/react";
73
+
74
+ <EmailTemplateProvider config={config}>
75
+ <EmailTemplateEditor onSave={handleSave} />
76
+ <EmailTemplateList templates={templates} />
77
+ </EmailTemplateProvider>;
78
+ ```
79
+
80
+ #### `email-template-manager` (Python SDK)
81
+
82
+ ```python
83
+ from email_template_manager import EmailTemplateManager, EmailScheduler, SendGridProvider
84
+
85
+ manager = EmailTemplateManager("postgresql://...")
86
+ provider = SendGridProvider({"api_key": "...", "from_email": "..."})
87
+ scheduler = EmailScheduler(manager, provider)
88
+ ```
89
+
90
+ ### Framework Integrations
91
+
92
+ #### **FastAPI Integration**
93
+
94
+ - Ready-to-use router with all CRUD endpoints
95
+ - Background task integration for email processing
96
+ - Pydantic models for request/response validation
97
+ - Async/await support throughout
98
+
99
+ #### **React Integration**
100
+
101
+ - Complete UI component library
102
+ - Hooks for data management (`useEmailTemplates`, `useScheduledEmails`)
103
+ - Theme provider for customization
104
+ - TypeScript support
105
+
106
+ #### **Next.js Integration**
107
+
108
+ - SSR-compatible components
109
+ - API route helpers
110
+ - Database connection management
111
+ - Environment variable configuration
112
+
113
+ ## Migration Benefits
114
+
115
+ ### 1. **Reusability**
116
+
117
+ - Use the same email functionality across multiple projects
118
+ - Consistent API and behavior across different frameworks
119
+ - Reduced development time for new projects
120
+
121
+ ### 2. **Maintainability**
122
+
123
+ - Single codebase for email template management
124
+ - Centralized bug fixes and feature updates
125
+ - Better testing and documentation
126
+
127
+ ### 3. **Scalability**
128
+
129
+ - Framework-agnostic core allows adoption in any environment
130
+ - Plugin architecture for email providers
131
+ - Horizontal scaling with queue-based processing
132
+
133
+ ### 4. **Community Benefits**
134
+
135
+ - Open source project can gather community contributions
136
+ - Multiple teams can benefit from shared functionality
137
+ - Documentation and examples improve over time
138
+
139
+ ## Implementation Roadmap
140
+
141
+ ### Phase 1: Core Library (Weeks 1-4)
142
+
143
+ - [ ] Extract core TypeScript library from venue platform specs
144
+ - [ ] Implement email template management
145
+ - [ ] Add scheduling and magic link functionality
146
+ - [ ] Create email provider abstractions
147
+ - [ ] Add comprehensive tests
148
+
149
+ ### Phase 2: React Components (Weeks 3-6)
150
+
151
+ - [ ] Build React component library based on backoffice UI specs
152
+ - [ ] Create hooks for data management
153
+ - [ ] Add theme support and customization
154
+ - [ ] Build Storybook documentation
155
+
156
+ ### Phase 3: Python SDK (Weeks 5-8)
157
+
158
+ - [ ] Implement Python version using FastAPI patterns from venue platform
159
+ - [ ] Add SQLAlchemy models and database management
160
+ - [ ] Create framework integrations (FastAPI, Django, Flask)
161
+ - [ ] Add CLI tools for management
162
+
163
+ ### Phase 4: Documentation & Examples (Weeks 7-10)
164
+
165
+ - [ ] Create comprehensive documentation website
166
+ - [ ] Build integration examples for each framework
167
+ - [ ] Add interactive playground and demos
168
+ - [ ] Write migration guides
169
+
170
+ ### Phase 5: Open Source Launch (Weeks 9-12)
171
+
172
+ - [ ] Set up GitHub organization and repositories
173
+ - [ ] Configure CI/CD and package publishing
174
+ - [ ] Create community guidelines and contribution docs
175
+ - [ ] Launch marketing campaign
176
+
177
+ ## Package Publishing Strategy
178
+
179
+ ### NPM Packages
180
+
181
+ ```bash
182
+ @email-template-manager/core # Core TypeScript library
183
+ @email-template-manager/react # React components
184
+ @email-template-manager/api # Node.js API server
185
+ ```
186
+
187
+ ### Python Package
188
+
189
+ ```bash
190
+ email-template-manager # Main Python package
191
+ email-template-manager[fastapi] # FastAPI extras
192
+ email-template-manager[django] # Django extras
193
+ ```
194
+
195
+ ### Docker Images
196
+
197
+ ```bash
198
+ email-template-manager/api # Standalone API server
199
+ email-template-manager/worker # Background email processor
200
+ ```
201
+
202
+ ## Success Metrics
203
+
204
+ ### Adoption Metrics
205
+
206
+ - NPM download count
207
+ - PyPI download statistics
208
+ - GitHub stars and forks
209
+ - Documentation page views
210
+
211
+ ### Quality Metrics
212
+
213
+ - Test coverage (target: 90%+)
214
+ - Build success rate
215
+ - Security vulnerability count
216
+ - Performance benchmarks
217
+
218
+ ### Community Metrics
219
+
220
+ - GitHub issues and PRs
221
+ - Discord/community engagement
222
+ - Blog post shares
223
+ - Integration showcases
224
+
225
+ ## Risk Assessment & Mitigation
226
+
227
+ ### Technical Risks
228
+
229
+ - **Database compatibility**: Mitigate with adapter pattern
230
+ - **Email provider limits**: Implement rate limiting and queuing
231
+ - **Security vulnerabilities**: Regular audits and dependency updates
232
+
233
+ ### Community Risks
234
+
235
+ - **Low adoption**: Strong documentation and examples
236
+ - **Maintenance burden**: Clear contributor guidelines and team
237
+ - **Competition**: Focus on superior developer experience
238
+
239
+ ### Business Risks
240
+
241
+ - **Funding sustainability**: GitHub Sponsors and corporate support
242
+ - **Legal issues**: Clear licensing and contribution agreements
243
+ - **Trademark conflicts**: Research and register appropriate names
244
+
245
+ ## Next Steps
246
+
247
+ 1. **Immediate Actions**
248
+
249
+ - [ ] Register package names on NPM and PyPI
250
+ - [ ] Set up GitHub organization and main repository
251
+ - [ ] Create initial project structure and documentation
252
+
253
+ 2. **Week 1 Goals**
254
+
255
+ - [ ] Complete core library specification
256
+ - [ ] Set up development environment and tooling
257
+ - [ ] Begin implementation of core functionality
258
+
259
+ 3. **Month 1 Goals**
260
+ - [ ] Alpha release of core packages
261
+ - [ ] Basic React components functional
262
+ - [ ] Python SDK with FastAPI integration
263
+ - [ ] Initial documentation website
264
+
265
+ This extraction transforms venue-specific email functionality into a powerful, reusable library that can benefit the entire developer community while maintaining all the sophisticated features designed for the original platform.