From 9ff8f622e65b3e72f9014560d3a8473ff14c4f40 Mon Sep 17 00:00:00 2001
From: Marcus Schiesser <mail@marcusschiesser.de>
Date: Thu, 2 Nov 2023 17:43:17 +0700
Subject: [PATCH] separate template types and components in file system

---
 .../engines/context/constants.mjs             |   0
 .../engines/context/generate.mjs              |   0
 .../{ => components}/engines/context/index.ts |   0
 .../{ => components}/engines/simple/index.ts  |   0
 .../ui/html/chat/chat-avatar.tsx              |   0
 .../ui/html/chat/chat-input.tsx               |   0
 .../ui/html/chat/chat-item.tsx                |   0
 .../ui/html/chat/chat-messages.tsx            |   0
 .../{ => components}/ui/html/chat/index.ts    |   0
 .../{ => components}/ui/shadcn/button.tsx     |   0
 .../ui/shadcn/chat/chat-avatar.tsx            |   0
 .../ui/shadcn/chat/chat-input.tsx             |   0
 .../ui/shadcn/chat/chat-message.tsx           |   0
 .../ui/shadcn/chat/chat-messages.tsx          |   0
 .../{ => components}/ui/shadcn/chat/index.ts  |   0
 .../{ => components}/ui/shadcn/input.tsx      |   0
 .../{ => components}/ui/shadcn/lib/utils.ts   |   0
 templates/index.ts                            |   9 ++++----
 .../simple/express/README-template.md         |   0
 .../{ => types}/simple/express/eslintrc.json  |   0
 templates/{ => types}/simple/express/index.ts |   0
 .../{ => types}/simple/express/package.json   |   0
 .../src/controllers/chat.controller.ts        |   0
 .../simple/express/src/routes/chat.route.ts   |   0
 .../{ => types}/simple/express/tsconfig.json  |   0
 .../simple/fastapi/README-template.md         |   0
 .../simple/fastapi/app/__init__.py            |   0
 .../simple/fastapi/app/api/__init__.py        |   0
 .../fastapi/app/api/routers/__init__.py       |   0
 .../simple/fastapi/app/api/routers/chat.py    |   0
 .../simple/fastapi/app/utils/__init__.py      |   0
 .../simple/fastapi/app/utils/index.py         |   0
 .../simple/fastapi/data/brk-2022.pdf          | Bin
 .../{ => types}/simple/fastapi/gitignore      |   0
 templates/{ => types}/simple/fastapi/main.py  |   0
 .../{ => types}/simple/fastapi/pyproject.toml |   0
 .../simple/fastapi/tests/__init__.py          |   0
 .../{ => types}/simple/nextjs/.env.example    |   0
 .../simple/nextjs/README-template.md          |   0
 .../simple/nextjs/app/api/chat/route.ts       |   2 +-
 .../nextjs/app/components/chat-section.tsx    |  21 ++++++++++--------
 .../simple/nextjs/app/components/header.tsx   |   0
 .../{ => types}/simple/nextjs/app/favicon.ico | Bin
 .../{ => types}/simple/nextjs/app/globals.css |   0
 .../{ => types}/simple/nextjs/app/layout.tsx  |   0
 .../{ => types}/simple/nextjs/app/page.tsx    |   0
 .../{ => types}/simple/nextjs/eslintrc.json   |   0
 templates/{ => types}/simple/nextjs/gitignore |   0
 .../{ => types}/simple/nextjs/next-env.d.ts   |   0
 .../{ => types}/simple/nextjs/next.config.js  |   0
 .../{ => types}/simple/nextjs/package.json    |   0
 .../simple/nextjs/postcss.config.js           |   0
 .../simple/nextjs/public/llama.png            | Bin
 .../simple/nextjs/tailwind.config.ts          |   0
 .../{ => types}/simple/nextjs/tsconfig.json   |   0
 .../streaming/express/README-template.md      |   0
 .../streaming/express/eslintrc.json           |   0
 .../{ => types}/streaming/express/index.ts    |   0
 .../streaming/express/package.json            |   0
 .../src/controllers/chat.controller.ts        |   0
 .../src/controllers/llamaindex-stream.ts      |   0
 .../express/src/routes/chat.route.ts          |   0
 .../streaming/express/tsconfig.json           |   0
 .../streaming/fastapi/README-template.md      |   0
 .../streaming/fastapi/app/__init__.py         |   0
 .../streaming/fastapi/app/api/__init__.py     |   0
 .../fastapi/app/api/routers/__init__.py       |   0
 .../streaming/fastapi/app/api/routers/chat.py |   0
 .../streaming/fastapi/app/utils/__init__.py   |   0
 .../streaming/fastapi/app/utils/index.py      |   0
 .../streaming/fastapi/app/utils/json.py       |   0
 .../streaming/fastapi/data/brk-2022.pdf       | Bin
 .../{ => types}/streaming/fastapi/gitignore   |   0
 .../{ => types}/streaming/fastapi/main.py     |   0
 .../streaming/fastapi/pyproject.toml          |   0
 .../streaming/fastapi/tests/__init__.py       |   0
 .../{ => types}/streaming/nextjs/.env.example |   0
 .../streaming/nextjs/README-template.md       |   0
 .../nextjs/app/api/chat/llamaindex-stream.ts  |   0
 .../streaming/nextjs/app/api/chat/route.ts    |   2 +-
 .../nextjs/app/components/chat-section.tsx    |   2 +-
 .../nextjs/app/components/header.tsx          |   0
 .../streaming/nextjs/app/favicon.ico          | Bin
 .../streaming/nextjs/app/globals.css          |   0
 .../streaming/nextjs/app/layout.tsx           |   0
 .../{ => types}/streaming/nextjs/app/page.tsx |   0
 .../streaming/nextjs/eslintrc.json            |   0
 .../{ => types}/streaming/nextjs/gitignore    |   0
 .../streaming/nextjs/next-env.d.ts            |   0
 .../streaming/nextjs/next.config.js           |   0
 .../{ => types}/streaming/nextjs/package.json |   0
 .../streaming/nextjs/postcss.config.js        |   0
 .../streaming/nextjs/public/llama.png         | Bin
 .../streaming/nextjs/tailwind.config.ts       |   0
 .../streaming/nextjs/tsconfig.json            |   0
 95 files changed, 20 insertions(+), 16 deletions(-)
 rename templates/{ => components}/engines/context/constants.mjs (100%)
 rename templates/{ => components}/engines/context/generate.mjs (100%)
 rename templates/{ => components}/engines/context/index.ts (100%)
 rename templates/{ => components}/engines/simple/index.ts (100%)
 rename templates/{ => components}/ui/html/chat/chat-avatar.tsx (100%)
 rename templates/{ => components}/ui/html/chat/chat-input.tsx (100%)
 rename templates/{ => components}/ui/html/chat/chat-item.tsx (100%)
 rename templates/{ => components}/ui/html/chat/chat-messages.tsx (100%)
 rename templates/{ => components}/ui/html/chat/index.ts (100%)
 rename templates/{ => components}/ui/shadcn/button.tsx (100%)
 rename templates/{ => components}/ui/shadcn/chat/chat-avatar.tsx (100%)
 rename templates/{ => components}/ui/shadcn/chat/chat-input.tsx (100%)
 rename templates/{ => components}/ui/shadcn/chat/chat-message.tsx (100%)
 rename templates/{ => components}/ui/shadcn/chat/chat-messages.tsx (100%)
 rename templates/{ => components}/ui/shadcn/chat/index.ts (100%)
 rename templates/{ => components}/ui/shadcn/input.tsx (100%)
 rename templates/{ => components}/ui/shadcn/lib/utils.ts (100%)
 rename templates/{ => types}/simple/express/README-template.md (100%)
 rename templates/{ => types}/simple/express/eslintrc.json (100%)
 rename templates/{ => types}/simple/express/index.ts (100%)
 rename templates/{ => types}/simple/express/package.json (100%)
 rename templates/{ => types}/simple/express/src/controllers/chat.controller.ts (100%)
 rename templates/{ => types}/simple/express/src/routes/chat.route.ts (100%)
 rename templates/{ => types}/simple/express/tsconfig.json (100%)
 rename templates/{ => types}/simple/fastapi/README-template.md (100%)
 rename templates/{ => types}/simple/fastapi/app/__init__.py (100%)
 rename templates/{ => types}/simple/fastapi/app/api/__init__.py (100%)
 rename templates/{ => types}/simple/fastapi/app/api/routers/__init__.py (100%)
 rename templates/{ => types}/simple/fastapi/app/api/routers/chat.py (100%)
 rename templates/{ => types}/simple/fastapi/app/utils/__init__.py (100%)
 rename templates/{ => types}/simple/fastapi/app/utils/index.py (100%)
 rename templates/{ => types}/simple/fastapi/data/brk-2022.pdf (100%)
 rename templates/{ => types}/simple/fastapi/gitignore (100%)
 rename templates/{ => types}/simple/fastapi/main.py (100%)
 rename templates/{ => types}/simple/fastapi/pyproject.toml (100%)
 rename templates/{ => types}/simple/fastapi/tests/__init__.py (100%)
 rename templates/{ => types}/simple/nextjs/.env.example (100%)
 rename templates/{ => types}/simple/nextjs/README-template.md (100%)
 rename templates/{ => types}/simple/nextjs/app/api/chat/route.ts (94%)
 rename templates/{ => types}/simple/nextjs/app/components/chat-section.tsx (79%)
 rename templates/{ => types}/simple/nextjs/app/components/header.tsx (100%)
 rename templates/{ => types}/simple/nextjs/app/favicon.ico (100%)
 rename templates/{ => types}/simple/nextjs/app/globals.css (100%)
 rename templates/{ => types}/simple/nextjs/app/layout.tsx (100%)
 rename templates/{ => types}/simple/nextjs/app/page.tsx (100%)
 rename templates/{ => types}/simple/nextjs/eslintrc.json (100%)
 rename templates/{ => types}/simple/nextjs/gitignore (100%)
 rename templates/{ => types}/simple/nextjs/next-env.d.ts (100%)
 rename templates/{ => types}/simple/nextjs/next.config.js (100%)
 rename templates/{ => types}/simple/nextjs/package.json (100%)
 rename templates/{ => types}/simple/nextjs/postcss.config.js (100%)
 rename templates/{ => types}/simple/nextjs/public/llama.png (100%)
 rename templates/{ => types}/simple/nextjs/tailwind.config.ts (100%)
 rename templates/{ => types}/simple/nextjs/tsconfig.json (100%)
 rename templates/{ => types}/streaming/express/README-template.md (100%)
 rename templates/{ => types}/streaming/express/eslintrc.json (100%)
 rename templates/{ => types}/streaming/express/index.ts (100%)
 rename templates/{ => types}/streaming/express/package.json (100%)
 rename templates/{ => types}/streaming/express/src/controllers/chat.controller.ts (100%)
 rename templates/{ => types}/streaming/express/src/controllers/llamaindex-stream.ts (100%)
 rename templates/{ => types}/streaming/express/src/routes/chat.route.ts (100%)
 rename templates/{ => types}/streaming/express/tsconfig.json (100%)
 rename templates/{ => types}/streaming/fastapi/README-template.md (100%)
 rename templates/{ => types}/streaming/fastapi/app/__init__.py (100%)
 rename templates/{ => types}/streaming/fastapi/app/api/__init__.py (100%)
 rename templates/{ => types}/streaming/fastapi/app/api/routers/__init__.py (100%)
 rename templates/{ => types}/streaming/fastapi/app/api/routers/chat.py (100%)
 rename templates/{ => types}/streaming/fastapi/app/utils/__init__.py (100%)
 rename templates/{ => types}/streaming/fastapi/app/utils/index.py (100%)
 rename templates/{ => types}/streaming/fastapi/app/utils/json.py (100%)
 rename templates/{ => types}/streaming/fastapi/data/brk-2022.pdf (100%)
 rename templates/{ => types}/streaming/fastapi/gitignore (100%)
 rename templates/{ => types}/streaming/fastapi/main.py (100%)
 rename templates/{ => types}/streaming/fastapi/pyproject.toml (100%)
 rename templates/{ => types}/streaming/fastapi/tests/__init__.py (100%)
 rename templates/{ => types}/streaming/nextjs/.env.example (100%)
 rename templates/{ => types}/streaming/nextjs/README-template.md (100%)
 rename templates/{ => types}/streaming/nextjs/app/api/chat/llamaindex-stream.ts (100%)
 rename templates/{ => types}/streaming/nextjs/app/api/chat/route.ts (95%)
 rename templates/{ => types}/streaming/nextjs/app/components/chat-section.tsx (85%)
 rename templates/{ => types}/streaming/nextjs/app/components/header.tsx (100%)
 rename templates/{ => types}/streaming/nextjs/app/favicon.ico (100%)
 rename templates/{ => types}/streaming/nextjs/app/globals.css (100%)
 rename templates/{ => types}/streaming/nextjs/app/layout.tsx (100%)
 rename templates/{ => types}/streaming/nextjs/app/page.tsx (100%)
 rename templates/{ => types}/streaming/nextjs/eslintrc.json (100%)
 rename templates/{ => types}/streaming/nextjs/gitignore (100%)
 rename templates/{ => types}/streaming/nextjs/next-env.d.ts (100%)
 rename templates/{ => types}/streaming/nextjs/next.config.js (100%)
 rename templates/{ => types}/streaming/nextjs/package.json (100%)
 rename templates/{ => types}/streaming/nextjs/postcss.config.js (100%)
 rename templates/{ => types}/streaming/nextjs/public/llama.png (100%)
 rename templates/{ => types}/streaming/nextjs/tailwind.config.ts (100%)
 rename templates/{ => types}/streaming/nextjs/tsconfig.json (100%)

diff --git a/templates/engines/context/constants.mjs b/templates/components/engines/context/constants.mjs
similarity index 100%
rename from templates/engines/context/constants.mjs
rename to templates/components/engines/context/constants.mjs
diff --git a/templates/engines/context/generate.mjs b/templates/components/engines/context/generate.mjs
similarity index 100%
rename from templates/engines/context/generate.mjs
rename to templates/components/engines/context/generate.mjs
diff --git a/templates/engines/context/index.ts b/templates/components/engines/context/index.ts
similarity index 100%
rename from templates/engines/context/index.ts
rename to templates/components/engines/context/index.ts
diff --git a/templates/engines/simple/index.ts b/templates/components/engines/simple/index.ts
similarity index 100%
rename from templates/engines/simple/index.ts
rename to templates/components/engines/simple/index.ts
diff --git a/templates/ui/html/chat/chat-avatar.tsx b/templates/components/ui/html/chat/chat-avatar.tsx
similarity index 100%
rename from templates/ui/html/chat/chat-avatar.tsx
rename to templates/components/ui/html/chat/chat-avatar.tsx
diff --git a/templates/ui/html/chat/chat-input.tsx b/templates/components/ui/html/chat/chat-input.tsx
similarity index 100%
rename from templates/ui/html/chat/chat-input.tsx
rename to templates/components/ui/html/chat/chat-input.tsx
diff --git a/templates/ui/html/chat/chat-item.tsx b/templates/components/ui/html/chat/chat-item.tsx
similarity index 100%
rename from templates/ui/html/chat/chat-item.tsx
rename to templates/components/ui/html/chat/chat-item.tsx
diff --git a/templates/ui/html/chat/chat-messages.tsx b/templates/components/ui/html/chat/chat-messages.tsx
similarity index 100%
rename from templates/ui/html/chat/chat-messages.tsx
rename to templates/components/ui/html/chat/chat-messages.tsx
diff --git a/templates/ui/html/chat/index.ts b/templates/components/ui/html/chat/index.ts
similarity index 100%
rename from templates/ui/html/chat/index.ts
rename to templates/components/ui/html/chat/index.ts
diff --git a/templates/ui/shadcn/button.tsx b/templates/components/ui/shadcn/button.tsx
similarity index 100%
rename from templates/ui/shadcn/button.tsx
rename to templates/components/ui/shadcn/button.tsx
diff --git a/templates/ui/shadcn/chat/chat-avatar.tsx b/templates/components/ui/shadcn/chat/chat-avatar.tsx
similarity index 100%
rename from templates/ui/shadcn/chat/chat-avatar.tsx
rename to templates/components/ui/shadcn/chat/chat-avatar.tsx
diff --git a/templates/ui/shadcn/chat/chat-input.tsx b/templates/components/ui/shadcn/chat/chat-input.tsx
similarity index 100%
rename from templates/ui/shadcn/chat/chat-input.tsx
rename to templates/components/ui/shadcn/chat/chat-input.tsx
diff --git a/templates/ui/shadcn/chat/chat-message.tsx b/templates/components/ui/shadcn/chat/chat-message.tsx
similarity index 100%
rename from templates/ui/shadcn/chat/chat-message.tsx
rename to templates/components/ui/shadcn/chat/chat-message.tsx
diff --git a/templates/ui/shadcn/chat/chat-messages.tsx b/templates/components/ui/shadcn/chat/chat-messages.tsx
similarity index 100%
rename from templates/ui/shadcn/chat/chat-messages.tsx
rename to templates/components/ui/shadcn/chat/chat-messages.tsx
diff --git a/templates/ui/shadcn/chat/index.ts b/templates/components/ui/shadcn/chat/index.ts
similarity index 100%
rename from templates/ui/shadcn/chat/index.ts
rename to templates/components/ui/shadcn/chat/index.ts
diff --git a/templates/ui/shadcn/input.tsx b/templates/components/ui/shadcn/input.tsx
similarity index 100%
rename from templates/ui/shadcn/input.tsx
rename to templates/components/ui/shadcn/input.tsx
diff --git a/templates/ui/shadcn/lib/utils.ts b/templates/components/ui/shadcn/lib/utils.ts
similarity index 100%
rename from templates/ui/shadcn/lib/utils.ts
rename to templates/components/ui/shadcn/lib/utils.ts
diff --git a/templates/index.ts b/templates/index.ts
index 90d0b808..7e23f793 100644
--- a/templates/index.ts
+++ b/templates/index.ts
@@ -30,7 +30,7 @@ export const installTemplate = async ({
    * Copy the template files to the target directory.
    */
   console.log("\nInitializing project with template:", template, "\n");
-  const templatePath = path.join(__dirname, template, framework);
+  const templatePath = path.join(__dirname, "types", template, framework);
   const copySource = ["**"];
   if (!eslint) copySource.push("!eslintrc.json");
 
@@ -59,9 +59,10 @@ export const installTemplate = async ({
    * Copy the selected chat engine files to the target directory and reference it.
    */
   let relativeEngineDestPath;
+  const compPath = path.join(__dirname, "components");
   if (framework === "express" || framework === "nextjs") {
     console.log("\nUsing chat engine:", engine, "\n");
-    const enginePath = path.join(__dirname, "engines", engine);
+    const enginePath = path.join(compPath, "engines", engine);
     relativeEngineDestPath =
       framework === "nextjs"
         ? path.join("app", "api", "chat")
@@ -88,7 +89,7 @@ export const installTemplate = async ({
    */
   if (framework === "nextjs") {
     console.log("\nUsing UI:", ui, "\n");
-    const uiPath = path.join(__dirname, "ui", ui);
+    const uiPath = path.join(compPath, "ui", ui);
     const componentsPath = path.join("app", "components");
     await copy("**", path.join(root, componentsPath, "ui"), {
       parents: true,
@@ -188,7 +189,7 @@ export const installPythonTemplate = async ({
   framework,
 }: InstallPythonTemplateArgs) => {
   console.log("\nInitializing Python project with template:", template, "\n");
-  const templatePath = path.join(__dirname, template, framework);
+  const templatePath = path.join(__dirname, "types", template, framework);
   await copy("**", root, {
     parents: true,
     cwd: templatePath,
diff --git a/templates/simple/express/README-template.md b/templates/types/simple/express/README-template.md
similarity index 100%
rename from templates/simple/express/README-template.md
rename to templates/types/simple/express/README-template.md
diff --git a/templates/simple/express/eslintrc.json b/templates/types/simple/express/eslintrc.json
similarity index 100%
rename from templates/simple/express/eslintrc.json
rename to templates/types/simple/express/eslintrc.json
diff --git a/templates/simple/express/index.ts b/templates/types/simple/express/index.ts
similarity index 100%
rename from templates/simple/express/index.ts
rename to templates/types/simple/express/index.ts
diff --git a/templates/simple/express/package.json b/templates/types/simple/express/package.json
similarity index 100%
rename from templates/simple/express/package.json
rename to templates/types/simple/express/package.json
diff --git a/templates/simple/express/src/controllers/chat.controller.ts b/templates/types/simple/express/src/controllers/chat.controller.ts
similarity index 100%
rename from templates/simple/express/src/controllers/chat.controller.ts
rename to templates/types/simple/express/src/controllers/chat.controller.ts
diff --git a/templates/simple/express/src/routes/chat.route.ts b/templates/types/simple/express/src/routes/chat.route.ts
similarity index 100%
rename from templates/simple/express/src/routes/chat.route.ts
rename to templates/types/simple/express/src/routes/chat.route.ts
diff --git a/templates/simple/express/tsconfig.json b/templates/types/simple/express/tsconfig.json
similarity index 100%
rename from templates/simple/express/tsconfig.json
rename to templates/types/simple/express/tsconfig.json
diff --git a/templates/simple/fastapi/README-template.md b/templates/types/simple/fastapi/README-template.md
similarity index 100%
rename from templates/simple/fastapi/README-template.md
rename to templates/types/simple/fastapi/README-template.md
diff --git a/templates/simple/fastapi/app/__init__.py b/templates/types/simple/fastapi/app/__init__.py
similarity index 100%
rename from templates/simple/fastapi/app/__init__.py
rename to templates/types/simple/fastapi/app/__init__.py
diff --git a/templates/simple/fastapi/app/api/__init__.py b/templates/types/simple/fastapi/app/api/__init__.py
similarity index 100%
rename from templates/simple/fastapi/app/api/__init__.py
rename to templates/types/simple/fastapi/app/api/__init__.py
diff --git a/templates/simple/fastapi/app/api/routers/__init__.py b/templates/types/simple/fastapi/app/api/routers/__init__.py
similarity index 100%
rename from templates/simple/fastapi/app/api/routers/__init__.py
rename to templates/types/simple/fastapi/app/api/routers/__init__.py
diff --git a/templates/simple/fastapi/app/api/routers/chat.py b/templates/types/simple/fastapi/app/api/routers/chat.py
similarity index 100%
rename from templates/simple/fastapi/app/api/routers/chat.py
rename to templates/types/simple/fastapi/app/api/routers/chat.py
diff --git a/templates/simple/fastapi/app/utils/__init__.py b/templates/types/simple/fastapi/app/utils/__init__.py
similarity index 100%
rename from templates/simple/fastapi/app/utils/__init__.py
rename to templates/types/simple/fastapi/app/utils/__init__.py
diff --git a/templates/simple/fastapi/app/utils/index.py b/templates/types/simple/fastapi/app/utils/index.py
similarity index 100%
rename from templates/simple/fastapi/app/utils/index.py
rename to templates/types/simple/fastapi/app/utils/index.py
diff --git a/templates/simple/fastapi/data/brk-2022.pdf b/templates/types/simple/fastapi/data/brk-2022.pdf
similarity index 100%
rename from templates/simple/fastapi/data/brk-2022.pdf
rename to templates/types/simple/fastapi/data/brk-2022.pdf
diff --git a/templates/simple/fastapi/gitignore b/templates/types/simple/fastapi/gitignore
similarity index 100%
rename from templates/simple/fastapi/gitignore
rename to templates/types/simple/fastapi/gitignore
diff --git a/templates/simple/fastapi/main.py b/templates/types/simple/fastapi/main.py
similarity index 100%
rename from templates/simple/fastapi/main.py
rename to templates/types/simple/fastapi/main.py
diff --git a/templates/simple/fastapi/pyproject.toml b/templates/types/simple/fastapi/pyproject.toml
similarity index 100%
rename from templates/simple/fastapi/pyproject.toml
rename to templates/types/simple/fastapi/pyproject.toml
diff --git a/templates/simple/fastapi/tests/__init__.py b/templates/types/simple/fastapi/tests/__init__.py
similarity index 100%
rename from templates/simple/fastapi/tests/__init__.py
rename to templates/types/simple/fastapi/tests/__init__.py
diff --git a/templates/simple/nextjs/.env.example b/templates/types/simple/nextjs/.env.example
similarity index 100%
rename from templates/simple/nextjs/.env.example
rename to templates/types/simple/nextjs/.env.example
diff --git a/templates/simple/nextjs/README-template.md b/templates/types/simple/nextjs/README-template.md
similarity index 100%
rename from templates/simple/nextjs/README-template.md
rename to templates/types/simple/nextjs/README-template.md
diff --git a/templates/simple/nextjs/app/api/chat/route.ts b/templates/types/simple/nextjs/app/api/chat/route.ts
similarity index 94%
rename from templates/simple/nextjs/app/api/chat/route.ts
rename to templates/types/simple/nextjs/app/api/chat/route.ts
index 1d98c832..651a020f 100644
--- a/templates/simple/nextjs/app/api/chat/route.ts
+++ b/templates/types/simple/nextjs/app/api/chat/route.ts
@@ -1,6 +1,6 @@
 import { ChatMessage, OpenAI } from "llamaindex";
 import { NextRequest, NextResponse } from "next/server";
-import { createChatEngine } from "../../../../../engines/context";
+import { createChatEngine } from "../../../../../../engines/context";
 
 export const runtime = "nodejs";
 export const dynamic = "force-dynamic";
diff --git a/templates/simple/nextjs/app/components/chat-section.tsx b/templates/types/simple/nextjs/app/components/chat-section.tsx
similarity index 79%
rename from templates/simple/nextjs/app/components/chat-section.tsx
rename to templates/types/simple/nextjs/app/components/chat-section.tsx
index d4527654..70740429 100644
--- a/templates/simple/nextjs/app/components/chat-section.tsx
+++ b/templates/types/simple/nextjs/app/components/chat-section.tsx
@@ -2,7 +2,7 @@
 
 import { nanoid } from "nanoid";
 import { useState } from "react";
-import { ChatInput, ChatMessages, Message } from "../../../../ui/html/chat";
+import { ChatInput, ChatMessages, Message } from "../../../../../ui/html/chat";
 
 export default function ChatSection() {
   const [messages, setMessages] = useState<Message[]>([]);
@@ -10,15 +10,18 @@ export default function ChatSection() {
   const [input, setInput] = useState("");
 
   const getAssistantMessage = async (messages: Message[]) => {
-    const response = await fetch(process.env.NEXT_PUBLIC_CHAT_API ?? "/api/chat", {
-      method: "POST",
-      headers: {
-        "Content-Type": "application/json",
+    const response = await fetch(
+      process.env.NEXT_PUBLIC_CHAT_API ?? "/api/chat",
+      {
+        method: "POST",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        body: JSON.stringify({
+          messages,
+        }),
       },
-      body: JSON.stringify({
-        messages,
-      }),
-    });
+    );
     const data = await response.json();
     const assistantMessage = data.result as Message;
     return assistantMessage;
diff --git a/templates/simple/nextjs/app/components/header.tsx b/templates/types/simple/nextjs/app/components/header.tsx
similarity index 100%
rename from templates/simple/nextjs/app/components/header.tsx
rename to templates/types/simple/nextjs/app/components/header.tsx
diff --git a/templates/simple/nextjs/app/favicon.ico b/templates/types/simple/nextjs/app/favicon.ico
similarity index 100%
rename from templates/simple/nextjs/app/favicon.ico
rename to templates/types/simple/nextjs/app/favicon.ico
diff --git a/templates/simple/nextjs/app/globals.css b/templates/types/simple/nextjs/app/globals.css
similarity index 100%
rename from templates/simple/nextjs/app/globals.css
rename to templates/types/simple/nextjs/app/globals.css
diff --git a/templates/simple/nextjs/app/layout.tsx b/templates/types/simple/nextjs/app/layout.tsx
similarity index 100%
rename from templates/simple/nextjs/app/layout.tsx
rename to templates/types/simple/nextjs/app/layout.tsx
diff --git a/templates/simple/nextjs/app/page.tsx b/templates/types/simple/nextjs/app/page.tsx
similarity index 100%
rename from templates/simple/nextjs/app/page.tsx
rename to templates/types/simple/nextjs/app/page.tsx
diff --git a/templates/simple/nextjs/eslintrc.json b/templates/types/simple/nextjs/eslintrc.json
similarity index 100%
rename from templates/simple/nextjs/eslintrc.json
rename to templates/types/simple/nextjs/eslintrc.json
diff --git a/templates/simple/nextjs/gitignore b/templates/types/simple/nextjs/gitignore
similarity index 100%
rename from templates/simple/nextjs/gitignore
rename to templates/types/simple/nextjs/gitignore
diff --git a/templates/simple/nextjs/next-env.d.ts b/templates/types/simple/nextjs/next-env.d.ts
similarity index 100%
rename from templates/simple/nextjs/next-env.d.ts
rename to templates/types/simple/nextjs/next-env.d.ts
diff --git a/templates/simple/nextjs/next.config.js b/templates/types/simple/nextjs/next.config.js
similarity index 100%
rename from templates/simple/nextjs/next.config.js
rename to templates/types/simple/nextjs/next.config.js
diff --git a/templates/simple/nextjs/package.json b/templates/types/simple/nextjs/package.json
similarity index 100%
rename from templates/simple/nextjs/package.json
rename to templates/types/simple/nextjs/package.json
diff --git a/templates/simple/nextjs/postcss.config.js b/templates/types/simple/nextjs/postcss.config.js
similarity index 100%
rename from templates/simple/nextjs/postcss.config.js
rename to templates/types/simple/nextjs/postcss.config.js
diff --git a/templates/simple/nextjs/public/llama.png b/templates/types/simple/nextjs/public/llama.png
similarity index 100%
rename from templates/simple/nextjs/public/llama.png
rename to templates/types/simple/nextjs/public/llama.png
diff --git a/templates/simple/nextjs/tailwind.config.ts b/templates/types/simple/nextjs/tailwind.config.ts
similarity index 100%
rename from templates/simple/nextjs/tailwind.config.ts
rename to templates/types/simple/nextjs/tailwind.config.ts
diff --git a/templates/simple/nextjs/tsconfig.json b/templates/types/simple/nextjs/tsconfig.json
similarity index 100%
rename from templates/simple/nextjs/tsconfig.json
rename to templates/types/simple/nextjs/tsconfig.json
diff --git a/templates/streaming/express/README-template.md b/templates/types/streaming/express/README-template.md
similarity index 100%
rename from templates/streaming/express/README-template.md
rename to templates/types/streaming/express/README-template.md
diff --git a/templates/streaming/express/eslintrc.json b/templates/types/streaming/express/eslintrc.json
similarity index 100%
rename from templates/streaming/express/eslintrc.json
rename to templates/types/streaming/express/eslintrc.json
diff --git a/templates/streaming/express/index.ts b/templates/types/streaming/express/index.ts
similarity index 100%
rename from templates/streaming/express/index.ts
rename to templates/types/streaming/express/index.ts
diff --git a/templates/streaming/express/package.json b/templates/types/streaming/express/package.json
similarity index 100%
rename from templates/streaming/express/package.json
rename to templates/types/streaming/express/package.json
diff --git a/templates/streaming/express/src/controllers/chat.controller.ts b/templates/types/streaming/express/src/controllers/chat.controller.ts
similarity index 100%
rename from templates/streaming/express/src/controllers/chat.controller.ts
rename to templates/types/streaming/express/src/controllers/chat.controller.ts
diff --git a/templates/streaming/express/src/controllers/llamaindex-stream.ts b/templates/types/streaming/express/src/controllers/llamaindex-stream.ts
similarity index 100%
rename from templates/streaming/express/src/controllers/llamaindex-stream.ts
rename to templates/types/streaming/express/src/controllers/llamaindex-stream.ts
diff --git a/templates/streaming/express/src/routes/chat.route.ts b/templates/types/streaming/express/src/routes/chat.route.ts
similarity index 100%
rename from templates/streaming/express/src/routes/chat.route.ts
rename to templates/types/streaming/express/src/routes/chat.route.ts
diff --git a/templates/streaming/express/tsconfig.json b/templates/types/streaming/express/tsconfig.json
similarity index 100%
rename from templates/streaming/express/tsconfig.json
rename to templates/types/streaming/express/tsconfig.json
diff --git a/templates/streaming/fastapi/README-template.md b/templates/types/streaming/fastapi/README-template.md
similarity index 100%
rename from templates/streaming/fastapi/README-template.md
rename to templates/types/streaming/fastapi/README-template.md
diff --git a/templates/streaming/fastapi/app/__init__.py b/templates/types/streaming/fastapi/app/__init__.py
similarity index 100%
rename from templates/streaming/fastapi/app/__init__.py
rename to templates/types/streaming/fastapi/app/__init__.py
diff --git a/templates/streaming/fastapi/app/api/__init__.py b/templates/types/streaming/fastapi/app/api/__init__.py
similarity index 100%
rename from templates/streaming/fastapi/app/api/__init__.py
rename to templates/types/streaming/fastapi/app/api/__init__.py
diff --git a/templates/streaming/fastapi/app/api/routers/__init__.py b/templates/types/streaming/fastapi/app/api/routers/__init__.py
similarity index 100%
rename from templates/streaming/fastapi/app/api/routers/__init__.py
rename to templates/types/streaming/fastapi/app/api/routers/__init__.py
diff --git a/templates/streaming/fastapi/app/api/routers/chat.py b/templates/types/streaming/fastapi/app/api/routers/chat.py
similarity index 100%
rename from templates/streaming/fastapi/app/api/routers/chat.py
rename to templates/types/streaming/fastapi/app/api/routers/chat.py
diff --git a/templates/streaming/fastapi/app/utils/__init__.py b/templates/types/streaming/fastapi/app/utils/__init__.py
similarity index 100%
rename from templates/streaming/fastapi/app/utils/__init__.py
rename to templates/types/streaming/fastapi/app/utils/__init__.py
diff --git a/templates/streaming/fastapi/app/utils/index.py b/templates/types/streaming/fastapi/app/utils/index.py
similarity index 100%
rename from templates/streaming/fastapi/app/utils/index.py
rename to templates/types/streaming/fastapi/app/utils/index.py
diff --git a/templates/streaming/fastapi/app/utils/json.py b/templates/types/streaming/fastapi/app/utils/json.py
similarity index 100%
rename from templates/streaming/fastapi/app/utils/json.py
rename to templates/types/streaming/fastapi/app/utils/json.py
diff --git a/templates/streaming/fastapi/data/brk-2022.pdf b/templates/types/streaming/fastapi/data/brk-2022.pdf
similarity index 100%
rename from templates/streaming/fastapi/data/brk-2022.pdf
rename to templates/types/streaming/fastapi/data/brk-2022.pdf
diff --git a/templates/streaming/fastapi/gitignore b/templates/types/streaming/fastapi/gitignore
similarity index 100%
rename from templates/streaming/fastapi/gitignore
rename to templates/types/streaming/fastapi/gitignore
diff --git a/templates/streaming/fastapi/main.py b/templates/types/streaming/fastapi/main.py
similarity index 100%
rename from templates/streaming/fastapi/main.py
rename to templates/types/streaming/fastapi/main.py
diff --git a/templates/streaming/fastapi/pyproject.toml b/templates/types/streaming/fastapi/pyproject.toml
similarity index 100%
rename from templates/streaming/fastapi/pyproject.toml
rename to templates/types/streaming/fastapi/pyproject.toml
diff --git a/templates/streaming/fastapi/tests/__init__.py b/templates/types/streaming/fastapi/tests/__init__.py
similarity index 100%
rename from templates/streaming/fastapi/tests/__init__.py
rename to templates/types/streaming/fastapi/tests/__init__.py
diff --git a/templates/streaming/nextjs/.env.example b/templates/types/streaming/nextjs/.env.example
similarity index 100%
rename from templates/streaming/nextjs/.env.example
rename to templates/types/streaming/nextjs/.env.example
diff --git a/templates/streaming/nextjs/README-template.md b/templates/types/streaming/nextjs/README-template.md
similarity index 100%
rename from templates/streaming/nextjs/README-template.md
rename to templates/types/streaming/nextjs/README-template.md
diff --git a/templates/streaming/nextjs/app/api/chat/llamaindex-stream.ts b/templates/types/streaming/nextjs/app/api/chat/llamaindex-stream.ts
similarity index 100%
rename from templates/streaming/nextjs/app/api/chat/llamaindex-stream.ts
rename to templates/types/streaming/nextjs/app/api/chat/llamaindex-stream.ts
diff --git a/templates/streaming/nextjs/app/api/chat/route.ts b/templates/types/streaming/nextjs/app/api/chat/route.ts
similarity index 95%
rename from templates/streaming/nextjs/app/api/chat/route.ts
rename to templates/types/streaming/nextjs/app/api/chat/route.ts
index 461f3118..e87ef01d 100644
--- a/templates/streaming/nextjs/app/api/chat/route.ts
+++ b/templates/types/streaming/nextjs/app/api/chat/route.ts
@@ -1,7 +1,7 @@
 import { Message, StreamingTextResponse } from "ai";
 import { OpenAI } from "llamaindex";
 import { NextRequest, NextResponse } from "next/server";
-import { createChatEngine } from "../../../../../engines/context";
+import { createChatEngine } from "../../../../../../engines/context";
 import { LlamaIndexStream } from "./llamaindex-stream";
 
 export const runtime = "nodejs";
diff --git a/templates/streaming/nextjs/app/components/chat-section.tsx b/templates/types/streaming/nextjs/app/components/chat-section.tsx
similarity index 85%
rename from templates/streaming/nextjs/app/components/chat-section.tsx
rename to templates/types/streaming/nextjs/app/components/chat-section.tsx
index e1dae74f..a36d2f20 100644
--- a/templates/streaming/nextjs/app/components/chat-section.tsx
+++ b/templates/types/streaming/nextjs/app/components/chat-section.tsx
@@ -1,7 +1,7 @@
 "use client";
 
 import { useChat } from "ai/react";
-import { ChatInput, ChatMessages, Message } from "../../../../ui/html/chat";
+import { ChatInput, ChatMessages, Message } from "../../../../../ui/html/chat";
 
 export default function ChatSection() {
   const { messages, input, isLoading, handleSubmit, handleInputChange } =
diff --git a/templates/streaming/nextjs/app/components/header.tsx b/templates/types/streaming/nextjs/app/components/header.tsx
similarity index 100%
rename from templates/streaming/nextjs/app/components/header.tsx
rename to templates/types/streaming/nextjs/app/components/header.tsx
diff --git a/templates/streaming/nextjs/app/favicon.ico b/templates/types/streaming/nextjs/app/favicon.ico
similarity index 100%
rename from templates/streaming/nextjs/app/favicon.ico
rename to templates/types/streaming/nextjs/app/favicon.ico
diff --git a/templates/streaming/nextjs/app/globals.css b/templates/types/streaming/nextjs/app/globals.css
similarity index 100%
rename from templates/streaming/nextjs/app/globals.css
rename to templates/types/streaming/nextjs/app/globals.css
diff --git a/templates/streaming/nextjs/app/layout.tsx b/templates/types/streaming/nextjs/app/layout.tsx
similarity index 100%
rename from templates/streaming/nextjs/app/layout.tsx
rename to templates/types/streaming/nextjs/app/layout.tsx
diff --git a/templates/streaming/nextjs/app/page.tsx b/templates/types/streaming/nextjs/app/page.tsx
similarity index 100%
rename from templates/streaming/nextjs/app/page.tsx
rename to templates/types/streaming/nextjs/app/page.tsx
diff --git a/templates/streaming/nextjs/eslintrc.json b/templates/types/streaming/nextjs/eslintrc.json
similarity index 100%
rename from templates/streaming/nextjs/eslintrc.json
rename to templates/types/streaming/nextjs/eslintrc.json
diff --git a/templates/streaming/nextjs/gitignore b/templates/types/streaming/nextjs/gitignore
similarity index 100%
rename from templates/streaming/nextjs/gitignore
rename to templates/types/streaming/nextjs/gitignore
diff --git a/templates/streaming/nextjs/next-env.d.ts b/templates/types/streaming/nextjs/next-env.d.ts
similarity index 100%
rename from templates/streaming/nextjs/next-env.d.ts
rename to templates/types/streaming/nextjs/next-env.d.ts
diff --git a/templates/streaming/nextjs/next.config.js b/templates/types/streaming/nextjs/next.config.js
similarity index 100%
rename from templates/streaming/nextjs/next.config.js
rename to templates/types/streaming/nextjs/next.config.js
diff --git a/templates/streaming/nextjs/package.json b/templates/types/streaming/nextjs/package.json
similarity index 100%
rename from templates/streaming/nextjs/package.json
rename to templates/types/streaming/nextjs/package.json
diff --git a/templates/streaming/nextjs/postcss.config.js b/templates/types/streaming/nextjs/postcss.config.js
similarity index 100%
rename from templates/streaming/nextjs/postcss.config.js
rename to templates/types/streaming/nextjs/postcss.config.js
diff --git a/templates/streaming/nextjs/public/llama.png b/templates/types/streaming/nextjs/public/llama.png
similarity index 100%
rename from templates/streaming/nextjs/public/llama.png
rename to templates/types/streaming/nextjs/public/llama.png
diff --git a/templates/streaming/nextjs/tailwind.config.ts b/templates/types/streaming/nextjs/tailwind.config.ts
similarity index 100%
rename from templates/streaming/nextjs/tailwind.config.ts
rename to templates/types/streaming/nextjs/tailwind.config.ts
diff --git a/templates/streaming/nextjs/tsconfig.json b/templates/types/streaming/nextjs/tsconfig.json
similarity index 100%
rename from templates/streaming/nextjs/tsconfig.json
rename to templates/types/streaming/nextjs/tsconfig.json
-- 
GitLab