Skip to content

Feat/hono rpc#3

Merged
drobilc merged 23 commits intomasterfrom
feat/hono-rpc
Jan 28, 2026
Merged

Feat/hono rpc#3
drobilc merged 23 commits intomasterfrom
feat/hono-rpc

Conversation

@zigapk
Copy link
Copy Markdown
Member

@zigapk zigapk commented Jan 23, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @zigapk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant architectural enhancements by integrating Hono RPC for type-safe API communication and 'better-auth' for a comprehensive authentication solution. The server-side code has been modularized into distinct feature modules, improving organization and maintainability. Additionally, the database workflow has been streamlined with new Drizzle commands, and a custom Vite plugin now enforces strict architectural boundaries between client and server code. These changes collectively aim to boost developer productivity, improve code quality, and provide better observability through enhanced OpenTelemetry tracing.

Highlights

  • Hono RPC Integration: Implemented type-safe API calls between frontend and backend using 'hono-rpc-query' and '@tanstack/react-query', significantly improving developer experience and reducing runtime errors.
  • Better Auth Setup: Integrated 'better-auth' for robust authentication, including Drizzle adapter, auto-generated schema, and a dedicated middleware for user context injection into traces.
  • Modular Server Architecture: Refactored server routes into a 'features' directory (e.g., 'auth', 'health', 'demo', 'otel'), promoting better organization and scalability.
  • Enhanced Database Workflow: Introduced new 'bun run db:' commands for Drizzle (push, generate, migrate, regenerate-auth schema) and clarified development/production database workflows in the README.
  • Architectural Boundary Enforcement: Added a custom Vite plugin ('preventImports') to strictly enforce that client-side code ('web/') cannot import directly from server-side code ('server/'), improving code separation and preventing accidental leaks.
  • OpenTelemetry Improvements: Enhanced OpenTelemetry tracing with new instrumentation for Better Auth and Drizzle, a dedicated trace proxy for frontend traces, and improved user context propagation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces significant architectural changes, migrating the Hono backend to a feature-based structure and integrating Hono RPC with React Query for type-safe API calls. It also incorporates Better Auth for authentication and refines OpenTelemetry tracing across both frontend and backend. The addition of a Vite plugin to prevent server-side code imports into the client build is a strong security and architectural improvement. Overall, the changes enhance maintainability, type safety, and observability of the application.

@timkalan timkalan requested a review from Copilot January 28, 2026 07:31
@timkalan timkalan marked this pull request as ready for review January 28, 2026 07:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements Hono RPC for type-safe client-server communication, integrates Better Auth for authentication, restructures the server into a feature-based architecture, and adds comprehensive testing infrastructure with Vitest.

Changes:

  • Adds Hono RPC client with React Query integration for type-safe API calls
  • Implements Better Auth with email/password authentication and database-backed sessions
  • Refactors server architecture into features (auth, demo, health, otel) with dedicated middleware
  • Adds Vitest testing infrastructure with PGlite for isolated database tests
  • Creates Vite plugin to enforce architectural boundaries (prevent client from importing server code)

Reviewed changes

Copilot reviewed 60 out of 66 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web/lib/api.ts Type-safe Hono RPC client setup using hono-rpc-query
web/lib/auth-client.ts Better Auth React client configuration
web/router.tsx Adds QueryClientProvider for React Query integration
web/components/auth-demo.tsx Demo component showcasing authentication flow with tracing
web/components/ui/input.tsx New input component following shadcn pattern
server/server.ts Refactored entry point with feature-based routing and middleware composition
server/lib/auth.ts Better Auth configuration with Drizzle adapter and OTel instrumentation
server/lib/router.ts Typed Hono router factory with middleware types
server/middleware/auth.middleware.ts Session and authentication middleware with request context
server/middleware/db.middleware.ts Database injection middleware
server/features/demo/routes/demo-trace.ts Demo route with Zod validation and parameterized testing
server/features/auth/routes/handler.ts Better Auth handler with OpenTelemetry span enrichment
server/database/index.ts Database connection with OTel instrumentation
server/database/schema/auth.ts Auto-generated Better Auth schema tables
server/utils/testing/* Comprehensive testing utilities (test-db, test-app, test-auth, test-users)
vite-plugins.ts Custom Vite plugin to prevent server imports in client code
shared/tracing.ts Shared OpenTelemetry tracing utilities for client and server
scripts/dev.ts Development orchestrator with dynamic port allocation
AGENTS.md New AI agent guidelines for the codebase
Comments suppressed due to low confidence (1)

server/database/index.ts:5

  • The database schema is not passed to the drizzle instance. This will prevent Drizzle's relational query API from working. The schema should be imported and passed as a configuration option to the drizzle function, similar to how it's done in the test database setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@drobilc drobilc merged commit aa61386 into master Jan 28, 2026
4 of 5 checks passed
@drobilc drobilc deleted the feat/hono-rpc branch January 28, 2026 09:48
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.

4 participants