NPM = Install and run package
NPX = Run the package but don’t install it
One installs a package/dependency for your project, saves it under node_modules and also in the package.json, example: npm i express
The other one “executes” the package, only for that run, and doesn’t save anything anywhere, for example: npx create-react-app
IMPORTANT: VULNERABILITIES
={red}TODO= You still need to address these 6 vulnerabilities at a later date:
* **nth-check < 2.0.1 (high severity):** This vulnerability is related to inefficient regular expression complexity in `nth-check`.
* **css-select <= 3.1.0 (depends on vulnerable nth-check):** This vulnerability is inherited from the dependency `nth-check`.
* **svgo 1.0.0 - 1.3.2 (depends on vulnerable css-select):** This vulnerability is inherited from the dependency `css-select`.
* **@svgr/plugin-svgo <= 5.5.0 (depends on vulnerable svgo):** This vulnerability is inherited from the dependency `svgo`.
* **@svgr/webpack 4.0.0 - 5.5.0 (depends on vulnerable @svgr/plugin-svgo):** This vulnerability is inherited from the dependency `@svgr/plugin-svgo`.
* **react-scripts >= 2.1.4 (depends on vulnerable @svgr/webpack and resolve-url-loader):** This vulnerability is inherited from the dependencies `@svgr/webpack` and `resolve-url-loader`.
* **resolve-url-loader < 0.0.1-experiment-postcss || 3.0.0-alpha.1 - 4.0.0 (moderate severity):** This vulnerability is related to PostCSS line return parsing errors.
* **postcss < 8.4.31 (moderate severity):** This vulnerability is also related to PostCSS line return parsing errors.
Create REACT Components
Going to go with these techs
Tailwind CSS: The base styling framework. It provides utility classes you use to style all components.
shadcn/ui: A source of customizable, unstyled components that you can style with Tailwind. These will form the core of your application’s custom design system.
DaisyUI: A helper library for prototyping with pre-styled components, speeding up the development process for less critical UI elements.
For now I’m just going to use DaisyUI to create a text output area and a text input area with a dropdown to select LLMs
I will potentially switch to shadcn later when I understand react better.
Get Tailwind VSCode Extension: Tailwind CSS IntelliSense
Add tailwind to CSS file associations in the VSCode settings.json file (command+shift+p: open user settings(JSON))
"files.associations": { "*.css": "tailwindcss" }
Comments in JSX:
{/* This is a single-line comment in JSX */}{/* This is a multi-line comment in JSX */}
Created 3 Component. Comments can be found in files themselves
App.jsx
ChatHistory.jsx
ChatInput.jsx
You’ll need to create message objects in store them in the mongodb history. Right now, queries are being saved in a db called “result”
Think about how you want to approach saving chats. It should probably be per user
This means youll have
user object
info about the user
contains user_preference object
contains chat
user_preference object
configs and preferences tied to user (api keys for instance)
chat_message object
contains a result object tied to a user object
contains a chat_id
chat_window object
contains chat_window_id
contains list of chat_message objects tied by chat_id
chat_configs object
maps to chat_id
contains configs for each chat (llm provider configs for instance)
QueryDisplay: Displays user query and llm_provider tags at top
ResultWindow: Displays all llm results as individual components
ResultCard: Displays result for a single llm provider
InputSection: Area where user inputs query. Includes section to choose LLM providers
ChatList: Panel on left that shows the users chats
You’ll need to connect them to the backend.
Currently, when InputSection fires, /query will be called.
The result will be returned from const handleSendQuery = (newQuery) => { which gets called when the submit button is pressed.
So then, you’ll want to initialize the resultWindow with resultcards created from the /query results