mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Enhance authentication setup and improve documentation
Adds automatic auth secret generation, improves environment file handling, creates client env files, adds trusted origins configuration, enhances README generation with better structure and instructions, and updates post-installation guidance with clearer steps.
This commit is contained in:
@@ -10,35 +10,57 @@ export function displayPostInstallInstructions(
|
||||
orm?: string,
|
||||
) {
|
||||
const runCmd = packageManager === "npm" ? "npm run" : packageManager;
|
||||
const cdCmd = `cd ${projectName}`;
|
||||
|
||||
const steps = [];
|
||||
|
||||
if (!depsInstalled) {
|
||||
steps.push(`${pc.cyan(packageManager)} install`);
|
||||
}
|
||||
|
||||
if (hasAuth && database !== "none") {
|
||||
steps.push(`${pc.yellow("Authentication Setup:")}`);
|
||||
steps.push(
|
||||
`${pc.cyan("1.")} Generate auth schema: ${pc.green(`${runCmd} auth:generate`)}`,
|
||||
);
|
||||
|
||||
if (orm === "prisma") {
|
||||
steps.push(
|
||||
`${pc.cyan("2.")} Generate Prisma client: ${pc.green(`${runCmd} prisma:generate`)}`,
|
||||
);
|
||||
steps.push(
|
||||
`${pc.cyan("3.")} Push schema to database: ${pc.green(`${runCmd} prisma:push`)}`,
|
||||
);
|
||||
} else if (orm === "drizzle") {
|
||||
steps.push(
|
||||
`${pc.cyan("2.")} Apply migrations: ${pc.green(`${runCmd} drizzle:migrate`)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (database === "postgres") {
|
||||
steps.push(`${pc.yellow("PostgreSQL Configuration:")}`);
|
||||
steps.push(
|
||||
`Make sure to update ${pc.cyan("packages/server/.env")} with your PostgreSQL connection string.`,
|
||||
);
|
||||
} else if (database === "sqlite") {
|
||||
steps.push(`${pc.yellow("Database Configuration:")}`);
|
||||
steps.push(
|
||||
`${pc.cyan("packages/server/.env")} contains your SQLite connection details. Update if needed.`,
|
||||
);
|
||||
steps.push(
|
||||
`Start the local SQLite database with: ${pc.green(`${runCmd} db:local`)}`,
|
||||
);
|
||||
}
|
||||
|
||||
steps.push(`${pc.yellow("Start Development:")}`);
|
||||
steps.push(`${pc.green(`${runCmd} dev`)}`);
|
||||
|
||||
log.info(`${pc.cyan("Installation completed!")} Here are some next steps:
|
||||
|
||||
${
|
||||
hasAuth && database !== "none"
|
||||
? `${pc.yellow("Authentication Setup:")}
|
||||
${pc.cyan("1.")} Generate auth schema: ${pc.green(`cd ${projectName} && ${packageManager} run auth:generate`)}
|
||||
${
|
||||
orm === "prisma"
|
||||
? `${pc.cyan("2.")} Generate Prisma client: ${pc.green(`${packageManager} run prisma:generate`)}
|
||||
${pc.cyan("3.")} Push schema to database: ${pc.green(`${packageManager} run prisma:push`)}`
|
||||
: `${pc.cyan("2.")} Apply migrations: ${pc.green(`${packageManager} run drizzle:migrate`)}`
|
||||
}
|
||||
${cdCmd}
|
||||
${steps.join("\n")}
|
||||
|
||||
`
|
||||
: ""
|
||||
}${
|
||||
database === "postgres"
|
||||
? `${pc.yellow("PostgreSQL Configuration:")}
|
||||
Make sure to update ${pc.cyan("packages/server/.env")} with your PostgreSQL connection string.
|
||||
|
||||
`
|
||||
: database === "sqlite"
|
||||
? `${pc.yellow("Database Configuration:")}
|
||||
${pc.cyan("packages/server/.env")} contains your SQLite connection details. Update if needed.`
|
||||
: ""
|
||||
}
|
||||
|
||||
${pc.yellow("Start Development:")}
|
||||
${pc.cyan("cd")} ${projectName}${!depsInstalled ? `\n${pc.cyan(packageManager)} install` : ""}
|
||||
${pc.cyan(runCmd)} dev`);
|
||||
The client application will be available at ${pc.cyan("http://localhost:3001")}
|
||||
The API server will be running at ${pc.cyan("http://localhost:3000")}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user