diff --git a/create-app.ts b/create-app.ts
index 9afe50685ead87f13640ee9fba506e33d25f09bd..4b6fb53289a64348990e1f6c20afa1b37e475370 100644
--- a/create-app.ts
+++ b/create-app.ts
@@ -71,7 +71,7 @@ export async function createApp({
     // install backend
     const backendRoot = path.join(root, "backend");
     await makeDir(backendRoot);
-    await installTemplate({ ...args, root: backendRoot });
+    await installTemplate({ ...args, root: backendRoot, backend: true });
     // install frontend
     const frontendRoot = path.join(root, "frontend");
     await makeDir(frontendRoot);
@@ -80,6 +80,7 @@ export async function createApp({
       root: frontendRoot,
       framework: "nextjs",
       customApiPath: "http://localhost:8000/api/chat",
+      backend: false,
     });
     // copy readme for fullstack
     await fs.promises.copyFile(
@@ -87,7 +88,7 @@ export async function createApp({
       path.join(root, "README.md"),
     );
   } else {
-    await installTemplate(args);
+    await installTemplate({ ...args, backend: true });
   }
 
   process.chdir(root);
diff --git a/templates/index.ts b/templates/index.ts
index 9ff80cc02f8f7780a1f0e6677ce05980ae5bf30e..98eece524f8987199cdf69f7ecec0d47e16ca811 100644
--- a/templates/index.ts
+++ b/templates/index.ts
@@ -267,7 +267,9 @@ const installPythonTemplate = async ({
   );
 };
 
-export const installTemplate = async (props: InstallTemplateArgs) => {
+export const installTemplate = async (
+  props: InstallTemplateArgs & { backend: boolean },
+) => {
   process.chdir(props.root);
   if (props.framework === "fastapi") {
     await installPythonTemplate(props);
@@ -275,16 +277,20 @@ export const installTemplate = async (props: InstallTemplateArgs) => {
     await installTSTemplate(props);
   }
 
-  // Copy the environment file to the target directory.
-  await createEnvLocalFile(props.root, props.framework, props.openAIKey);
+  if (props.backend) {
+    // This is a backend, so we need to copy the test data and create the env file.
 
-  // Copy test pdf file
-  await copyTestData(
-    props.root,
-    props.framework,
-    props.packageManager,
-    props.engine,
-  );
+    // Copy the environment file to the target directory.
+    await createEnvLocalFile(props.root, props.framework, props.openAIKey);
+
+    // Copy test pdf file
+    await copyTestData(
+      props.root,
+      props.framework,
+      props.packageManager,
+      props.engine,
+    );
+  }
 };
 
 export * from "./types";