Feature: Fastify Implementation (#274)

Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
This commit is contained in:
Niloy
2025-05-22 17:32:32 +02:00
committed by GitHub
parent 17a7386071
commit b9dae19ce5
14 changed files with 243 additions and 2 deletions

View File

@@ -74,6 +74,9 @@ export const dependencyVersionMap = {
"@types/express": "^5.0.1",
"@types/cors": "^2.8.17",
fastify: "^5.3.3",
"@fastify/cors": "^11.0.1",
turbo: "^2.4.2",
ai: "^4.3.16",

View File

@@ -42,6 +42,12 @@ export async function setupBackendDependencies(
dependencies.push("express", "cors");
devDependencies.push("@types/express", "@types/cors");
if (runtime === "node") {
devDependencies.push("tsx", "@types/node");
}
} else if (framework === "fastify") {
dependencies.push("fastify", "@fastify/cors");
if (runtime === "node") {
devDependencies.push("tsx", "@types/node");
}

View File

@@ -268,6 +268,8 @@ function generateFeaturesList(
addonsList.push("- **Hono** - Lightweight, performant server framework");
} else if (backend === "express") {
addonsList.push("- **Express** - Fast, unopinionated web framework");
} else if (backend === "fastify") {
addonsList.push("- **Fastify** - Fast, low-overhead web framework");
} else if (backend === "elysia") {
addonsList.push("- **Elysia** - Type-safe, high-performance framework");
} else if (backend === "next") {

View File

@@ -140,7 +140,15 @@ async function main() {
.option("backend", {
type: "string",
describe: "Backend framework",
choices: ["hono", "express", "next", "elysia", "convex", "none"],
choices: [
"hono",
"express",
"fastify",
"next",
"elysia",
"convex",
"none",
],
})
.option("runtime", {
type: "string",

View File

@@ -33,6 +33,11 @@ export async function getBackendFrameworkChoice(
label: "Express",
hint: "Fast, unopinionated, minimalist web framework for Node.js",
},
{
value: "fastify" as const,
label: "Fastify",
hint: "Fast, low-overhead web framework for Node.js",
},
{
value: "elysia" as const,
label: "Elysia",

View File

@@ -17,6 +17,7 @@ export type ProjectAddons =
export type ProjectBackend =
| "hono"
| "express"
| "fastify"
| "next"
| "elysia"
| "convex"