# Data flow — withastro/astro

> Canonical page: https://codevetter.com/unpack/astro/data-flow

# Data flow — withastro/astro

Scanned commit 4c1470a7f907fe678ef5e7dceaa972ca83d297da (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Configuration enters through CLI flags and executable project config, then becomes validated settings and generated manifests. Build environments discover routes and client assets before emitting deployment output. Requests use a manifest plus isolated FetchState to move through middleware, action or page dispatch, and provider finalization. Content loaders transform source records into scoped mutable stores; serialized snapshots become generated runtime modules and read-only query sources.
- resolveConfig() resolves the root, loads project config, merges inline configuration with higher priority, and validates the merged result before returning userConfig and astroConfig. — [packages/astro/src/core/config/config.ts#L134-165](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/config/config.ts#L134-L165)
- Config discovery checks astro.config.mjs, .js, .ts, and .mts; loadConfig() delegates executable configuration loading to loadConfigWithVite(). — [packages/astro/src/core/config/config.ts#L29-43](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/config/config.ts#L29-L43) [packages/astro/src/core/config/config.ts#L74-99](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/config/config.ts#L74-L99)
- Integration setup mutates renderer, script, injected-route, watch-file, toolbar, client-directive, and middleware settings through named hook callbacks. — [packages/astro/src/integrations/hooks.ts#L227-299](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/integrations/hooks.ts#L227-L299)
- DefaultFetchHandler.fetch() combines a Request, render options, and explicit or ambient manifest into FetchState, then delegates to handleRequest(). — [packages/astro/src/core/fetch/default-handler.ts#L26-36](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/fetch/default-handler.ts#L26-L36)
- FetchState initializes locals, URL, cookies, client address, and timing; forwarded headers are applied only with configured allowedDomains and for non-prerendered routes. — [packages/astro/src/core/fetch/fetch-state.ts#L366-388](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/fetch/fetch-state.ts#L366-L388)
- The request handler registers session/cache providers, runs middleware around actions and pages, applies i18n processing, finalizes providers, and prepares the outgoing response. — [packages/astro/src/core/routing/handler.ts#L107-157](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/routing/handler.ts#L107-L157) [packages/astro/src/core/routing/handler.ts#L175-195](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/routing/handler.ts#L175-L195) [packages/astro/src/core/routing/handler.ts#L215-217](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/core/routing/handler.ts#L215-L217)
- Action request input is parsed according to Content-Type and manifest.actionBodySizeLimit, then bound to an ActionAPIContext before invoking the resolved handler. — [packages/astro/src/actions/runtime/server.ts#L200-229](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/actions/runtime/server.ts#L200-L229) [packages/astro/src/actions/runtime/server.ts#L259-303](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/actions/runtime/server.ts#L259-L303)
- ContentLayer supplies each loader a scoped store, metadata store, schema parser, Markdown renderer, digest generator, watcher, and entry-type map. — [packages/astro/src/content/content-layer.ts#L120-146](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/content/content-layer.ts#L120-L146) [packages/astro/src/content/content-layer.ts#L317-346](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/content/content-layer.ts#L317-L346)
- MutableDataStore.set() updates collection maps and schedules saving; writeToDisk() serializes in-process writes, invokes the writer, and notifies listeners only when persisted data changed. — [packages/astro/src/content/mutable-data-store.ts#L79-84](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/content/mutable-data-store.ts#L79-L84) [packages/astro/src/content/mutable-data-store.ts#L525-556](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/content/mutable-data-store.ts#L525-L556)
- Runtime content loading imports astro:data-layer-content, handles Map, flattened-array, or chunk-manifest representations, wraps the immutable store in InMemorySource, and exposes queries through globalDataStore. — [packages/astro/src/content/data-store.ts#L153-197](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/content/data-store.ts#L153-L197) [packages/astro/src/content/data-store-source.ts#L30-50](https://github.com/withastro/astro/blob/4c1470a7f907fe678ef5e7dceaa972ca83d297da/packages/astro/src/content/data-store-source.ts#L30-L50)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
