From 0bfb90cfc1f854a1f003c3cf34e3efdcee28115f Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:49:27 +0000 Subject: [PATCH] API mode UI (#5287) # Description of Changes image --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --- app/core/build.gradle | 18 +- .../main/resources/static/api-landing.html | 268 ++++++++++++++++++ .../main/resources/static/api-wordmark.svg | 4 + 3 files changed, 287 insertions(+), 3 deletions(-) create mode 100644 app/core/src/main/resources/static/api-landing.html create mode 100644 app/core/src/main/resources/static/api-wordmark.svg diff --git a/app/core/build.gradle b/app/core/build.gradle index c7bedf350..9035b44a7 100644 --- a/app/core/build.gradle +++ b/app/core/build.gradle @@ -268,6 +268,18 @@ tasks.register('cleanFrontendAssets', Delete) { delete generatedFrontendPaths.collect { new File(resourcesStaticDir, it) } } +tasks.register('copyApiLandingPage', Copy) { + group = 'frontend' + description = 'Copy API landing page to index.html for backend-only mode' + from(new File(resourcesStaticDir, 'api-landing.html')) + into(resourcesStaticDir) + rename('api-landing.html', 'index.html') + dependsOn cleanFrontendAssets + doFirst { + println "Copying API landing page to index.html for backend-only mode..." + } +} + // Ensure copyFrontendAssets runs after spotless tasks tasks.named('copyFrontendAssets').configure { mustRunAfter tasks.matching { it.name.startsWith('spotless') } @@ -277,9 +289,9 @@ if (buildWithFrontend) { println "Frontend build enabled - JAR will include React frontend" processResources.dependsOn copyFrontendAssets } else { - println "Frontend build disabled - JAR will be backend-only" - // When not building the UI, ensure any stale frontend assets are removed - processResources.dependsOn cleanFrontendAssets + println "Frontend build disabled - JAR will be backend-only with API landing page" + // When not building the UI, ensure any stale frontend assets are removed and use API landing page + processResources.dependsOn copyApiLandingPage } bootJar.dependsOn ':common:jar' diff --git a/app/core/src/main/resources/static/api-landing.html b/app/core/src/main/resources/static/api-landing.html new file mode 100644 index 000000000..29a0d4abf --- /dev/null +++ b/app/core/src/main/resources/static/api-landing.html @@ -0,0 +1,268 @@ + + + + + + + Stirling-PDF - API Server + + + + + + + + + + + +
+
+ + +
+

+ This Stirling-PDF instance is running in API-only mode. The web interface has not been included in this build. +

+
+ + Open API Documentation + +
+ +
+

Looking for the Web UI?

+ +

If you're using Docker:

+
    +
  • You may have pulled an API-only image or there was a build configuration issue
  • +
  • Use the standard Docker image: stirlingtools/stirling-pdf:latest
  • +
+ +

If you're using a JAR file:

+
    +
  • You downloaded Stirling-PDF-server.jar which is the API-only version without UI
  • +
  • Download the full version from GitHub Releases:
  • +
  • Stirling-PDF.jar - Standard version with UI
  • +
  • Stirling-PDF-with-login.jar - Version with authentication features
  • +
+ +

If you built from source:

+
    +
  • Rebuild with: ./gradlew build -PbuildWithFrontend=true
  • +
  • Or deploy the frontend separately from the /frontend directory
  • +
+
+ +
+ +
+

Need Help?

+

Join our community for support:

+ +
+
+
+ + + + diff --git a/app/core/src/main/resources/static/api-wordmark.svg b/app/core/src/main/resources/static/api-wordmark.svg new file mode 100644 index 000000000..deac1ee16 --- /dev/null +++ b/app/core/src/main/resources/static/api-wordmark.svg @@ -0,0 +1,4 @@ + + + +