Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
backend: Add Quarkus skeleton project
Browse files Browse the repository at this point in the history
  • Loading branch information
ozfox committed May 6, 2024
1 parent b74804e commit e41e998
Show file tree
Hide file tree
Showing 21 changed files with 1,636 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web_backend/quarkus-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!target/*-runner
!target/*-runner.jar
!target/lib/*
!target/quarkus-app/*
47 changes: 47 additions & 0 deletions web_backend/quarkus-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.flattened-pom.xml

# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea/*
*.ipr
*.iml
*.iws
# Allow some IntelliJ files
!.idea/codeStyles/
!.idea/checkstyle-idea.xml
!.idea/google-java-format.xml

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode
.factorypath

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

# Local environment
.env

# Plugin directory
/.quarkus/cli/plugins/
26 changes: 26 additions & 0 deletions web_backend/quarkus-app/.idea/checkstyle-idea.xml

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

57 changes: 57 additions & 0 deletions web_backend/quarkus-app/.idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions web_backend/quarkus-app/.idea/codeStyles/codeStyleConfig.xml

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

6 changes: 6 additions & 0 deletions web_backend/quarkus-app/.idea/google-java-format.xml

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

1 change: 1 addition & 0 deletions web_backend/quarkus-app/.mvn/wrapper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
maven-wrapper.jar
98 changes: 98 additions & 0 deletions web_backend/quarkus-app/.mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.io.IOException;
import java.io.InputStream;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public final class MavenWrapperDownloader
{
private static final String WRAPPER_VERSION = "3.2.0";

private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );

public static void main( String[] args )
{
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );

if ( args.length != 2 )
{
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
System.exit( 1 );
}

try
{
log( " - Downloader started" );
final URL wrapperUrl = new URL( args[0] );
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
downloadFileFromURL( wrapperUrl, wrapperJarPath );
log( "Done" );
}
catch ( IOException e )
{
System.err.println( "- Error downloading: " + e.getMessage() );
if ( VERBOSE )
{
e.printStackTrace();
}
System.exit( 1 );
}
}

private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
throws IOException
{
log( " - Downloading to: " + wrapperJarPath );
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
{
final String username = System.getenv( "MVNW_USERNAME" );
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
Authenticator.setDefault( new Authenticator()
{
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication( username, password );
}
} );
}
try ( InputStream inStream = wrapperUrl.openStream() )
{
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
}
log( " - Downloader complete" );
}

private static void log( String msg )
{
if ( VERBOSE )
{
System.out.println( msg );
}
}

}
18 changes: 18 additions & 0 deletions web_backend/quarkus-app/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
40 changes: 40 additions & 0 deletions web_backend/quarkus-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- markdownlint-disable-file -->
<div align="center">
<h1>Teamagochi Web-Backend</h1>

The backend for the Teamgochi project, build with the [Quarkus](https://quarkus.io) Java Framework.<br /><br />
<strong>[Explore the docs](https://github.com/smartuni/teamagochi/tree/main/web_backend)</strong>
</div>

<!-- ~~~~~~~~~~~~~~~~~~~ END OF HEADER ~~~~~~~~~~~~~~~~~~~ -->

## Usage

The development environment can be started by using the [Quarkus CLI](https://quarkus.io/guides/cli-tooling),
the `mvnw.cmd` script (Windows) or the equivalent `./mvnw` (Linux).

```shell
quarkus dev

# Maven
./mvnw compile quarkus:dev
mvnw.cmd compile quarkus:dev
```

Run `quarkus --help`, `./mvnw quarkus --help` or `mvnw.cmd quarkus --help` to display help and all available commands.
Read more about the [development mode](https://quarkus.io/guides/maven-tooling#dev-mode) or
about the [command line interface](https://quarkus.io/guides/cli-tooling) in general.

## Extensions

The following table contains all used [Quarkus Extensions](https://quarkus.io/extensions/)

| Name | Links | Why? |
|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| REST | [Docs](https://quarkus.io/guides/rest), [Info](https://quarkus.io/extensions/io.quarkus/quarkus-rest) | Create and provide REST services |
| REST Jackson | [Docs](https://quarkus.io/guides/rest#json-serialisation), [Info](https://quarkus.io/extensions/io.quarkus/quarkus-rest-jackson/) | Jackson serialization (JSON) support for REST extension |
| REST Client | [Docs](https://quarkus.io/guides/rest-client), [Info](https://quarkus.io/extensions/io.quarkus/quarkus-rest-client/) | Call REST services, support receiving Server-sent events (SSE) |
| REST Client Jackson | [Info](https://quarkus.io/extensions/io.quarkus/quarkus-rest-client-jackson/) | Jackson serialization (JSON) support for the REST Client |
| Hibernate ORM with Panache | [Docs](https://quarkus.io/guides/hibernate-orm-panache), [Info](https://quarkus.io/extensions/io.quarkus/quarkus-hibernate-orm-panache/) | Domain model persistence for relational databases using the the repository pattern |
| JDBC Driver - PostgreSQL | [Docs](https://quarkus.io/guides/datasource), [Info](https://quarkus.io/extensions/io.quarkus/quarkus-jdbc-postgresql/) | Connect to the PostreSQL database via JDBC |
| JDBC Driver - H2 | [Docs](https://quarkus.io/guides/datasource), [Info](https://quarkus.io/extensions/io.quarkus/quarkus-jdbc-h2/) | Connect to the H2 database via JDBC |
Loading

0 comments on commit e41e998

Please sign in to comment.