-
Hi all - My question is probably something others besides me would like to know, so I hope someone will help me here. I am starting a nextjs project. There are two boilerplates I like, the first has a lot of dev environment stuff already installed and a basic app. The second is superplate with refine (and for learning, the default data). I am mostly agnostic as to theme, for now Material UI is my choice, could go headless with Tailwind eventually. Using basic rest api to access data. Probably will use mongodb, but might go with a graphql db. What I am looking at is how to integrate refine with the the other boilerplate (which works fine on its own). The alternate is to do it the other way around, but I think this way might be easier. what I am looking for is something like "npm create refine-app@latest" which asks the right questions for me without all the parts of superplate I don't need, but I am concerned about overwriting files. I can use git branches to merge if I have to, I suppose, but that seems like I would want to avoid it if I can. I looked for tutorials via google that address this issue, but the only thing I found was in the refine documentation that says you can add refine to an existing project, but doesn't say how. Any guidance would be appreciated, thanks everyone! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 9 replies
-
'Short Answer:' Just add the bare minimum Refine deps to the template of your choice, then customise the Refine wrapper to your liking. 'Long Answer:' Not a Refine team member, but what you have described would be very hard for Refine team to achieve just because of a mere use cases for it out there. What I've ended up doing for my team for our refactor was take their base template and manually install npm packages I wanted running on top of Vite / this included setting up all the custom providers described in the docs; And everything was pretty much custom as we wanted an easy migration without rewriting too much of components just the data layer was primarily the target + codebase structure and utils. And all of this is running on top of C# server in parallel with the old app. Depending on your experience this should be a day of work for a starter clean project if u don't tinker with ur eslint, never touch that monster if it works. |
Beta Was this translation helpful? Give feedback.
-
Hey @barrynerd, you can use refine with an existing project or from scratch with no issues. Let me share our Next.js docs that you can follow to integrate refine with your existing project. https://refine.dev/docs/advanced-tutorials/ssr/nextjs/
You can always check out our examples in your local or from stackblitz (a list can be seen at https://refine.dev/docs/examples/ but not limited to the list, you can find more examples in our repo). Documentation and the examples will help you complete your setup and use refine. There will be changes in the way we initialize refine in our next major release to make it easier to integrate refine. (won't be breaking the existing apps). We'll make the Note We're updating our tutorials so hopefully we'll provide a easy to follow and understand content to let everyone start using refine from scratch or from an existing project. 🙏 |
Beta Was this translation helpful? Give feedback.
-
Thanks everyone for prompt guidance so far. I will use it to do some experiments. If I have more questions, may I post them here, or should I open a new issue? As for my experience, this is my first complex nextjs project, but otherwise I am very experienced in developing and refactoring code, so this should be doable for me. If I get it to work, I will provide a report here for others to find. |
Beta Was this translation helpful? Give feedback.
-
I just tried (successfully) to build with superplate/material UI and unsuccessfully for a merged boilerplate followed by npm create refine-app@latest -- -o refine-nextjs barry02 when I run npm run dev in barry02 I get a lot of errors, the gist of which seems to be that there are missing modules. I ran npm run refine update and installed the modules that appeared to be missing, but it still returns the same errors on npm run dev Here is a comparison npm list on the two projects. I feel like something is missing, but I am not sure exactly which differences here are refine-related. [email protected] 2$ npm list I feel like I am pretty close here! If I can get it to start up and show the fake data, I will be very happy. I am not concerned right now about antd vs material ui, I just want to see it run at this stage. Eventually I will probably go headless with tailwindcss anyway (although I am open to reasons NOT to do that from those with more nextjs experience than me, which is everyone here I am sure) Thanks again for your guidances! |
Beta Was this translation helpful? Give feedback.
-
Thanks! I look forward to it.
…On Thu, Jan 5, 2023, 1:10 AM Ali Emir Şen ***@***.***> wrote:
Hey @barrynerd <https://github.com/barrynerd>, I'll come up with a
step-by-step integration following this comment as soon as possible to get
you started with no errors 😅
—
Reply to this email directly, view it on GitHub
<#3343 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAR66DCBDYUG57KCMS5I3LWQ2FXZANCNFSM6AAAAAATQHY4OY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This looks excellent, I'll give both the manual and cli versions a spin and
report back.
…On Thu, Jan 5, 2023, 5:18 AM Ali Emir Şen ***@***.***> wrote:
Hope this helps @barrynerd <https://github.com/barrynerd> 🙏
—
Reply to this email directly, view it on GitHub
<#3343 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAR66F4ZZ3XUEVI5CXHONLWQ3C2HANCNFSM6AAAAAATQHY4OY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am posting this here first rather than as an issue because I am not sure if it is user error (meaning me), an issue with refine, or an issue with antd. I have set up a project as instructed above and it works fine. I have replaced the data provider with my own json-server on local host and am proceeding to experiment from there. This is not critical to moving ahead as I have a workaround, but it would he helpful for either me to know my error, or for me to report a bug appropriately to the responsible developers. What I notice is that when I have a server running via "npm run dev", the css cascade on the background color on ant-button-primary class (such as on the create form) is left as transparent, and thus nearly invisible except for the box shadow: button, [type='button'], [type='reset'], [type='submit'] { :where(.css-dev-only-do-not-override-k83k30).ant-btn-primary { My workaround is to place a rule in global.css: button.ant-btn.ant-btn-primary { Am I missing something here, or is this a bug? If a bug, which module is it? |
Beta Was this translation helpful? Give feedback.
I just tried (successfully) to build with superplate/material UI and unsuccessfully for a merged boilerplate followed by npm create refine-app@latest -- -o refine-nextjs barry02
when I run npm run dev in barry02 I get a lot of errors, the gist of which seems to be that there are missing modules.
I ran npm run refine update and installed the modules that appeared to be missing, but it still returns the same errors on npm run dev
Here is a comparison npm list on the two projects. I feel like something is missing, but I am not sure exactly which differences here are refine-related.
[email protected]
├── @mui/[email protected]
├── @pankod/[email protected]
├── @pankod/[email protected]
…