@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
mdx 164 lines 7.15 KB
Raw
1 ---
2 title: Websites
3 description: Deploy Vite, Astro, Next.js, vinext, Nuxt, React Router, SvelteKit, TanStack Start, Waku, Octane, or any static build to AWS with first-class Website resources.
4 sidebar:
5 label: Overview
6 order: 1
7 ---
8
9 Alchemy deploys frontends to AWS with a family of `AWS.Website`
10 resources. Each one builds your project programmatically and deploys
11 it as a serverless site — the SSR server on a
12 [Lambda Web Function](/aws/compute/web-functions), static assets in a
13 private S3 bucket, and a CloudFront
14 distribution whose edge router serves uploaded files from S3 and
15 forwards everything else to the server — with no AWS-specific
16 configuration: no CDK, no CloudFormation, no adapter setup. Your
17 framework's own config file (`astro.config.*`, `nuxt.config.ts`,
18 `vite.config.ts`, ...) loads natively; Alchemy layers its AWS
19 integration on top.
20
21 - [`Vite`](/aws/frontend/vite) — any client-only Vite project (React,
22 Vue, Solid, or a plain SPA): assets-only, no Lambda; your
23 `vite.config.*` loads natively.
24 - [`Foldkit`](/aws/frontend/foldkit) — Foldkit SPA, SSR, and prerendered apps.
25 - [`Astro`](/aws/frontend/astro) — Astro sites, server-rendered or
26 fully static; your `astro.config.*` loads natively.
27 - [`Nextjs`](/aws/frontend/nextjs) — Next.js apps on Next's own
28 standalone server, with ISR and image optimization through a shared S3
29 cache; your `next.config.*` is honored as-is.
30 - [`Vinext`](/aws/frontend/vinext) — vinext (Next.js API on Vite)
31 apps on a streaming Lambda; your `vite.config.ts` loads natively.
32 - [`Nuxt`](/aws/frontend/nuxt) — Nuxt apps built through nitro's
33 `node` preset; your `nuxt.config.ts` loads natively.
34 - [`ReactRouter`](/aws/frontend/react-router) — React Router v8 in
35 framework mode, built through your own `vite build`.
36 - [`SvelteKit`](/aws/frontend/sveltekit) — SvelteKit apps with a
37 wrangler-free in-memory AWS adapter; your `vite.config.ts` loads
38 natively.
39 - [`TanStackStart`](/aws/frontend/tanstack-start) — TanStack Start
40 (React or Solid), built through your own `vite build`.
41 - [`Waku`](/aws/frontend/waku) — Waku (React Server Components)
42 apps.
43 - [`Octane`](/aws/frontend/octane) — OctaneJS fullstack apps built
44 through your own `vite build` with the AWS marker adapter.
45 - [`StaticSite`](/aws/frontend/static-site) — any directory of files,
46 optionally produced by a build command, for static generators like
47 Zola and Hugo or pre-built SPAs.
48 - [`Router`](/aws/frontend/static-site#compose-sites-with-a-router) —
49 a shared CloudFront front door: one distribution serving several
50 sites (or a site plus an API), routed at the edge.
51
52 Every resource shares the same surface: `domain` (ACM certificate +
53 Route 53 records, or records on another
54 [DNS host](/infrastructure-as-code/dns-adapters)), server configuration (`timeout`, `env`,
55 `maxConcurrencyPerEnvironment`, `maxEnvironments`), `assets`, `edge`
56 customizations, and `invalidation`.
57 All builds are memoized by content-hashing the input files — an
58 unchanged project skips the build and deploy entirely. Under
59 `alchemy dev`, every resource runs the framework's own dev server
60 (native HMR) instead of deploying; `Alchemy.remote()` opts back into
61 the full live deployment.
62
63 ## Serve from several Regions
64
65 List extra Regions to run the server in each of them behind one global
66 domain. CloudFront forwards to it, and each request reaches the nearest
67 Region:
68
69 ```typescript
70 const site = yield* AWS.Website.Nuxt("Website", {
71 regions: ["us-east-1", "eu-west-1"],
72 });
73 ```
74
75 The site's URL doesn't change when you add or remove Regions. `Nextjs`
76 and `Vinext` keep their data caches in the home Region, so a server in
77 another Region reaches back to it for cached pages; `regions` helps most
78 for sites without a server-side cache.
79
80 ## Choose the server
81
82 The SSR server runs on a Lambda Web Function: your framework's own Node
83 server, serving many requests per environment and streaming each
84 response. Web Functions run in a subset of Regions. Elsewhere, set
85 `server: "function"` to run the server on a Lambda Function behind a
86 streaming Function URL:
87
88 ```typescript
89 const site = yield* AWS.Website.Nuxt("Website", {
90 server: "function",
91 memorySize: 2048,
92 });
93 ```
94
95 `memorySize`, `architecture`, and `runtime` apply only to
96 `server: "function"`; a Web Function has a fixed 2 GB, Arm64 and
97 Node.js 24.
98
99 ## What's supported
100
101 | Framework | Resource | Guide |
102 | --- | --- | --- |
103 | React / Vite SPA | `Vite` | [React SPA](/aws/frontend/vite-spa) |
104 | Vue | `Vite` | [Vue](/aws/frontend/vue) |
105 | Foldkit | `Foldkit` | [Foldkit](/aws/frontend/foldkit) |
106 | TanStack Start (React & Solid) | `TanStackStart` | [TanStack Start](/aws/frontend/tanstack-start) |
107 | React Router | `ReactRouter` | [React Router](/aws/frontend/react-router) |
108 | Astro | `Astro` | [Astro](/aws/frontend/astro) |
109 | Next.js | `Nextjs` | [Next.js](/aws/frontend/nextjs) |
110 | vinext | `Vinext` | [vinext](/aws/frontend/vinext) |
111 | Nuxt | `Nuxt` | [Nuxt](/aws/frontend/nuxt) |
112 | SvelteKit | `SvelteKit` | [SvelteKit](/aws/frontend/sveltekit) |
113 | Waku | `Waku` | [Waku](/aws/frontend/waku) |
114 | OctaneJS (fullstack) | `Octane` | [Octane](/aws/frontend/octane) |
115 | Zola, Hugo, or any static generator | `StaticSite` | [Static sites](/aws/frontend/static-site) |
116
117 Every row is backed by a checked-in example or a live deploy test in
118 the Alchemy repository. The last row is deliberately open-ended:
119 `StaticSite` deploys any directory of files (running your build
120 command first if you give it one), so any generator works the same
121 way.
122
123 ## How to choose
124
125 Use the resource named after your framework. `Astro`, `Nextjs`,
126 `Nuxt`, `ReactRouter`, `SvelteKit`, `TanStackStart`,
127 `Waku`, and `Octane` each drive their framework's own build and know
128 its output layout, config surface, and dev server.
129
130 Use `Vite` when the app is client-only and a single `vite build`
131 produces the whole thing — a React or Vue SPA, or any Vite project
132 with no server. It creates no Lambda.
133
134 Use `StaticSite` when the output is plain files from an arbitrary
135 build command that emits a directory (Zola, Hugo, or any other
136 generator without a dedicated resource).
137
138 Use `Router` when several sites (or a site plus an API) should share
139 one CloudFront distribution and one domain — distributions take
140 minutes to create, and each custom domain can only attach to one.
141
142 ## Where next
143
144 - [The Vite resource](/aws/frontend/vite) — build model, env
145 inlining, SPA fallback, dev mode.
146 - [The StaticSite resource](/aws/frontend/static-site) — build
147 commands, SPA/404 handling, Router composition, invalidation.
148 - Framework guides:
149 [React SPA](/aws/frontend/vite-spa),
150 [Vue](/aws/frontend/vue),
151 [Foldkit](/aws/frontend/foldkit),
152 [TanStack Start](/aws/frontend/tanstack-start),
153 [React Router](/aws/frontend/react-router),
154 [Astro](/aws/frontend/astro),
155 [Next.js](/aws/frontend/nextjs),
156 [Nuxt](/aws/frontend/nuxt),
157 [SvelteKit](/aws/frontend/sveltekit),
158 [Waku](/aws/frontend/waku),
159 [Octane](/aws/frontend/octane).
160 - [Full-stack RPC + Drizzle](/aws/frontend/full-stack-tanstack-rpc-drizzle) —
161 a TanStack Start UI driving an Effect RPC Lambda over Aurora DSQL.
162 - [`StaticSite` reference](/providers/aws/website/staticsite) and
163 [`Router` reference](/providers/aws/website/router) — every prop
164 and attribute.