def run_process_and_launch_url(
    run_command: list[str | None], backend_present: bool = True
):
    """Run the process and launch the URL.

    Args:
        run_command: The command to run.
        backend_present: Whether the backend is present.
    """
    from reflex.utils import processes

    json_file_path = get_web_dir() / constants.PackageJson.PATH
    last_content, last_hash = get_package_json_and_hash(json_file_path)
    process = None
    first_run = True

    while True:
        if process is None:
            kwargs = {}
            if constants.IS_WINDOWS and backend_present:
                kwargs["creationflags"] = subprocess.CREATE_NEW_PROCESS_GROUP  # pyright: ignore [reportAttributeAccessIssue]
            process = processes.new_process(
                run_command,
                cwd=get_web_dir(),
                shell=constants.IS_WINDOWS,
                **kwargs,
            )
            global frontend_process
            frontend_process = process
        if process.stdout:
            for line in processes.stream_logs("Starting frontend", process):
                new_content, new_hash = get_package_json_and_hash(json_file_path)
                if new_hash != last_hash:
                    dependencies_change, dev_dependencies_change = (
                        get_different_packages(last_content, new_content)
                    )
                    last_content, last_hash = new_content, new_hash
                    console.info(
                        "Detected changes in package.json.\n"
                        + format_change("Dependencies", dependencies_change)
                        + format_change("Dev Dependencies", dev_dependencies_change)
                    )

                match = re.search(constants.Next.FRONTEND_LISTENING_REGEX, line)
                if match:
                    if first_run:
                        url = match.group(1)
                        if get_config().frontend_path != "":
                            url = urljoin(url, get_config().frontend_path)

                        console.print(
                            f"App running at: [bold green]{url}[/bold green]{' (Frontend-only mode)' if not backend_present else ''}"
                        )
                        if backend_present:
                            notify_backend()
                        first_run = False
                    else:
                        console.print("Frontend is restarting...")

        if process is not None:
            break  # while True
Run the process and launch the URL.

    Args:
        run_command: The command to run.
        backend_present: Whether the backend is present.
    
reflex/utils/exec.py