> ## 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.

# EdgeSpark quickstart for full-stack Cloudflare apps

> Create your first EdgeSpark full-stack app, install server and web dependencies, and deploy a Hono project to Cloudflare with D1, R2, and auth.

This EdgeSpark quickstart shows you how to install the CLI, create a full-stack app, and deploy it to Cloudflare's edge. It is the fastest path if you want to evaluate EdgeSpark for Hono, D1, auth, R2, and AI coding agent workflows.

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm install -g @edgespark/cli
    ```

    Verify the installation:

    ```bash theme={null}
    edgespark --version
    ```
  </Step>

  <Step title="Log in">
    ```bash theme={null}
    edgespark login
    ```

    EdgeSpark always prints a login URL. In a normal interactive terminal, the CLI usually opens that URL in your browser automatically and waits for you to finish sign-in.

    If an AI coding agent or another non-TTY session runs `edgespark login`, the CLI prints the URL for you to open manually in your browser. After you approve the login, the next EdgeSpark CLI command completes the login and stores your credentials in `~/.edgespark/credentials.json`.
  </Step>

  <Step title="Create a project">
    ```bash theme={null}
    edgespark init my-app --agent codex
    ```

    This creates a `my-app/` directory and:

    * Creates the project on the platform
    * Scaffolds the current fullstack project layout
    * Pulls generated platform files such as SDK types and system schema

    <Tree>
      <Folder name="my-app" defaultOpen>
        <Folder name="server" defaultOpen>
          <Folder name="src" defaultOpen>
            <File name="index.ts" />

            <Folder name="defs">
              <File name="db_schema.ts" />

              <File name="db_relations.ts" />

              <File name="storage_schema.ts" />

              <File name="runtime.ts" />

              <File name="index.ts" />
            </Folder>

            <Folder name="__generated__">
              <File name="sys_schema.ts" />

              <File name="sys_relations.ts" />

              <File name="edgespark.d.ts" />

              <File name="server-types.d.ts" />
            </Folder>
          </Folder>
        </Folder>

        <Folder name="web">
          <File name="package.json" />

          <File name="src/App.tsx" />

          <File name="src/lib/edgespark.ts" />
        </Folder>

        <Folder name="configs">
          <File name="auth-config.yaml" />
        </Folder>

        <File name="edgespark.toml" />

        <File name="AGENTS.md" />
      </Folder>
    </Tree>

    <Note>
      Files in `server/src/__generated__/` are auto-generated. Do not edit them manually.
    </Note>

    <Tip>
      `--agent` is required. Use `--agent claude` for Claude Code, `--agent gemini` for Gemini CLI, `--agent codex` for OpenAI Codex, and the real agent name for every other AGENTS.md-based tool, such as `copilot`, `cursor`, `opencode`, `amp`, `devin`, `aider`, `windsurf`, `cline`, `continue`, `antigravity`, `kiro`, or your own custom agent name. See [supported agents](/agents/supported-agents).
    </Tip>
  </Step>

  <Step title="Install dependencies">
    EdgeSpark does not use a root workspace for the scaffold. Install dependencies in `server/` and `web/` separately:

    ```bash theme={null}
    cd my-app/server && npm install
    cd ../web && npm install
    ```
  </Step>

  <Step title="Write your first route">
    Open `server/src/index.ts`. The scaffold exports a static Hono app and lets you import the runtime SDK where you need it:

    ```typescript server/src/index.ts theme={null}
    import { Hono } from "hono";
    import { auth } from "edgespark/http";

    const app = new Hono()
      .get("/api/public/hello", (c) => {
        return c.json({ message: "Hello from EdgeSpark" });
      })
      .get("/api/hello", (c) => {
        return c.json({
          message: `Hello ${auth.user.email}`,
        });
      });

    export default app;
    ```
  </Step>

  <Step title="Deploy your project">
    ```bash theme={null}
    edgespark deploy
    ```

    EdgeSpark builds your project and deploys it. You'll see your project URL in the output:

    ```text theme={null}
    ✓ Built
    ✓ Uploaded bundle
    ✓ Deployed

    https://my-app.edgespark.app
    ```

    New projects currently start with one default production environment. Deploys update that environment directly.

    Test your protected route. A `401` response means auth is being enforced correctly:

    ```bash theme={null}
    curl -i https://my-app.edgespark.app/api/hello
    # HTTP/2 401
    ```

    <Note>
      Staging environments are coming soon. Today, a newly created project starts with one default production environment and `edgespark deploy` updates that live environment directly.
    </Note>
  </Step>
</Steps>

## What's next

<Columns cols={2}>
  <Card title="Development workflow" icon="workflow" href="/guides/development-workflow">
    Learn the full repo-based loop for schema, storage, auth config, vars, secrets, and deploys.
  </Card>

  <Card title="How EdgeSpark works" icon="book" href="/concepts/how-edgespark-works">
    Understand the platform before building more complex features.
  </Card>

  <Card title="Add a database table" icon="database" href="/guides/database">
    Define schema in `server/src/defs/` and migrate your D1 database with Drizzle.
  </Card>

  <Card title="Add file uploads" icon="hard-drive" href="/guides/storage">
    Declare buckets in `server/src/defs/storage_schema.ts` and sync them with the CLI.
  </Card>

  <Card title="Use secrets" icon="key" href="/guides/secrets">
    Store API keys and access them from your routes.
  </Card>
</Columns>
