memfreeme / memfree

MemFree - Hybrid AI Search Engine & AI Generate UI
https://www.memfree.me
MIT License
785 stars 101 forks source link

Add Library Installation Recommendations in Generated UI Code #17

Open Mefisto04 opened 2 days ago

Mefisto04 commented 2 days ago

This issue addresses the lack of library installation recommendations in the generated UI code. While the code provides useful snippets, it does not indicate the necessary libraries to install for proper functionality. Implementing this feature will significantly enhance user experience by guiding users on required dependencies.

Attached Screenshot: image

please assign me this issue so that i can start work on it.

ahaapple commented 2 days ago

@Mefisto04 Hi, thanks for your suggestion. How do you plan to fix this problem?

The dependencies in the code are here: https://github.com/memfreeme/memfree/blob/main/frontend/components/code/evaluate-component.tsx

My previous plan was to provide a public github template repository, and then users can copy the code generated by memfree directly into a file and use it online. Like this one: https://github.com/Yuyz0112/dewhale/tree/main/preview-ui

Because memfree supports ShadcnUI, ShadcnUI has a large number of components, and just telling users about the dependencies is not enough.

And tailwind also needs some configuration: https://github.com/memfreeme/memfree/blob/main/frontend/components/code/iframe-renderer.ts

I think we can add a preview top-level directory to the memfree repository, configure package.json, tailwind.config.js, and ShadcnUI components.

Do you have any good ideas and suggestions? Thanks

Mefisto04 commented 2 days ago

Exactly as your response uses different library and component so to give package installation command at top which is used in that response will be helpful for user.

ahaapple commented 2 days ago

Hi, The key point is that all components or pages generated by memfree have the same dependencies, so we don't need to remind users every time we reply. We only need to tell them once in one place. A public github repository template should be the simplest. Do you have a better idea?

Mefisto04 commented 2 days ago

fare points, but if some user generate a template with the shadcn component like button,cards so it have to add the button and cards separately by installing like npx shadcn@latest add button and for cards as well

ahaapple commented 2 days ago

No, in this template project, we will define all the dependencies that may be needed, and all the Shadcn UI components will be included in it.

As long as it is the code generated by memfree. the user only need to follow the following steps to use it:


1. git clone

2. bun i

3. copy the code generated by memfree

3. bun dev

In the future, we will also consider supporting one-click deployment of UI pages to vercel or cloudflare page, which also requires a github repository template