| 1 | --- |
| 2 | title: Overview |
| 3 | description: Requirements pick lines. One table from what you need to the line that changes, the stack shape for one cloud or two, and complete files to copy. |
| 4 | --- |
| 5 | |
| 6 | The examples use `Authentication` from |
| 7 | [Getting Started](/git/getting-started): the application's request middleware. |
| 8 | |
| 9 | Start from the graph the tutorial built and change the lines your |
| 10 | requirements touch: |
| 11 | |
| 12 | ```typescript |
| 13 | const GitLive = Git.ApiLive.pipe( |
| 14 | Layer.provide(Git.ApiHandlersLive), |
| 15 | Layer.provide(Authentication.layer), |
| 16 | Layer.provide(Git.ReposDurableObject), |
| 17 | Layer.provide(Git.RegistryDurableObject), |
| 18 | Layer.provide(Git.HasherInline), |
| 19 | Layer.provide(Git.BlobStoreR2(GitObjects)), |
| 20 | ); |
| 21 | ``` |
| 22 | |
| 23 | | You need | Change | Where | |
| 24 | | --- | --- | --- | |
| 25 | | Everything on one Cloudflare account | nothing | [All on Cloudflare](/git/recipes/cloudflare) | |
| 26 | | Large pushes verified fast, still on one cloud | `HasherWorkerLoader()` | [Scaling](/git/recipes/scaling) | |
| 27 | | Bytes stored in AWS | `BlobStoreS3(bucket)` | [Bytes in S3, hashing on Lambda](/git/recipes/cloudflare-aws) | |
| 28 | | The widest push parallelism | `HasherLambda(HasherFunction)` | [Bytes in S3, hashing on Lambda](/git/recipes/cloudflare-aws) | |
| 29 | | Bytes somewhere that is neither R2 nor S3 | your own `BlobStore` | [Bring your own store](/git/recipes/your-own-store) | |
| 30 | | Registry reads near users everywhere, SQL over the index | `RegistryD1(RepoIndex)` | [Registry](/git/blocks/registry) | |
| 31 | | Your own users and credentials | your `HttpRouter` middleware | [Tutorial Part 4](/git/tutorial/part-4) | |
| 32 | | Branch rules | application handlers + `Git.Engine` | [Tutorial Part 6](/git/tutorial/part-6) | |
| 33 | | Your web app and git on one domain | a front-door Worker | [Application example](https://github.com/alchemy-run/alchemy/tree/main/examples/cloudflare-git-service) | |
| 34 | |
| 35 | Every row is independent. Bytes in S3 with the loader hasher and a D1 |
| 36 | registry is three changed lines, and the type checker confirms the |
| 37 | graph is whole. [Scaling](/git/recipes/scaling) is the why behind the |
| 38 | first four rows. |
| 39 | |
| 40 | ## One cloud or two |
| 41 | |
| 42 | A graph that only touches Cloudflare deploys with Cloudflare's |
| 43 | providers: |
| 44 | |
| 45 | ```typescript |
| 46 | export default Alchemy.Stack( |
| 47 | "GitService", |
| 48 | { providers: Cloudflare.providers(), state: Cloudflare.state() }, |
| 49 | Effect.gen(function* () { |
| 50 | const git = yield* GitHost; |
| 51 | return { url: git.url.as<string>() }; |
| 52 | }), |
| 53 | ); |
| 54 | ``` |
| 55 | |
| 56 | A graph that declares a Lambda or reads S3 carries both provider sets. |
| 57 | The stack is otherwise identical, and Alchemy creates what each cloud |
| 58 | needs: |
| 59 | |
| 60 | ```diff lang="typescript" |
| 61 | export default Alchemy.Stack( |
| 62 | "GitService", |
| 63 | - { providers: Cloudflare.providers(), state: Cloudflare.state() }, |
| 64 | + { |
| 65 | + providers: Layer.mergeAll(Cloudflare.providers(), AWS.providers()), |
| 66 | + state: Cloudflare.state(), |
| 67 | + }, |
| 68 | Effect.gen(function* () { |
| 69 | const git = yield* GitHost; |
| 70 | return { url: git.url.as<string>() }; |
| 71 | }), |
| 72 | ); |
| 73 | ``` |