Skip to content

Commit 509af78

Browse files
committed
init
0 parents  commit 509af78

36 files changed

+16190
-0
lines changed

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/backend/target/
2+
/node/
3+
/frontend/bin/
4+
/node/
5+
/frontend/node/
6+
/.idea/
7+
8+
9+
.idea/**/workspace.xml
10+
.idea/**/tasks.xml
11+
.idea/**/usage.statistics.xml
12+
.idea/**/dictionaries
13+
.idea/**/shelf
14+
15+
# Generated files
16+
.idea/**/contentModel.xml
17+
18+
# Sensitive or high-churn files
19+
.idea/**/dataSources/
20+
.idea/**/dataSources.ids
21+
.idea/**/dataSources.local.xml
22+
.idea/**/sqlDataSources.xml
23+
.idea/**/dynamic.xml
24+
.idea/**/uiDesigner.xml
25+
.idea/**/dbnavigator.xml
26+
27+
# Gradle
28+
.idea/**/gradle.xml
29+
.idea/**/libraries
30+
31+
# Gradle and Maven with auto-import
32+
# When using Gradle or Maven with auto-import, you should exclude module files,
33+
# since they will be recreated, and may cause churn. Uncomment if using
34+
# auto-import.
35+
# .idea/artifacts
36+
# .idea/compiler.xml
37+
# .idea/jarRepositories.xml
38+
# .idea/modules.xml
39+
# .idea/*.iml
40+
# .idea/modules
41+
# *.iml
42+
# *.ipr
43+
44+
# CMake
45+
cmake-build-*/
46+
47+
# Mongo Explorer plugin
48+
.idea/**/mongoSettings.xml
49+
50+
# File-based project format
51+
*.iws
52+
53+
# IntelliJ
54+
out/
55+
56+
# mpeltonen/sbt-idea plugin
57+
.idea_modules/
58+
59+
# JIRA plugin
60+
atlassian-ide-plugin.xml
61+
62+
# Cursive Clojure plugin
63+
.idea/replstate.xml
64+
65+
# Crashlytics plugin (for Android Studio and IntelliJ)
66+
com_crashlytics_export_strings.xml
67+
crashlytics.properties
68+
crashlytics-build.properties
69+
fabric.properties
70+
71+
# Editor-based Rest Client
72+
.idea/httpRequests
73+
74+
# Android studio 3.1+ serialized cache file
75+
.idea/caches/build_file_checksums.ser

backend/pom.xml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<groupId>dev.marco</groupId>
7+
<artifactId>java-angular-example</artifactId>
8+
<version>0.1-SNAPSHOT</version>
9+
<relativePath>../pom.xml</relativePath>
10+
</parent>
11+
12+
<modelVersion>4.0.0</modelVersion>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
17+
<maven.compiler.source>15</maven.compiler.source>
18+
<maven.compiler.target>15</maven.compiler.target>
19+
<failOnMissingWebXml>false</failOnMissingWebXml>
20+
</properties>
21+
22+
<artifactId>backend</artifactId>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>dev.marco</groupId>
27+
<artifactId>frontend</artifactId>
28+
<version>0.1-SNAPSHOT</version>
29+
<type>war</type>
30+
</dependency>
31+
</dependencies>
32+
33+
<build>
34+
<plugins>
35+
<plugin>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-maven-plugin</artifactId>
38+
<version>2.4.3</version>
39+
<configuration>
40+
<mainClass>dev.marco.example.springboot.Application</mainClass>
41+
</configuration>
42+
<executions>
43+
<execution>
44+
<goals>
45+
<goal>repackage</goal>
46+
</goals>
47+
</execution>
48+
</executions>
49+
</plugin>
50+
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-dependency-plugin</artifactId>
54+
<version>3.1.2</version>
55+
<executions>
56+
<execution>
57+
<id>unpackng</id>
58+
<phase>initialize</phase>
59+
<goals>
60+
<goal>unpack</goal>
61+
</goals>
62+
<configuration>
63+
<artifactItems>
64+
<artifactItem>
65+
<groupId>dev.marco</groupId>
66+
<artifactId>frontend</artifactId>
67+
<type>jar</type>
68+
<overWrite>true</overWrite>
69+
<outputDirectory>${project.build.directory}/angular</outputDirectory>
70+
</artifactItem>
71+
</artifactItems>
72+
</configuration>
73+
</execution>
74+
</executions>
75+
</plugin>
76+
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-antrun-plugin</artifactId>
80+
<version>1.8</version>
81+
<executions>
82+
<execution>
83+
<id>move</id>
84+
<phase>generate-sources</phase>
85+
<goals>
86+
<goal>run</goal>
87+
</goals>
88+
<configuration>
89+
<target>
90+
<copy todir="${project.build.directory}/classes/static" flatten="false">
91+
<fileset dir="${project.build.directory}/angular/frontend">
92+
<include name="**/*.*"/>
93+
</fileset>
94+
</copy>
95+
</target>
96+
</configuration>
97+
</execution>
98+
</executions>
99+
</plugin>
100+
</plugins>
101+
</build>
102+
</project>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package dev.marco.example.springboot;
2+
3+
import java.util.Arrays;
4+
5+
import org.springframework.boot.CommandLineRunner;
6+
import org.springframework.boot.SpringApplication;
7+
import org.springframework.boot.autoconfigure.SpringBootApplication;
8+
import org.springframework.context.ApplicationContext;
9+
import org.springframework.context.annotation.Bean;
10+
11+
@SpringBootApplication
12+
public class Application {
13+
14+
public static void main(String[] args) {
15+
SpringApplication.run(Application.class, args);
16+
}
17+
18+
@Bean
19+
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
20+
return args -> {
21+
22+
System.out.println("Let's inspect the beans provided by Spring Boot:");
23+
24+
String[] beanNames = ctx.getBeanDefinitionNames();
25+
Arrays.sort(beanNames);
26+
for (String beanName : beanNames) {
27+
System.out.println(beanName);
28+
}
29+
30+
};
31+
}
32+
33+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package dev.marco.example.springboot;
2+
3+
import org.springframework.http.MediaType;
4+
import org.springframework.web.bind.annotation.CrossOrigin;
5+
import org.springframework.web.bind.annotation.RestController;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
8+
import java.util.Collections;
9+
import java.util.Map;
10+
11+
@RestController
12+
// we allow localhost:4200 for testing purposes
13+
@CrossOrigin(origins = "http://localhost:4200")
14+
public class HelloController {
15+
16+
@RequestMapping(value = "/message", produces = MediaType.APPLICATION_JSON_VALUE)
17+
public Map<String, String> index() {
18+
return Collections.singletonMap("message", "Greetings from Spring Boot!");
19+
}
20+
21+
}

frontend/.browserslistrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

frontend/.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

frontend/.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
47+
/bin/
48+
/lib/
49+
/node/

frontend/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Frontend
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.6.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

0 commit comments

Comments
 (0)