import * as Axiom from "@alchemy.run/axiom";
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Neon from "@alchemy.run/neon";
import * as Alchemy from "alchemy";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import Api from "./src/Api.ts";
import { Dashboard } from "./src/Dashboard.ts";
export default Alchemy.Stack(
"Shorty",
{
providers: Layer.mergeAll(Cloudflare.providers(), Neon.providers(), Axiom.providers()),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const api = yield* Api;
const web = yield* Cloudflare.Website.Vite("Web", {
dev: { port: 5173 },
env: { VITE_API_URL: api.url.as<string>() },
});
const dashboard = yield* Dashboard;
return { api: api.url.as<string>(), web: web.url, dashboard: dashboard.uid };
}),
);