Skip to content

feat: add ui and integrate with Go API server#31

Open
MeeraSRaj wants to merge 1 commit into
mainfrom
feature/ui-integration
Open

feat: add ui and integrate with Go API server#31
MeeraSRaj wants to merge 1 commit into
mainfrom
feature/ui-integration

Conversation

@MeeraSRaj

Copy link
Copy Markdown
Collaborator

No description provided.

@MeeraSRaj
MeeraSRaj requested a review from AniruthKarthik July 7, 2026 15:04
Comment thread cmd/nodeshare/main.go

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the main CLI daemon exits or gets a SIGINT/SIGTERM, the listener sockets might hang. Could we add a Shutdown(ctx) or Close() method to api.Server and trigger it in our cleanup/teardown sequence so that it shuts down gratefully ?

Comment thread internal/api/server.go
"peerId": s.host.ID().String(),
"connectionCode": code,
"connectedPeers": len(peers),
"uptime": "0h", // TODO: Track uptime

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can store startTime time.Time on the Server struct when the server starts, and calculate the actual uptime here using time.Since(s.startTime) instead of hardcoding "0h". It's better to resolve this TODO before merging

});

// 2. Connect to SSE events
const sse = new EventSource('http://localhost:9001/api/events');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Having http://localhost:9001 hardcoded here will break if the backend is started on a custom port via the --api-port flag.

Can we pull this from a Next.js environment variable (e.g., process.env.NEXT_PUBLIC_API_URL with a fallback to localhost:9001) so it is configurable?

Note: We'll also need to update the connect page where it fetches http://localhost:9001/api/connect.

@AniruthKarthik
AniruthKarthik force-pushed the feature/ui-integration branch from 5151e75 to 39ec4b8 Compare July 8, 2026 13:59
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