Skip to content

Commit 8d431be

Browse files
final solution first commit
1 parent 0f5853f commit 8d431be

File tree

84 files changed

+5880
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+5880
-0
lines changed

.github/workflows/compile-backend.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
compile-backend:
5+
runs-on: ubuntu-latest
6+
name: Compile Backend Code
7+
steps:
8+
- uses actions/checkout@v3
9+
10+
- name: Set up JDK
11+
uses: actions/setup-java@v4
12+
with:
13+
distribution: 'temurin'
14+
java-version: '17'
15+
16+
- name: Compile with Maven
17+
run: |
18+
cd app
19+
./mvnw clean compile

.github/workflows/lint-backend.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
lint-java:
5+
runs-on: ubuntu-latest
6+
name: Checkstyle Java Linting
7+
steps:
8+
- uses: actions/checkout@v3
9+
10+
- name: Set up JDK
11+
uses: actions/setup-java@v4
12+
with:
13+
distribution: 'temurin'
14+
java-version: '17'
15+
16+
- name: Download Checkstyle
17+
run: curl -L -o checkstyle.jar https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.12.1/checkstyle-10.12.1-all.jar
18+
19+
- name: Run Checkstyle
20+
run: |
21+
java -jar checkstyle.jar -c /google_checks.xml app/src/main/java/com/project/back_end || true

.github/workflows/lint-docker.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
dockerlint:
5+
runs-on: ubuntu-latest
6+
name: Lint Dockerfiles
7+
steps:
8+
- uses: actions/checkout@v3
9+
10+
- name: Run hadolint
11+
uses: hadolint/[email protected]
12+
with:
13+
dockerfile: ./app/Dockerfile

.github/workflows/lint-frontend.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
lint-frontend:
5+
runs-on: ubuntu-latest
6+
name: Lint HTML, CSS, and JS
7+
steps:
8+
- uses: actions/checkout@v3
9+
10+
- name: Set up Node.js
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: '18'
14+
15+
- name: Install linters
16+
run: |
17+
npm install -g htmlhint stylelint eslint
18+
19+
- name: Lint HTML
20+
run: htmlhint app/src/main/resources/static/assets/pages//*.html || true
21+
22+
- name: Lint CSS
23+
run: stylelint "app/src/main/resources/static/assets/css//*.css" || true
24+
25+
- name: Lint JS
26+
run: eslint app/src/main/resources/static/assets/js//*.js || true

app/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
*#
2+
*.iml
3+
*.ipr
4+
*.iws
5+
*.jar
6+
*.sw?
7+
*~
8+
.#*
9+
.*.md.html
10+
.DS_Store
11+
.attach_pid*
12+
.classpath
13+
.factorypath
14+
.gradle
15+
.metadata
16+
.project
17+
.recommenders
18+
.settings
19+
.springBeans
20+
.vscode
21+
/code
22+
MANIFEST.MF
23+
_site/
24+
activemq-data
25+
bin
26+
build
27+
!/**/src/**/bin
28+
!/**/src/**/build
29+
build.log
30+
dependency-reduced-pom.xml
31+
dump.rdb
32+
interpolated*.xml
33+
lib/
34+
manifest.yml
35+
out
36+
overridedb.*
37+
target
38+
.flattened-pom.xml
39+
secrets.yml
40+
.gradletasknamecache
41+
.sts4-cache
42+
.git-hooks/
43+
node_modules

app/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Step 1: Use Maven with Temurin JDK 21 for building the app
2+
FROM maven:3.9.9-eclipse-temurin-17 AS builder
3+
4+
WORKDIR /app
5+
6+
COPY pom.xml .
7+
COPY src ./src
8+
9+
# Maven is pre-installed; no need to apt-get anything
10+
RUN mvn clean package -DskipTests
11+
12+
# Step 2: Use Temurin JRE 17 for runtime
13+
FROM eclipse-temurin:17.0.15_6-jre
14+
15+
WORKDIR /app
16+
17+
COPY --from=builder /app/target/back-end-0.0.1-SNAPSHOT.jar app.jar
18+
19+
EXPOSE 8080
20+
21+
ENTRYPOINT ["java", "-jar", "app.jar"]

app/HELP.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Read Me First
2+
The following was discovered as part of building this project:
3+
4+
* The original package name 'com.project.back-end' is invalid and this project uses 'com.project.back_end' instead.
5+
6+
# Getting Started
7+
8+
### Reference Documentation
9+
For further reference, please consider the following sections:
10+
11+
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
12+
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.4.4/maven-plugin)
13+
* [Create an OCI image](https://docs.spring.io/spring-boot/3.4.4/maven-plugin/build-image.html)
14+
* [Spring Data MongoDB](https://docs.spring.io/spring-boot/3.4.4/reference/data/nosql.html#data.nosql.mongodb)
15+
* [Spring Web](https://docs.spring.io/spring-boot/3.4.4/reference/web/servlet.html)
16+
* [Spring Data JPA](https://docs.spring.io/spring-boot/3.4.4/reference/data/sql.html#data.sql.jpa-and-spring-data)
17+
* [Thymeleaf](https://docs.spring.io/spring-boot/3.4.4/reference/web/servlet.html#web.servlet.spring-mvc.template-engines)
18+
19+
### Guides
20+
The following guides illustrate how to use some features concretely:
21+
22+
* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/)
23+
* [Accessing Data with MongoDB](https://spring.io/guides/gs/accessing-data-mongodb/)
24+
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
25+
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
26+
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
27+
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
28+
* [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/)
29+
30+
### Maven Parent overrides
31+
32+
Due to Maven's design, elements are inherited from the parent POM to the project POM.
33+
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
34+
To prevent this, the project POM contains empty overrides for these elements.
35+
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.
36+

0 commit comments

Comments
 (0)