This is a [Vike](https://vike.dev) project. The backend is [Hono](https://hono.dev) accepting requests and a [tRPC](https://trpc.io) server behind that. The frontend is a [React](https://reactjs.org) app using [Mantine UI](https://mantine.dev) for UI and [Zustand](https://github.com/pmndrs/zustand) for state management, but of course with Vike's [React integration](https://vike.dev/react).
This is a [Vike](https://vike.dev) project. The backend is [Hono](https://hono.dev) accepting requests and a [tRPC](https://trpc.io) server behind that. The frontend is a [React](https://reactjs.org) app using [Mantine UI](https://mantine.dev) for UI and [Zustand](https://github.com/pmndrs/zustand) for state management, but of course with Vike's [React integration](https://vike.dev/react). The frontend also uses [React Query](https://react-query.tanstack.com) for data fetching with tRPC.
## Goal
## Goal
@ -9,11 +9,12 @@ To create a chatbot that can learn from its interactions with users. The goal is
## Project Structure
## Project Structure
- `/assets`: Contains static assets such as images and fonts.
- `/assets`: Contains static assets such as images and fonts.
- `/components`: Contains React components
- `/database`: Contains modules exporting ready-to-use database clients so server functions can just query the databases without initializing them. Right now, only PostgreSQL is used; but eventually we will use Milvus as well.
- `/database`: Contains modules exporting ready-to-use database clients so server functions can just query the databases without initializing them. Right now, only PostgreSQL is used; but eventually we will use Milvus as well. `todoItems.ts` is just a toy file.
- `/index.ts`: Exports an object implementing the `ApplicationDatabase` interface, which the tRPC procedures use to interact with the database.
- `/generated`: Contains Typescript types generated from the PostgreSQL database schema using Kanel.
- `/generated`: Contains Typescript types generated from the PostgreSQL database schema using Kanel.
- `/layouts`: Contains React layout components intended to be used as generic layouts for pages. Other than that there is nothing special about this directory; it is not treated any differently than any other directory, and is only named `layouts` for organizational purposes.
- `/layouts`: Contains React layout components intended to be used as generic layouts for pages. Other than that there is nothing special about this directory; it is not treated any differently than any other directory, and is only named `layouts` for organizational purposes.
- `/pages`: Contains the pages of the app, where a file's path is the page's URL path. This is in line with Vike's convention. This is a special directory.
- `/pages`: Contains the pages of the app, where a file's path is the page's URL path. This is in line with Vike's convention. This is a special directory. For example, the `/my/endpoint` page is in the `pages/my/endpoint/+Page.tsx` file. There may be other `+` files in these directories, as they are special Vike files.
- `/hono-entry.ts`: The server's entry point, implemented with Hono.
- `/server`: Contains modules intended to be used on the server-side. There is not yet any particular organization within this directory.
- `/server`: Contains modules intended to be used on the server-side. There is not yet any particular organization within this directory.
- `/trpc`: Contains the tRPC code for the server, router/routes, and client.
- `/trpc`: Contains the tRPC code for the server, router/routes, and client.
- `/types.ts`: Contains the types used by the app. This does not have to be a monolithic file; it can be split into multiple files if it makes sense to do so.
- `/types.ts`: Contains the types used by the app. This does not have to be a monolithic file; it can be split into multiple files if it makes sense to do so.