| 1 | # AWS Website: Foldkit |
| 2 | |
| 3 | Deploys a [Foldkit](https://foldkit.dev) app to AWS with |
| 4 | `AWS.Website.Foldkit` — the client build in S3 behind a CloudFront |
| 5 | distribution, no CloudFormation templates. Foldkit apps are client-only |
| 6 | Vite projects, so the deployment is assets-only and never creates a |
| 7 | server function. |
| 8 | |
| 9 | - `src/main.ts` holds the Elm-architecture model/update/view; the page |
| 10 | renders a `card` view function (`src/components/Card.ts`) written in |
| 11 | plain TypeScript with `foldkit/html`. |
| 12 | - Tailwind CSS v4 is wired through `@tailwindcss/vite` in the project's |
| 13 | own `vite.config.ts`, alongside `@foldkit/vite-plugin`. |
| 14 | - Unmatched paths serve `index.html` (`spa` defaults on), so deep links |
| 15 | boot the app and Foldkit routes on the client. |
| 16 | |
| 17 | The integration package must be installed in the project (it is loaded |
| 18 | dynamically at deploy time): |
| 19 | |
| 20 | ```sh |
| 21 | bun add -d @alchemy.run/frontend-frameworks |
| 22 | ``` |
| 23 | |
| 24 | ## Deploy |
| 25 | |
| 26 | ```sh |
| 27 | bun install |
| 28 | bun run deploy |
| 29 | ``` |
| 30 | |
| 31 | Unchanged sources skip the Vite build entirely on subsequent deploys — |
| 32 | the input files are content-hashed (scoped by `memo.include`). |
| 33 | |
| 34 | ## Local development |
| 35 | |
| 36 | ```sh |
| 37 | bun run dev |
| 38 | ``` |
| 39 | |
| 40 | `alchemy dev` runs Vite's own dev server — Foldkit's HMR and devtools |
| 41 | wiring work unchanged — and no AWS resources are created. |
| 42 | |
| 43 | ## Destroy |
| 44 | |
| 45 | ```sh |
| 46 | bun run destroy |
| 47 | ``` |