evjs
- Repo stars 11
- License MIT
- Author repo evjs
- Domain
- Other
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 94 / 100 · heuristic scan, not runtime safety proof
- Runtime evidence
- Not run; no isolated runtime test evidence is currently recorded
- Author / version / license
- @afx-team · MIT
- Token usage
- Lean
- Setup complexity
- Manual integration
- External API key
- Not required
- Operating systems
- Docker
- Runtime requirements
- Node.js · Deno · Docker
- Detected file/system behavior
-
- Read-only
- Write / modify
- Network behavior
- External requests
- Install commands
- None (reference only)
Heads up: Tool permissions are not declared; actual access depends on the runtime.
# evjs Agent Skill
Use this skill when developing applications with the evjs framework.
## Overview
evjs is a React fullstack framework built on TanStack Router, TanStack Query, and Hono. It provides:
- **Server Functions** — write backend logic in files (we recommend using the `.server.ts` suffix), call from React as if local
- **Server Routes** — build programmatic REST endpoints and APIs using the `createRoute()` handler
- **Query Integration** — type-safe `useQuery(getUsers)` with auto query keys and transport
- **Type-safe Routing** — TanStack Router with code-defined route modules and route trees
- **Plugin System** — extend builds with `buildStart`, `bundlerConfig`, `transformHtml`, and `buildEnd` hooks
- **Convention over Configuration** — works out of the box, optionally configure via `ev.config.ts`
## Quick Start
```bash
npx @evjs/create-app my-app
cd my-app
npm install
npm run dev
```
## References
For detailed guides on specific topics, see the `references/` directory:
- [quick-start.md](../docs/docs/quick-start.md) — Scaffolding projects with `npx @evjs/create-app`
- [project-structure.md](../docs/docs/project-structure.md) — Recommended directory structure and domain-driven design (features)
- [dev.md](../docs/docs/dev.md) — Development server and configuration
- [build.md](../docs/docs/build.md) — Production builds
- [deploy.md](../docs/docs/deploy.md) — Deploying to Node, Docker, Deno, and Edge environments
- [client-routes.md](../docs/docs/client-routes.md) — Route definitions, layouts, params, loaders, navigation
- [server-functions.md](../docs/docs/server-functions.md) — Server functions, queries, mutations, error handling
- [server-routes.md](../docs/docs/server-routes.md) — Creating REST API endpoints using programmatic `createRoute()`
- [config.md](../docs/docs/config.md) — `ev.config.ts` options, defaults, client/server settings
## Key Rules
**Server Functions (RPC):**
- Server function files must start with `"use server";` so evjs can transform and register them
- Use `useQuery(getUsers)` to query server functions directly — type-safe args & data
- Arguments are spread: `useQuery(getUser, id)` not `useQuery(getUser, [id])`
- For mutations, wrap args in objects/arrays: `mutate({ name, email })` or `mutate([name, email])`
- `ServerError` on server → automatically mapped to `ServerFunctionError` on client
**REST Routes (`createRoute()`):**
- Use `createRoute()` for REST API endpoints, webhooks, or standard Web Request/Response handling
- If mixing `createRoute()` endpoints, you must explicitly configure `server.entry` in `ev.config.ts`
- **Route Paths:** Always use string literals for `path` values (e.g., `path: "/posts"`). The type system **rejects** broad `string` variables and template strings at compile time.
**React Data Loading:**
- Route loaders should fetch using: `context.queryClient.ensureQueryData(getFnQueryOptions(myFn))`
- Invalidate cache after mutations: `queryClient.invalidateQueries({ queryKey: getFnQueryKey(myFn) })`
- Access server function metadata: `myFn.fnId`, `myFn.fnName`, `getFnQueryKey(myFn, ...args)`
**Misc:**
- Use `plugins` in config to extend the build pipeline via `buildStart`, `bundlerConfig`, `transformHtml`, and `buildEnd`
Sections and files
Listed in source order.
sections -> Overview → Quick Start → References → Key Rules
terms -> Server Functions · Server Routes · Query Integration · Type-safe Routing · Plugin System · Convention over Configuration · Server Functions (RPC) · REST Routes (createRoute())
files/cmd -> .server.ts · createRoute() · useQuery(getUsers) · buildStart · bundlerConfig · transformHtml · buildEnd · ev.config.ts
body sha256 -> 8e82bc61ab68
Overview
evjs is a React fullstack framework built on TanStack Router, TanStack Query, and Hono. It provides: Server Functions — write backend logic in files (we recommend using the
.server.tssuffix), call from React as if local Server Routes — build programmatic REST endpoints and APIs using thecreateRoute()handler Query Integration — type-safeuseQuery(getUsers)with auto query keys and transportReferences
For detailed guides on specific topics, see the
references/directory: quick-start.md — Scaffolding projects withnpx @evjs/create-appproject-structure.md — Recommended directory structure and domain-driven design (features) dev.md — Development server and configuration build.md — Production buildsKey Rules
Server Functions (RPC): Server function files must start with
"use server";so evjs can transform and register them UseuseQuery(getUsers)to query server functions directly — type-safe args & data Arguments are spread:useQuery(getUser, id)notuseQuery(getUser, [id])For mutations, wrap args in objects/arrays:mutate({ name, email })ormutate([name, email])