> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How EdgeSpark works

> How EdgeSpark works: the platform manages deployments and generated types, while your Hono app runs globally on Cloudflare's edge.

EdgeSpark combines a managed deployment platform with a runtime SDK for your app. You write a Hono server, declare your app schema and buckets in the repo, and deploy to Cloudflare's edge.

## The platform

EdgeSpark has two main layers:

* A deployment layer that creates projects, stores metadata, applies configuration, and manages deploys
* An edge runtime layer that executes your app globally on Cloudflare Workers

You interact with the platform through the CLI. You do not manage the underlying infrastructure yourself.

## What happens on a request

<Steps>
  <Step title="Routing">
    EdgeSpark routes the request to your deployed worker based on the project hostname.
  </Step>

  <Step title="Session validation">
    The platform validates the session and determines whether the request is authenticated.
  </Step>

  <Step title="Path-based auth enforcement">
    Route prefixes such as `/api/*`, `/api/public/*`, and `/api/webhooks/*` determine whether login is required before your code runs.
  </Step>

  <Step title="Runtime SDK binding">
    EdgeSpark binds the request-scoped SDK values you import from `edgespark` and `edgespark/http`.
  </Step>

  <Step title="Your code runs">
    Hono dispatches to your matching handler, where you can use `db`, `auth`, `storage`, `secret`, `vars`, and `ctx`.
  </Step>

  <Step title="Response">
    Your handler returns a response, and any background work scheduled through `ctx.runInBackground()` continues after the response is sent.
  </Step>
</Steps>

## No local EdgeSpark server

EdgeSpark does not run a separate local platform emulator for your server. For publicly created projects today, `edgespark deploy` updates the current default project environment directly.

Use `edgespark deploy --dry-run` aggressively when you want build validation without changing the live environment. Public staging support is coming soon.

## Related concepts

<Columns cols={2}>
  <Card title="The client object" icon="code" href="/concepts/client-object">
    How the runtime SDK is exposed in your server code.
  </Card>

  <Card title="Platform security" icon="shield" href="/concepts/platform-security">
    How the platform validates queries and enforces security at runtime.
  </Card>
</Columns>
