An EdgeSpark project created withDocumentation 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 init has a root project plus separate server/ and web/ apps. Your repo owns the app schema and bucket declarations in server/src/defs/. EdgeSpark generates runtime types and platform-managed schema files in server/src/__generated__/.
Directory layout
Key files
server/src/index.ts
Your server entry point. Define a static Hono app and export it as the default export:
server/src/index.ts
export default app;. The variable name can differ, but the module’s default export must be the app instance.
You can split routes across multiple files and import them into server/src/index.ts. All app routes still need to live under /api/*, /api/public/*, or /api/webhooks/*.
server/src/defs/
Repo-authored definitions. This is where you declare your app schema, storage buckets, and typed runtime keys:
| File | Contains |
|---|---|
db_schema.ts | Your Drizzle table definitions |
db_relations.ts | Your Drizzle relations |
storage_schema.ts | Your bucket declarations |
runtime.ts | VarKey and SecretKey unions for vars and secrets |
index.ts | Required barrel that re-exports defs and generated files |
edgespark db generateandedgespark db migratefordb_schema.tsedgespark storage applyforstorage_schema.tsedgespark auth applyforconfigs/auth-config.yaml
server/src/__generated__/
Generated files from the platform. Do not edit these manually.
| File | Contains |
|---|---|
sys_schema.ts | Platform-managed database tables |
sys_relations.ts | Relations for platform-managed tables |
edgespark.d.ts | Generated module declarations for edgespark imports |
server-types.d.ts | Generated SDK types used by the scaffold and defs |
edgespark pull to refresh generated files. edgespark pull schema refreshes pulled system schema, and edgespark pull types refreshes generated SDK types.
edgespark.toml
Project configuration file created by edgespark init. It points EdgeSpark at your server and web directories:
edgespark.toml
configs/auth-config.yaml
Local auth configuration file. Use it with edgespark auth pull and edgespark auth apply when you need to manage sign-in methods and auth settings in code.
web/src/lib/edgespark.ts
The scaffolded browser client entry point. It creates the @edgespark/web singleton used for frontend auth, managed auth UI, and same-origin API calls.
Web import alias
The web scaffold also configures the@/ alias for web/src/*, so imports such as @/lib/edgespark and @/hooks/useAuth work out of the box.
Root package.json
The root package is intentionally minimal. It is not a workspace. Install dependencies separately in server/ and web/.
Install dependencies
Organizing routes
As your project grows, split routes into separate files:server/src/index.ts
server/src/routes/posts.ts
See also
The client object
What the runtime SDK provides and how imports from
edgespark work.Declarative workflow
How repo-authored defs and generated files stay in sync.
Quickstart
Create your first project and deploy it in minutes.
CLI commands
edgespark init options and the rest of the public CLI surface.