You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.0 KiB

trainable-ai

This is a Vike project. The backend is Hono accepting requests and a tRPC server behind that. The frontend is a React app using Mantine UI for UI and Zustand for state management, but of course with Vike's React integration.

Goal

To create a chatbot that can learn from its interactions with users. The goal is that the user will not have to tell the chatbot to remember anything explicitly; rather, the chatbot will learn from the conversation and remember things on its own.

Project Structure

  • /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. todoItems.ts is just a toy file.
    • /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.
  • /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.
  • /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.
  • /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.
  • /state.ts: Contains the Zustand state management code.