Skip to content

Commit

Permalink
Split site to landing and dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
matusfaro committed Nov 25, 2023
1 parent 01357ce commit b74b7a5
Show file tree
Hide file tree
Showing 58 changed files with 16,420 additions and 147 deletions.
36 changes: 6 additions & 30 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dataspray-cli/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
</appender>

<logger name="org.eclipse.jgit" level="INFO"/>
<logger name="io.quarkus" level="WARN"/>

<root level="INFO">
<appender-ref ref="CONSOLE"/>
Expand Down
2 changes: 0 additions & 2 deletions dataspray-common/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ aws.accountId=745602410681
aws.region=us-east-1
quarkus.native.enable-reports=true
quarkus.test.integration-test-profile=test
# Lambda parse security context https://quarkus.io/guides/aws-lambda-http#security-integration
quarkus.lambda-http.enable-security=true
# Need to build with all log levels enabled
quarkus.log.category."io.dataspray".min-level=ALL
# Need to include test properties within for integration tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public String publish(String apiKey, Project project, String processorName, Stri
processor.getOutputStreams().stream().map(StreamLink::getStreamName).collect(Collectors.toSet()),
handler);
TaskVersion deployedVersion = streamApi.control(apiKey).deployVersion(processor.getTaskId(), new DeployRequest()
.runtime(DeployRequest.RuntimeEnum.JAVA11)
.runtime(DeployRequest.RuntimeEnum.JAVA21)
.handler(handler)
.inputQueueNames(processor.getInputStreams().stream()
.map(StreamLink::getStreamName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<url>https://dataspray.io</url>

<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
24 changes: 24 additions & 0 deletions dataspray-lambda-web/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright 2023 Matus Faro
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
quarkus.banner.enabled=false
# Lambda parse security context https://quarkus.io/guides/aws-lambda-http#security-integration
quarkus.lambda-http.enable-security=true
29 changes: 14 additions & 15 deletions dataspray-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,26 @@
<configuration>
<overWriteSnapshots>true</overWriteSnapshots>
<artifactItems>
<!-- For static NextJS site -->
<artifactItem>
<groupId>io.dataspray</groupId>
<artifactId>dataspray-site</artifactId>
<artifactId>dataspray-site-landing</artifactId>
<classifier>static-site</classifier>
<version>${project.version}</version>
<type>tar.gz</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/static-site/</outputDirectory>
<outputDirectory>${project.build.directory}/static-site-landing/</outputDirectory>
<includes>**</includes>
</artifactItem>
<artifactItem>
<groupId>io.dataspray</groupId>
<artifactId>dataspray-site-dashboard</artifactId>
<classifier>static-site</classifier>
<version>${project.version}</version>
<type>tar.gz</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/static-site-dashboard/</outputDirectory>
<includes>**</includes>
</artifactItem>
<!-- For Open-Next -->
<!--<artifactItem>-->
<!-- <groupId>io.dataspray</groupId>-->
<!-- <artifactId>dataspray-site</artifactId>-->
<!-- <classifier>open-next</classifier>-->
<!-- <version>${project.version}</version>-->
<!-- <type>tar.gz</type>-->
<!-- <overWrite>true</overWrite>-->
<!-- <outputDirectory>${project.build.directory}/open-next/</outputDirectory>-->
<!-- <includes>**</includes>-->
<!--</artifactItem>-->
<artifactItem>
<groupId>io.dataspray</groupId>
<artifactId>dataspray-stream-client</artifactId>
Expand Down Expand Up @@ -223,7 +221,8 @@
<argument>${project.build.directory}/code-authorizer/function.zip</argument>
<argument>${project.build.directory}/code-control/function.zip</argument>
<argument>${project.build.directory}/code-ingest/function.zip</argument>
<argument>${project.build.directory}/static-site</argument>
<argument>${project.build.directory}/static-site-landing</argument>
<argument>${project.build.directory}/static-site-dashboard</argument>
</arguments>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import software.amazon.awscdk.App;
import software.amazon.awscdk.services.lambda.SingletonFunction;

import java.util.Optional;
import java.util.Set;

@Slf4j
Expand All @@ -57,22 +58,25 @@ public static void main(String[] args) {
String authorizerCodeZip = args[1];
String controlCodeZip = args[2];
String ingestCodeZip = args[3];
String staticSiteDir = args[4];
String staticSiteLandingDir = args[4];
String staticSiteAppDir = args[4];

// Keep track of all Lambdas in order to pass config properties to them
Set<SingletonFunction> functions = Sets.newHashSet();

// Frontend
DnsStack dnsStack = new DnsStack(app, deployEnv);
// Static site
new StaticSiteStack(app, deployEnv, StaticSiteStack.Options.builder()
.identifier("landing")
.dnsStack(dnsStack)
.staticSiteDir(staticSiteDir)
.staticSiteDir(staticSiteLandingDir)
.build());
new StaticSiteStack(app, deployEnv, StaticSiteStack.Options.builder()
.identifier("dashboard")
.subdomain(Optional.of("dashboard"))
.dnsStack(dnsStack)
.staticSiteDir(staticSiteAppDir)
.build());
// Open-next
//new OpenNextStack(app, deployEnv, OpenNextStack.Options.builder()
// .dnsStack(dnsStack)
// .openNextDir(openNextDir)
// .build());

SingleTableStack singleTableStack = new SingleTableStack(app, deployEnv);
AuthNzStack authNzStack = new AuthNzStack(app, deployEnv);
Expand Down Expand Up @@ -113,7 +117,7 @@ public static void main(String[] args) {
}

private static void setConfigProperty(SingletonFunction function, String prop, String value) {
// https://quarkus.io/guides/config-reference#environment-variables
// https://quarkus.io/guides/config-reference#environment-variablespom.xml
String propAsEnvVar = prop.replaceAll("[^a-zA-Z0-9]", "_").toUpperCase();

function.addEnvironment(propAsEnvVar, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;

@Slf4j
@Getter
Expand All @@ -55,7 +56,7 @@ public class StaticSiteStack extends BaseStack {
private final AaaaRecord recordSetAaaa;

public StaticSiteStack(Construct parent, DeployEnvironment deployEnv, Options options) {
super(parent, "site", deployEnv);
super(parent, "site-" + options.getIdentifier(), deployEnv);

String fqdn = DnsStack.createFqdn(this, deployEnv);
IHostedZone dnsZone = options.getDnsStack().getDnsZone(this, fqdn);
Expand Down Expand Up @@ -98,6 +99,11 @@ public StaticSiteStack(Construct parent, DeployEnvironment deployEnv, Options op
@Value
@lombok.Builder
public static class Options {
@NonNull
String identifier;
@NonNull
@lombok.Builder.Default
Optional<String> subdomain = Optional.empty();
@NonNull
DnsStack dnsStack;
@NonNull
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions dataspray-site-dashboard/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions dataspray-site-dashboard/.idea/dataspray-site.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions dataspray-site-dashboard/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions dataspray-site-dashboard/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions dataspray-site-dashboard/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

/** @type {import('next').NextConfig} */
const nextConfig = {
...(process.env.NEXTJS_OUTPUT && {
output: process.env.NEXTJS_OUTPUT,
}),
trailingSlash: true,
reactStrictMode: true,
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
transpilePackages: [
'@cloudscape-design/components',
'@cloudscape-design/component-toolkit'
]
};

module.exports = nextConfig;
Loading

0 comments on commit b74b7a5

Please sign in to comment.