Skip to content

Deployment UX Feedback: Improving the self-hosting experience #12

@gabiudrescu

Description

@gabiudrescu

Context

I recently deployed CloudMeet to Cloudflare Pages following the README instructions. While I eventually got it working, the experience was challenging. This issue aims to provide constructive feedback and spark discussion on how to improve the deployment UX for self-hosters.

Summary of Issues Encountered

During deployment, I encountered several bugs that are now tracked separately:

  • #8 - Build fails due to duplicate variable declaration
  • #9 - Event type creation fails silently
  • #10 - Calendar availability only checks primary calendar
  • #11 - SSR causes 500 errors on direct URL access

The Biggest Challenge: Lack of Observability

The most frustrating aspect of deployment was not knowing what went wrong when things failed.

What I Experienced

  1. Generic 500 errors everywhere - When something fails, you get {"message":"Internal Error"} with zero context about what actually happened.

  2. No access to logs - There's no easy way to see server-side logs. wrangler pages deployment tail exists but:

    • Requires knowing the specific deployment ID
    • Often doesn't capture the errors you need
    • Doesn't work well in non-interactive contexts
  3. Silent authentication failures - When I set secrets with trailing newlines (using echo instead of printf), the OAuth flow entered an infinite redirect loop. No error was logged anywhere - I had to guess that the secrets were malformed.

  4. SSR vs Client-side mystery - The booking page worked when navigating from the homepage but returned 500 when accessed directly. Same URL, same code, completely different behavior - and no indication why.

  5. Database issues invisible - When I accidentally created two users (logged in with wrong account first), the public pages silently showed the wrong user. No warning, no error - just confusing behavior.

Impact

Each issue required significant debugging time:

  • Reading source code to understand what could fail
  • Making educated guesses about root causes
  • Trial and error to find solutions

Suggestions for Improvement

1. Better Error Messages

Instead of:

{"message":"Internal Error"}

Consider:

{
  "message": "Failed to create event type",
  "code": "DB_INSERT_FAILED",
  "details": "Cannot call toString on null value",
  "file": "event-types/new/+page.server.ts",
  "line": 119
}

Even if detailed errors are only shown in development mode, it would help immensely.

2. Health Check Endpoint

A /api/health endpoint that verifies:

  • Database connection works
  • KV namespace is accessible
  • Required environment variables are set
  • OAuth configuration is valid

This would catch 90% of deployment issues immediately.

3. Deployment Verification Script

A npm run verify-deployment command that:

  • Checks all required secrets are set
  • Validates secret formats (no newlines, correct patterns)
  • Tests database connectivity
  • Verifies OAuth redirect URIs match APP_URL

4. Better Documentation for Edge Cases

The README covers the happy path well, but doesn't address:

  • What to do when you get a 500 error
  • How to debug authentication issues
  • The single-user assumption and its implications
  • Required wrangler.toml settings like nodejs_compat

5. Request Tracing

Add a request ID to all responses:

X-Request-Id: abc123

And log it server-side so errors can be correlated.

What Worked Well

To be fair, some things were smooth:

  • The GitHub Actions workflow is well-structured
  • D1 and KV setup via wrangler is straightforward
  • The application itself is well-designed once running

Questions for Discussion

  1. Is there appetite for improving observability, or is this considered out of scope for a "simple" Calendly alternative?
  2. Would a --verbose deployment mode that logs more details be feasible?
  3. Should the app detect common misconfigurations and warn users?

Happy to contribute PRs if there's alignment on the direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions