1import * as Alchemy from "alchemy";
2import * as Prisma from "alchemy/Prisma";
3import * as Effect from "effect/Effect";
4import Api from "./src/Api.ts";
5import { Project } from "./src/Database.ts";
6
7export default Alchemy.Stack(
8 "PrismaTutorial",
9 { providers: Prisma.providers(), state: Alchemy.localState() },
10 Effect.gen(function* () {
11 const project = yield* Project.pipe(Alchemy.remote());
12 const api = yield* Api.pipe(Alchemy.remote());
13 const site = yield* Prisma.Website.Vite("Website", {
14 project,
15 regionId: "eu-west-3",
16 env: { VITE_API_URL: api.url },
17 });
18 return { url: site.url, apiUrl: api.url };
19 }),
20);