Public Apps & Custom UIs
The Public Apps functionality in ArconQ allows developers to make their apps publicly available, exposing them to remote clients and interfaces. This functionality makes it possible to expose REST APIs for use by remote clients and allows the UI to be reachable via remote browsers.
Custom UIs on the other hand allows developers to tie their public app with related frontend, which can be either self-hosted or external.
How to register Public App
Apps that are made public are never available publicly directly. They can safely use tokens forwarded by the WebAppHost/AppProxy without calling the Identity Server. Only the claims, roles, and groups available in the token are used for authorization logic.
To add the Public Apps functionality to a client application, developers can use the following code in their app app_builder.use_public_app()
@arconq_app
def main(
container: Container,
app_builder: AppBuilder = Dependency(Container.app_builder),
) -> None:
app_builder.configure_arconq(container)
app_builder.use_public_app()
app = app_builder.build_app()
app.run()
After this code is added, the app will be available under the following URL:
https://arconq.prod/apps/public/{appAlias}/{appApi}
/apps/public section of the URL is configurable in appSettings.
appAlias is Application Alias, it can be changed in Web UI
arconq.prod is a default domain of the ArconQ
Custom UIs
During registration of public app, there is a possibility of registering Custom UIs tied to the app. It can be done via passing a list of CustomUserInterfaces shown in a snippet below:
@arconq_app
def main(
container: Container,
app_builder: AppBuilder = Dependency(Container.app_builder),
) -> None:
app_builder.configure_arconq(container)
app_builder.use_public_app(
[CustomUserInterface(name="Router", path="/router"), CustomUserInterface(name="Flask", path="/flask")]
)
app_builder.add_web_api_router(container, examples_router, examples_router.router, "/router")
app = app_builder.build_app()
app.fastapi_app.mount("/flask", WSGIMiddleware(flask_app))
app.run()
flask_app = Flask(__name__)
First property of the object specifies name which will be displayed in Admin Console. Second one is the relative path pointing to frontend of the app.

While writing your user interfaces be aware of the URL of public app while making calls to your app - it has to be an exact match. Otherwise all app API calls will result in 404 Not Found Status.
Security Considerations
When making apps publicly available, it's important to consider the security implications. For example, exposing an API publicly may open it up to potential attacks and vulnerabilities. Additionally, allowing external access to the UI may make it more difficult to control access and maintain security.
To mitigate these risks, it's important to follow best practices for secure coding and architecture. This may include implementing authentication and authorization mechanisms, using encryption and secure communication protocols, and implementing security testing and monitoring.
Conclusion
The Public Apps functionality in ArconQ provides a powerful tool for developers to make their apps available to external clients and interfaces. By following best practices for secure coding and architecture, it's possible to ensure that these apps are accessible while maintaining the highest levels of security.