Skip to content

Add docs: WinUI frontend + Win32 backend remote task manager walkthrough#2

Open
Varshini207 wants to merge 1 commit into
mainfrom
codex/build-remote-task-manager-with-winui-and-win32-4ya2d0
Open

Add docs: WinUI frontend + Win32 backend remote task manager walkthrough#2
Varshini207 wants to merge 1 commit into
mainfrom
codex/build-remote-task-manager-with-winui-and-win32-4ya2d0

Conversation

@Varshini207

Copy link
Copy Markdown
Owner

Motivation

  • Provide a complete MVP guide for building a remote task manager on Windows with a native Win32/C++ backend and a WinUI 3/C# frontend.
  • Capture setup steps, prerequisites, and the recommended workspace layout so developers can reproduce the demo in VS Code.
  • Document a minimal, self-contained example that demonstrates CRUD over HTTP between a native backend and a desktop UI.

Description

  • Add docs/winui-win32-remote-task-manager.md containing a full walkthrough, prerequisites, and run/build instructions for both backend and frontend.
  • Include backend C++ Win32 examples (CMakeLists, task_store in-memory store, a minimal Winsock HTTP server and a main.cpp that runs on port 8080).
  • Include frontend WinUI 3 C# examples (project file, XAML for MainWindow, TaskItem model, TaskApiClient using HttpClient, and UI event handlers).
  • Provide recommended next improvements and platform-specific notes (JSON & HTTP libraries, persistence, TLS, packaging).

Testing

  • No automated tests were added or executed as part of this change.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c56f963979

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +278 to +281
if (body[start] == 't' || body[start] == 'f') {
auto end = body.find_first_of(",}\r\n", start);
return body.substr(start, end - start);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Distinguish string values from boolean literals

The extract helper treats any value starting with t or f as a boolean token, even when it is a quoted string; for example, posting {"title":"first"} makes this branch return first" (with the trailing quote), so task titles beginning with t/f are corrupted on create/update. Because this parser is used for title and completed, it should only use the boolean branch for unquoted values.

Useful? React with 👍 / 👎.

out = response(201, "Created", taskToJson(t));
}
} else if (method == "PUT" && path.rfind("/tasks/", 0) == 0) {
int id = std::stoi(path.substr(7));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle invalid task IDs before calling stoi

Parsing id with std::stoi(path.substr(7)) without validation can throw on requests like PUT /tasks/foo (or /tasks/), which will terminate the process since the exception is uncaught in the request loop. A malformed client request should return 400 instead of crashing the backend.

Useful? React with 👍 / 👎.

std::lock_guard lock(mtx_);
auto before = tasks_.size();
tasks_.erase(
std::remove_if(tasks_.begin(), tasks_.end(), [id](const Task& t) { return t.id == id; }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include when using std::remove_if

This snippet calls std::remove_if but does not include <algorithm> in task_store.cpp, so users following the guide can hit a build failure (remove_if is not a member of std) on standard-conforming toolchains. Add the missing header in the shown file to keep the walkthrough buildable.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant