function generateBackendEnv(context) {
  const { spec, manifest } = context;
  const projectName = (spec.metadata?.component || "app").toLowerCase().replace(/\s+/g, "-");
  const environments = manifest?.configuration?.environments || {};
  const devEnv = environments.development?.database ? environments.development : Object.values(environments).find((e) => e?.database) || {};
  const dbConfig = devEnv.database || {};
  const provider = dbConfig.provider || "sqlite";
  const databaseUrl = dbConfig.url || (provider === "sqlite" ? "file:./dev.db" : `postgresql://${process.env.USER || "postgres"}:@localhost:5432/spv_${projectName}_dev`);
  const port = devEnv.server?.port || 3e3;
  return `# Backend Environment Configuration
# Database
DATABASE_URL="${databaseUrl}"

# API Configuration
PORT=${port}
HOST=0.0.0.0
NODE_ENV=development

# CORS
CORS_ORIGINS="http://localhost:5173"

# Prisma \u2014 suppress the "new major version available" banner that
# otherwise prints after every prisma command. Remove this line if
# you want the upgrade nag back.
PRISMA_HIDE_UPDATE_MESSAGE=true
`;
}
export {
  generateBackendEnv as default
};
