@macedon-technologies/batman 1.0.16
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/.jsii +637 -0
- package/API.md +5671 -0
- package/LICENSE +202 -0
- package/README.md +86 -0
- package/lib/ApiConstructFile.d.ts +5 -0
- package/lib/ApiConstructFile.js +175 -0
- package/lib/ApiFunctionFile.d.ts +5 -0
- package/lib/ApiFunctionFile.js +30 -0
- package/lib/Application.d.ts +21 -0
- package/lib/Application.js +72 -0
- package/lib/ApplicationStackFile.d.ts +5 -0
- package/lib/ApplicationStackFile.js +26 -0
- package/lib/BaseApplicationStackFile.d.ts +5 -0
- package/lib/BaseApplicationStackFile.js +172 -0
- package/lib/BatmanProject.d.ts +25 -0
- package/lib/BatmanProject.js +101 -0
- package/lib/GitHubRolesFile.d.ts +9 -0
- package/lib/GitHubRolesFile.js +26 -0
- package/lib/GitHubRolesStackFile.d.ts +8 -0
- package/lib/GitHubRolesStackFile.js +165 -0
- package/lib/LocalDevAppFile.d.ts +10 -0
- package/lib/LocalDevAppFile.js +34 -0
- package/lib/MainFile.d.ts +24 -0
- package/lib/MainFile.js +64 -0
- package/lib/MainTestFile.d.ts +5 -0
- package/lib/MainTestFile.js +33 -0
- package/lib/PrCleanupWorkflow.d.ts +9 -0
- package/lib/PrCleanupWorkflow.js +100 -0
- package/lib/PrDeployWorkflow.d.ts +10 -0
- package/lib/PrDeployWorkflow.js +106 -0
- package/lib/ProductionDeployWorkflow.d.ts +11 -0
- package/lib/ProductionDeployWorkflow.js +68 -0
- package/lib/StagingDeployWorkflow.d.ts +11 -0
- package/lib/StagingDeployWorkflow.js +68 -0
- package/lib/StaticWebsiteConstructFile.d.ts +5 -0
- package/lib/StaticWebsiteConstructFile.js +198 -0
- package/lib/ViteReactProject.d.ts +45 -0
- package/lib/ViteReactProject.js +654 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +20 -0
- package/package.json +125 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Platform Common Projen
|
|
2
|
+
|
|
3
|
+
A baseline architecture template for new projects using Projen. This project provides a standardized foundation that includes both frontend and backend components with authentication.
|
|
4
|
+
|
|
5
|
+
## Project Intention
|
|
6
|
+
|
|
7
|
+
This template serves as a starting point for new projects, providing:
|
|
8
|
+
- Consistent project structure and configuration
|
|
9
|
+
- Pre-configured development tooling
|
|
10
|
+
- Integrated authentication system
|
|
11
|
+
- Full-stack application foundation
|
|
12
|
+
|
|
13
|
+
## Components Created
|
|
14
|
+
|
|
15
|
+
The BatmanProject generates:
|
|
16
|
+
|
|
17
|
+
### Frontend
|
|
18
|
+
- **React Application** - Modern React app with TypeScript
|
|
19
|
+
- **Clerk Authentication** - Integrated user authentication and management
|
|
20
|
+
|
|
21
|
+
### Backend/Infrastructure
|
|
22
|
+
- **AWS Infrastructure** - CDK-based cloud resources
|
|
23
|
+
- **API Gateway** - RESTful API endpoints
|
|
24
|
+
- **Lambda Functions** - Serverless compute
|
|
25
|
+
- **Database** - Persistent data storage
|
|
26
|
+
|
|
27
|
+
## Usage Examples
|
|
28
|
+
|
|
29
|
+
### Basic Project Creation
|
|
30
|
+
|
|
31
|
+
Create a `.projenrc.ts` file in your project root:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { BatmanProject } from '@macedon-technologies/batman';
|
|
35
|
+
|
|
36
|
+
const project = new BatmanProject({
|
|
37
|
+
name: 'my-new-app',
|
|
38
|
+
defaultReleaseBranch: 'main',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
project.synth();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then run:
|
|
45
|
+
```bash
|
|
46
|
+
npx projen
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### With Custom Configuration
|
|
50
|
+
|
|
51
|
+
Create a `.projenrc.ts` file with additional options:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { BatmanProject } from '@macedon-technologies/batman';
|
|
55
|
+
|
|
56
|
+
const project = new BatmanProject({
|
|
57
|
+
name: 'my-enterprise-app',
|
|
58
|
+
defaultReleaseBranch: 'main',
|
|
59
|
+
description: 'Enterprise application with authentication',
|
|
60
|
+
authorName: 'Your Name',
|
|
61
|
+
authorEmail: 'your.email@company.com',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
project.synth();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then run:
|
|
68
|
+
```bash
|
|
69
|
+
npx projen
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Development Workflow
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Install dependencies
|
|
76
|
+
yarn install
|
|
77
|
+
|
|
78
|
+
# Start development server
|
|
79
|
+
yarn dev
|
|
80
|
+
|
|
81
|
+
# Deploy infrastructure
|
|
82
|
+
yarn deploy
|
|
83
|
+
|
|
84
|
+
# Run tests
|
|
85
|
+
yarn test
|
|
86
|
+
```
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiConstructFile = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
class ApiConstructFile extends projen_1.SampleFile {
|
|
6
|
+
constructor(project) {
|
|
7
|
+
super(project, 'src/constructs/Api.ts', {
|
|
8
|
+
contents: `import { join } from 'path';
|
|
9
|
+
import { RustFunction } from '@cdklabs/aws-lambda-rust';
|
|
10
|
+
import { Secret } from '@matthewbonig/secret';
|
|
11
|
+
import { Duration, Stack } from 'aws-cdk-lib';
|
|
12
|
+
import { EndpointType, LambdaIntegration, RestApi, TokenAuthorizer } from 'aws-cdk-lib/aws-apigateway';
|
|
13
|
+
import { IVpc } from 'aws-cdk-lib/aws-ec2';
|
|
14
|
+
import { AnyPrincipal, Effect, PolicyDocument, PolicyStatement } from 'aws-cdk-lib/aws-iam';
|
|
15
|
+
import { Architecture, S3CodeV2, Function as LambdaFunction, Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
16
|
+
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
|
|
17
|
+
import { Bucket } from 'aws-cdk-lib/aws-s3';
|
|
18
|
+
|
|
19
|
+
import { Construct } from 'constructs';
|
|
20
|
+
import { N8N_ENDPOINT, N8N_JWT_KEY } from './handler/Api.Function';
|
|
21
|
+
|
|
22
|
+
export interface ApiProps {
|
|
23
|
+
readonly cloudFrontOriginRequestPolicyId?: string;
|
|
24
|
+
readonly vpc: IVpc;
|
|
25
|
+
readonly clerkJwtVerificationKey: string;
|
|
26
|
+
readonly n8nEndpoint: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class Api extends Construct {
|
|
30
|
+
public restApi: RestApi;
|
|
31
|
+
public lambdaFunction: LambdaFunction;
|
|
32
|
+
|
|
33
|
+
private authorizerFunction: RustFunction;
|
|
34
|
+
private n8nJwtKeySecret: Secret;
|
|
35
|
+
private authorizer: TokenAuthorizer;
|
|
36
|
+
private clerkAuthSecret: Secret;
|
|
37
|
+
|
|
38
|
+
constructor(scope: Construct, id: string, private props: ApiProps) {
|
|
39
|
+
super(scope, id);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
this.createN8NJwtSecret();
|
|
43
|
+
if (!this.n8nJwtKeySecret) {
|
|
44
|
+
throw new Error('Failed to create n8n JWT key secret');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.createClerkAuthSecret();
|
|
48
|
+
if (!this.clerkAuthSecret) {
|
|
49
|
+
throw new Error('Failed to create Clerk auth secret');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
this.createLambdaFunction();
|
|
53
|
+
if (!this.lambdaFunction) {
|
|
54
|
+
throw new Error('Failed to create lambda function');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this.createAuthorizerFunction();
|
|
58
|
+
if (!this.authorizerFunction) {
|
|
59
|
+
throw new Error('Failed to create authorizer function');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.createRestApi();
|
|
63
|
+
if (!this.restApi) {
|
|
64
|
+
throw new Error('Failed to create REST API');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
this.createAuthorizer();
|
|
68
|
+
if (!this.authorizer) {
|
|
69
|
+
throw new Error('Failed to create authorizer');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.setupApiIntegration();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
protected createAuthorizerFunction() {
|
|
76
|
+
this.authorizerFunction = new LambdaFunction(this, 'ClerkAuthorizerHandler', {
|
|
77
|
+
runtime: Runtime.PROVIDED_AL2023,
|
|
78
|
+
timeout: Duration.seconds(10),
|
|
79
|
+
code: S3CodeV2.fromBucketV2(Bucket.fromBucketName(this, 'MacedonPlatformBucket', 'macedon-platform-common-015955817263'), 'lambda/clerk-authorizer-arm64-latest.zip'),
|
|
80
|
+
environment: {
|
|
81
|
+
CLERK_JWT_VERIFICATION_KEY: this.props.clerkJwtVerificationKey,
|
|
82
|
+
},
|
|
83
|
+
handler: 'itsrustbaby',
|
|
84
|
+
architecture: Architecture.ARM_64,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
protected createN8NJwtSecret() {
|
|
89
|
+
this.n8nJwtKeySecret = new Secret(this, 'N8nJwtKeySecret', {});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
protected createLambdaFunction() {
|
|
93
|
+
this.lambdaFunction = new NodejsFunction(this, 'Function', {
|
|
94
|
+
runtime: Runtime.NODEJS_20_X,
|
|
95
|
+
timeout: Duration.seconds(30),
|
|
96
|
+
entry: join(__dirname, 'handler/Api.Function.ts'),
|
|
97
|
+
vpc: this.props.vpc,
|
|
98
|
+
environment: {
|
|
99
|
+
[N8N_JWT_KEY]: this.n8nJwtKeySecret.secretName,
|
|
100
|
+
[N8N_ENDPOINT]: this.props.n8nEndpoint,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
this.n8nJwtKeySecret.grantRead(this.lambdaFunction);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
protected createRestApi() {
|
|
107
|
+
this.restApi = new RestApi(this, 'RestApi', {
|
|
108
|
+
restApiName: 'mvp-ui-api',
|
|
109
|
+
description: 'API for MVP UI application',
|
|
110
|
+
endpointTypes: [EndpointType.REGIONAL],
|
|
111
|
+
policy: new PolicyDocument({
|
|
112
|
+
statements: [
|
|
113
|
+
new PolicyStatement({
|
|
114
|
+
effect: Effect.DENY,
|
|
115
|
+
principals: [new AnyPrincipal()],
|
|
116
|
+
actions: ['execute-api:Invoke'],
|
|
117
|
+
resources: ['*'],
|
|
118
|
+
conditions: {
|
|
119
|
+
StringNotEquals: {
|
|
120
|
+
'aws:useragent': 'Amazon CloudFront',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
}),
|
|
124
|
+
new PolicyStatement({
|
|
125
|
+
effect: Effect.ALLOW,
|
|
126
|
+
principals: [new AnyPrincipal()],
|
|
127
|
+
actions: ['execute-api:Invoke'],
|
|
128
|
+
resources: ['*'],
|
|
129
|
+
conditions: {
|
|
130
|
+
StringEquals: {
|
|
131
|
+
'aws:useragent': 'Amazon CloudFront',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
],
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
protected createAuthorizer() {
|
|
141
|
+
this.authorizer = new TokenAuthorizer(this, 'ClerkAuthorizer', {
|
|
142
|
+
handler: this.authorizerFunction,
|
|
143
|
+
identitySource: 'method.request.header.Authorization',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
protected setupApiIntegration() {
|
|
148
|
+
const integration = new LambdaIntegration(this.lambdaFunction);
|
|
149
|
+
this.restApi.root.addProxy({
|
|
150
|
+
defaultIntegration: integration,
|
|
151
|
+
anyMethod: true,
|
|
152
|
+
defaultMethodOptions: {
|
|
153
|
+
authorizer: this.authorizer,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
private createClerkAuthSecret() {
|
|
159
|
+
this.clerkAuthSecret = new Secret(this, 'ClerkAuthSecret', {
|
|
160
|
+
generateSecretString: {
|
|
161
|
+
secretStringTemplate: JSON.stringify({
|
|
162
|
+
clerkPublishableKey: '',
|
|
163
|
+
clerkJwtVerificationKey: '',
|
|
164
|
+
}),
|
|
165
|
+
generateStringKey: 'clerkPublishableKey',
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
`,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.ApiConstructFile = ApiConstructFile;
|
|
175
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBpQ29uc3RydWN0RmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9BcGlDb25zdHJ1Y3RGaWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1DQUFvQztBQUdwQyxNQUFhLGdCQUFpQixTQUFRLG1CQUFVO0lBQzlDLFlBQVksT0FBNEI7UUFDdEMsS0FBSyxDQUFDLE9BQU8sRUFBRSx1QkFBdUIsRUFBRTtZQUN0QyxRQUFRLEVBQUU7Ozs7Ozs7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lwZS5SRUdJT05BTF0sXG4gICAgICBwb2xpY3k6IG5ldyBQb2xpY3lEb2N1bWVudCh7XG4gICAgICAgIHN0YXRlbWVudHM6IFtcbiAgICAgICAgICBuZXcgUG9saWN5U3RhdGVtZW50KHtcbiAgICAgICAgICAgIGVmZmVjdDogRWZmZWN0LkRFTlksXG4gICAgICAgICAgICBwcmluY2lwYWxzOiBbbmV3IEFueVByaW5jaXBhbCgpXSxcbiAgICAgICAgICAgIGFjdGlvbnM6IFsnZXhlY3V0ZS1hcGk6SW52b2tlJ10sXG4gICAgICAgICAgICByZXNvdXJjZXM6IFsnKiddLFxuICAgICAgICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICAgICAgICBTdHJpbmdOb3RFcXVhbHM6IHtcbiAgICAgICAgICAgICAgICAnYXdzOnVzZXJhZ2VudCc6ICdBbWF6b24gQ2xvdWRGcm9udCcsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0pLFxuICAgICAgICAgIG5ldyBQb2xpY3lTdGF0ZW1lbnQoe1xuICAgICAgICAgICAgZWZmZWN0OiBFZmZlY3QuQUxMT1csXG4gICAgICAgICAgICBwcmluY2lwYWxzOiBbbmV3IEFueVByaW5jaXBhbCgpXSxcbiAgICAgICAgICAgIGFjdGlvbnM6IFsnZXhlY3V0ZS1hcGk6SW52b2tlJ10sXG4gICAgICAgICAgICByZXNvdXJjZXM6IFsnKiddLFxuICAgICAgICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICAgICAgICBTdHJpbmdFcXVhbHM6IHtcbiAgICAgICAgICAgICAgICAnYXdzOnVzZXJhZ2VudCc6ICdBbWF6b24gQ2xvdWRGcm9udCcsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0pLFxuICAgICAgICBdLFxuICAgICAgfSksXG4gICAgfSk7XG4gIH1cblxuICBwcm90ZWN0ZWQgY3JlYXRlQXV0aG9yaXplcigpIHtcbiAgICB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Sk7XG4gIH1cbn1cbmAsXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiFunctionFile = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
class ApiFunctionFile extends projen_1.SampleFile {
|
|
6
|
+
constructor(project) {
|
|
7
|
+
super(project, 'src/constructs/handler/Api.Function.ts', {
|
|
8
|
+
contents: `import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda';
|
|
9
|
+
|
|
10
|
+
export const N8N_JWT_KEY = 'N8N_JWT_KEY';
|
|
11
|
+
export const N8N_ENDPOINT = 'N8N_ENDPOINT';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Unified handler that routes all API requests to appropriate services
|
|
15
|
+
* This handler can handle multiple endpoints and services (plants, orders, etc.)
|
|
16
|
+
*/
|
|
17
|
+
export const handler = async (event: APIGatewayEvent): Promise<APIGatewayProxyResult> => {
|
|
18
|
+
return {
|
|
19
|
+
statusCode: 200,
|
|
20
|
+
body: JSON.stringify({
|
|
21
|
+
message: 'API is up and running',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
`,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ApiFunctionFile = ApiFunctionFile;
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBpRnVuY3Rpb25GaWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0FwaUZ1bmN0aW9uRmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtQ0FBb0M7QUFHcEMsTUFBYSxlQUFnQixTQUFRLG1CQUFVO0lBQzdDLFlBQVksT0FBNEI7UUFDdEMsS0FBS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zZTxBUElHYXRld2F5UHJveHlSZXN1bHQ+ID0+IHtcbiAgcmV0dXJuIHtcbiAgICBzdGF0dXNDb2RlOiAyMDAsXG4gICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgbWVzc2FnZTogJ0FQSSBpcyB1cCBhbmQgcnVubmluZycsXG4gICAgfSksXG4gIH07XG59O1xuYCxcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AwsCdkTypeScriptApp } from 'projen/lib/awscdk';
|
|
2
|
+
import { EnvironmentConfig } from './MainFile';
|
|
3
|
+
export interface ApplicationEnvironmentConfig extends EnvironmentConfig {
|
|
4
|
+
readonly githubActionRoleArn: `arn:aws:iam::${string}:role/${string}`;
|
|
5
|
+
}
|
|
6
|
+
export interface ApplicationOptions {
|
|
7
|
+
readonly githubRepository: string;
|
|
8
|
+
readonly dev: ApplicationEnvironmentConfig;
|
|
9
|
+
readonly staging: ApplicationEnvironmentConfig;
|
|
10
|
+
readonly prod: ApplicationEnvironmentConfig;
|
|
11
|
+
readonly clerkPublishableKey: string;
|
|
12
|
+
readonly additionalTags?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Application construct that creates all standard project files
|
|
18
|
+
*/
|
|
19
|
+
export declare class Application {
|
|
20
|
+
constructor(project: AwsCdkTypeScriptApp, options: ApplicationOptions);
|
|
21
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Application = void 0;
|
|
4
|
+
const ApiConstructFile_1 = require("./ApiConstructFile");
|
|
5
|
+
const ApiFunctionFile_1 = require("./ApiFunctionFile");
|
|
6
|
+
const ApplicationStackFile_1 = require("./ApplicationStackFile");
|
|
7
|
+
const BaseApplicationStackFile_1 = require("./BaseApplicationStackFile");
|
|
8
|
+
const GitHubRolesStackFile_1 = require("./GitHubRolesStackFile");
|
|
9
|
+
const LocalDevAppFile_1 = require("./LocalDevAppFile");
|
|
10
|
+
const MainFile_1 = require("./MainFile");
|
|
11
|
+
const MainTestFile_1 = require("./MainTestFile");
|
|
12
|
+
const PrCleanupWorkflow_1 = require("./PrCleanupWorkflow");
|
|
13
|
+
const PrDeployWorkflow_1 = require("./PrDeployWorkflow");
|
|
14
|
+
const ProductionDeployWorkflow_1 = require("./ProductionDeployWorkflow");
|
|
15
|
+
const StagingDeployWorkflow_1 = require("./StagingDeployWorkflow");
|
|
16
|
+
const StaticWebsiteConstructFile_1 = require("./StaticWebsiteConstructFile");
|
|
17
|
+
/**
|
|
18
|
+
* Application construct that creates all standard project files
|
|
19
|
+
*/
|
|
20
|
+
class Application {
|
|
21
|
+
constructor(project, options) {
|
|
22
|
+
// Create main entry point files
|
|
23
|
+
new MainFile_1.MainFile(project, {
|
|
24
|
+
projectName: project.name,
|
|
25
|
+
dev: options.dev,
|
|
26
|
+
staging: options.staging,
|
|
27
|
+
prod: options.prod,
|
|
28
|
+
additionalTags: options.additionalTags,
|
|
29
|
+
});
|
|
30
|
+
new LocalDevAppFile_1.LocalDevAppFile(project, {
|
|
31
|
+
projectName: project.name,
|
|
32
|
+
dev: options.dev,
|
|
33
|
+
});
|
|
34
|
+
// Create stack files
|
|
35
|
+
new GitHubRolesStackFile_1.GitHubRolesStackFile(project, {
|
|
36
|
+
githubRepository: options.githubRepository,
|
|
37
|
+
});
|
|
38
|
+
new BaseApplicationStackFile_1.BaseApplicationStackFile(project);
|
|
39
|
+
new ApplicationStackFile_1.ApplicationStackFile(project);
|
|
40
|
+
// Create construct files
|
|
41
|
+
new ApiConstructFile_1.ApiConstructFile(project);
|
|
42
|
+
new StaticWebsiteConstructFile_1.StaticWebsiteConstructFile(project);
|
|
43
|
+
// Create handler files
|
|
44
|
+
new ApiFunctionFile_1.ApiFunctionFile(project);
|
|
45
|
+
// Create test files
|
|
46
|
+
new MainTestFile_1.MainTestFile(project);
|
|
47
|
+
// Create GitHub Actions workflows
|
|
48
|
+
new PrDeployWorkflow_1.PrDeployWorkflow(project, {
|
|
49
|
+
roleArn: options.dev.githubActionRoleArn,
|
|
50
|
+
awsRegion: options.dev.region,
|
|
51
|
+
clerkPublishableKey: options.clerkPublishableKey,
|
|
52
|
+
});
|
|
53
|
+
new PrCleanupWorkflow_1.PrCleanupWorkflow(project, {
|
|
54
|
+
roleArn: options.dev.githubActionRoleArn,
|
|
55
|
+
awsRegion: options.dev.region,
|
|
56
|
+
});
|
|
57
|
+
new StagingDeployWorkflow_1.StagingDeployWorkflow(project, {
|
|
58
|
+
roleArn: options.staging.githubActionRoleArn,
|
|
59
|
+
awsRegion: options.staging.region,
|
|
60
|
+
projectName: project.name,
|
|
61
|
+
clerkPublishableKey: options.staging.clerkPublishableKey,
|
|
62
|
+
});
|
|
63
|
+
new ProductionDeployWorkflow_1.ProductionDeployWorkflow(project, {
|
|
64
|
+
roleArn: options.prod.githubActionRoleArn,
|
|
65
|
+
awsRegion: options.prod.region,
|
|
66
|
+
projectName: project.name,
|
|
67
|
+
clerkPublishableKey: options.prod.clerkPublishableKey,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.Application = Application;
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwbGljYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvQXBwbGljYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EseURBQXNEO0FBQ3RELHVEQUFvRDtBQUNwRCxpRUFBOEQ7QUFDOUQseUVBQXNFO0FBQ3RFLGlFQUE4RDtBQUM5RCx1REFBb0Q7QUFDcEQseUNBQXlEO0FBQ3pELGlEQUE4QztBQUM5QywyREFBd0Q7QUFDeEQseURBQXNEO0FBQ3RELHlFQUFzRTtBQUN0RSxt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pb246IG9wdGlvbnMuZGV2LnJlZ2lvbixcbiAgICAgIGNsZXJrUHVibGlzaGFibGVLZXk6IG9wdGlvbnMuY2xlcmtQdWJsaXNoYWJsZUtleSxcbiAgICB9KTtcblxuICAgIG5ldyBQckNsZWFudXBXb3JrZmxvdyhwcm9qZWN0LCB7XG4gICAgICByb2xlQXJuOiBvcHRpb25zLmRldi5naXRodWJBY3Rpb25Sb2xlQXJuLFxuICAgICAgYXdzUmVnaW9uOiBvcHRpb25zLmRldi5yZWdpb24sXG4gICAgfSk7XG5cbiAgICBuZXcgU3RhZ2luZ0RlcGxveVdvcmtmbG93KHByb2plY3QsIHtcbiAgICAgIHJvbGVBcm46IG9wdGlvbnMuc3RhZ2luZy5naXRodWJBY3Rpb25Sb2xlQXJuLFxuICAgICAgYXdzUmVnaW9uOiBvcHRpb25zLnN0YWdpbmcucmVnaW9uLFxuICAgICAgcHJvamVjdE5hbWU6IHByb2plY3QubmFtZSxcbiAgICAgIGNsZXJrUHVibGlzaGFibGVLZXk6IG9wdGlvbnMuc3RhZ2luZy5jbGVya1B1Ymxpc2hhYmxlS2V5LFxuICAgIH0pO1xuXG4gICAgbmV3IFByb2R1Y3Rpb25EZXBsb3lXb3JrZmxvdyhwcm9qZWN0LCB7XG4gICAgICByb2xlQXJuOiBvcHRpb25zLnByb2QuZ2l0aHViQWN0aW9uUm9sZUFybixcbiAgICAgIGF3c1JlZ2lvbjogb3B0aW9ucy5wcm9kLnJlZ2lvbixcbiAgICAgIHByb2plY3ROYW1lOiBwcm9qZWN0Lm5hbWUsXG4gICAgICBjbGVya1B1Ymxpc2hhYmxlS2V5OiBvcHRpb25zLnByb2QuY2xlcmtQdWJsaXNoYWJsZUtleSxcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationStackFile = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
class ApplicationStackFile extends projen_1.SampleFile {
|
|
6
|
+
constructor(project) {
|
|
7
|
+
super(project, 'src/stacks/ApplicationStack.ts', {
|
|
8
|
+
contents: `import { Construct } from 'constructs';
|
|
9
|
+
import { BaseApplicationStack, BaseApplicationStackProps } from './BaseApplicationStack';
|
|
10
|
+
|
|
11
|
+
export interface ApplicationStackProps extends BaseApplicationStackProps {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class ApplicationStack extends BaseApplicationStack {
|
|
16
|
+
constructor(scope: Construct, id: string, props: ApplicationStackProps) {
|
|
17
|
+
super(scope, id, props);
|
|
18
|
+
// extend the stack by adding constructs here
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.ApplicationStackFile = ApplicationStackFile;
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwbGljYXRpb25TdGFja0ZpbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvQXBwbGljYXRpb25TdGFja0ZpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbUNBQW9DO0FBR3BDLE1BQWEsb0JBQXFCLFNBQVEsbUJBQVU7SUFDbEQsWUFBWSxPQUE0QjtRQUN0QyxLQUFLLENBQUMsT0FBTyxFQUFFLGdDQUFnQyxFQUFFO1lBQy9DLFFBQVEsRUFBRTs7Ozs7Ozs7Ozs7OztDQWFmO1NBQ0ksQ0FBQyxDQUFDO0lBQ0wsQ0FBQztDQUNGO0FBbkJELG9EQW1CQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFNhbXBsZUZpbGUgfSBmcm9tICdwcm9qZW4nO1xuaW1wb3J0IHsgQXdzQ2RrVHlwZVNjcmlwdEFwcCB9IGZyb20gJ3Byb2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