Skip to content

feat: make web folder configurable#821

Open
duesee wants to merge 2 commits into
bugy:masterfrom
duesee:feat_make_web_folder_configurable
Open

feat: make web folder configurable#821
duesee wants to merge 2 commits into
bugy:masterfrom
duesee:feat_make_web_folder_configurable

Conversation

@duesee

@duesee duesee commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This PR adds a parameter to make the web folder configurable. This has a few benefits, one is that we can easily experiment with different web roots. If I didn't overlook something, not using the parameter (which defaults to "web") should keep the current behavior.

Note: This PR is mainly based on https://github.com/tfc/script-server.

Comment thread src/utils/tool_utils.py
def validate_web_build_exists(project_path):
web_folder = os.path.join(project_path, 'web')

def validate_web_build_exists(web_folder):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a closer look, the difference now is that we don't print the whole path. We could use os.path.realpath(web_folder), what do you think?

@bugy

bugy commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Hey @duesee thanks for your contribution. Can you explain your use case please?
Why is it really needed?

@duesee

duesee commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, yes, sure! From my understanding, the frontend (web-src) is a totally fine standalone package. In theory, it could be bundled and hosted (statically) anywhere, e.g., via nginx, a CDN, etc.

For us, it made sense to package it up separately with Nix so that we can refer from any other package to it, it doesn't need to be rebuild when the backend changes, we can quickly patch it if needed, etc.

In Nix, however, packages are all put under /nix/store/<hash>-<package>. So we needed a way to tell tornado where to find it (because when build like this, it won't live next to the Python application).

The other benefit is that it makes testing a little easier since we can quickly change the web source via the parameter.

Having said that... if you feel this is introducing complexity that you don't like, we can work around it! But in my opinion the increased flexibility outweights the complexity.

@bugy

bugy commented Jun 25, 2026

Copy link
Copy Markdown
Owner

From my perspective, BE and FE are tightly coupled. I cannot imagine a situation when they would be used as standalone modules.

May be you can explain Nix structure a bit more. How these 2 separate packages would live side by side. What would be the release cycle and in general how released for Nix would look like.

if you feel this is introducing complexity that you don't like

I don't like having features, which I don't understand :) It's hard to maintain something what you don't know. That's why I'm asking additional questions to learn more about it.

@duesee

duesee commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

I understand :-) Hm... maybe it makes sense then for me to provide a PR with the required Nix files as a basis for discussion? I could submit a (draft) PR so we have something to look on.

(I probably won't use my computer the next days, but will surely submit something next week :-))

@bugy

bugy commented Jun 27, 2026

Copy link
Copy Markdown
Owner

sure, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants