Skip to content

Commit 249d090

Browse files
committed
init: migrate from professional-services-public
0 parents  commit 249d090

22 files changed

Lines changed: 2257 additions & 0 deletions

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# Binary files should be left untouched
11+
*.jar binary
12+

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# exclude jar for gradle wrapper
12+
!gradle/wrapper/*.jar
13+
14+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15+
hs_err_pid*
16+
17+
# build files
18+
**/target
19+
target
20+
.gradle
21+
build
22+
bin/
23+
24+
petstore-openapi-client/

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Quarkus Pet Store API
2+
3+
This is a Quarkus implementation of the Pet Store API. It's equivalent to the Spring Boot implementation but uses Quarkus framework instead.
4+
5+
## Requirements
6+
7+
- JDK 17 or higher
8+
- Gradle 8.x
9+
10+
## Building and Running
11+
12+
You can build and run the application using Gradle:
13+
14+
```bash
15+
./gradlew quarkusDev
16+
```
17+
18+
This will start the application in development mode. The API will be accessible at http://localhost:8080/api
19+
20+
## Features
21+
22+
- RESTful API for pets, categories, and tags
23+
- OpenAPI client generation
24+
- Basic security configuration
25+
- SPA support
26+
27+
## API Endpoints
28+
29+
- `/api/pets/random` - Get a random pet
30+
- `/api/pets/random/{count}` - Get multiple random pets
31+
- `/api/categories/random` - Get a random category
32+
- `/api/categories/random/{count}` - Get multiple random categories
33+
- `/api/tags/random` - Get a random tag
34+
- `/api/tags/random/{count}` - Get multiple random tags
35+
36+
The application also supports standard CRUD operations on categories and tags.
37+
38+
## Building a Native Executable
39+
40+
To build a native executable:
41+
42+
```bash
43+
./gradlew build -Dquarkus.package.type=native
44+
```
45+
46+
You can then run the native executable with:
47+
48+
```bash
49+
./build/sourcegraph-quarkus-pet-store-runner
50+
```

build.gradle.kts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
plugins {
2+
application
3+
id("io.quarkus") version "3.9.0"
4+
java
5+
}
6+
7+
repositories {
8+
// Use Maven Central for resolving dependencies.
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
// Quarkus dependencies
14+
implementation(platform("io.quarkus:quarkus-bom:3.9.0"))
15+
implementation("io.quarkus:quarkus-resteasy-reactive-jackson")
16+
implementation("io.quarkus:quarkus-resteasy-reactive")
17+
// Security dependency removed for this example application
18+
implementation("io.quarkus:quarkus-arc")
19+
testImplementation("io.quarkus:quarkus-junit5")
20+
testImplementation("io.rest-assured:rest-assured:5.3.0")
21+
22+
// OpenAPI/Swagger support
23+
implementation("io.quarkus:quarkus-smallrye-openapi")
24+
25+
// Use JUnit Jupiter for testing.
26+
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
27+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
28+
29+
// This dependency is used by the application.
30+
implementation("com.google.guava:guava:33.0.0-jre")
31+
}
32+
33+
// Apply a specific Java toolchain to ease working on different environments.
34+
java {
35+
toolchain {
36+
languageVersion = JavaLanguageVersion.of(17)
37+
}
38+
}
39+
40+
application {
41+
// Define the main class for the application.
42+
mainClass.set("com.sourcegraph.petstore.App")
43+
}
44+
45+
tasks.named<Test>("test") {
46+
// Use JUnit Platform for unit tests.
47+
useJUnitPlatform()
48+
}
49+
50+
tasks.clean {
51+
delete(layout.projectDirectory.dir("petstore-openapi-client"))
52+
}

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator).
2+
# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option.
3+
#
4+
# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
5+
# For example, uncomment below to build for Android
6+
#target = android

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)