Lombiq / Orchard-Training-Demo-Module

Demo Orchard Core CMS and Orchard 1.x module for for you to become an Orchard developer. This module completes the training materials under https://orcharddojo.net.
https://orcharddojo.net
BSD 3-Clause "New" or "Revised" License
161 stars 58 forks source link

Simplify Lombiq.TrainingDemo and make it available as a standalone solution too (OSOE-797) #131

Closed MikeAlhayek closed 8 months ago

MikeAlhayek commented 9 months ago

To-dos

Original content by Mike

I shared this project with my colleague to start learning OC. He was overwhelmed after a had of trying to build the training project. I tried to help him setting it up on his local machine, and gave up because I had no more time to waste. But things I noticed if that there are 90 projects in the solution. some project required .net6 and other .netstandard2.0.

Typically if you have been programing for a long time and your PC is old, netstandard2.0 may be already installed on your machine.

I think the training module is for educating users and get the up to speed as much as possible. So why getting this module up and running is a difficult task for new on comers? I found most programmers (including myself) are very lazy. In order to learn something new like OC, the simpler and quicker the get started process the better. And the higher the chance I would actually use OC.

I suggest that this project to be stripped down to very simple project where one can simply clone it and get it up and running. Then the user is able to visit the Map.cs file and start reading and learning. I also suggest using .NET 8 at the dependency for the project since that is the min framework required by OC. All the cool Lombiq toys could be part of another project but not the training module for simplicity.

I hope I don't make the most wanted list after this issue @Piedone šŸ¤£. Just some constructive criticism to help more people adopt the amazing OC.

Jira issue

Piedone commented 9 months ago

Oh now you just made it to the top of the list! :D

Thanks for your feedback!

I believe what you're after is, does this project have to be part of OSOCE? It doesn't, but the price to pay is increasing our maintenance efforts, since it would be an additional OC solution to maintain. This is why we haven't done it like that, to begin with. It's not rocket science, but it's a nontrivial ongoing effort.

Also, to get rid of the necessity to set up Node, we'd need to get rid of the Node.js Extensions dependency, and thus the pickr library, as well as removing the frontend asset processing tutorial step. These are doable, and since NE has samples too, we don't need them here.

The Helpful Libraries dependency can remain, since it makes the GraphQL sample a lot simpler, and it can be just a NuGet dependency anyway.

Note that this project doesn't yet use OC 1.8 (see https://github.com/Lombiq/Orchard-Training-Demo-Module/pull/124), it'll only target .NET 8 after that. Otherwise, we always target the latest LTS.

Piedone commented 8 months ago

Let me summarize what I think can help here:

What do you think, @MikeAlhayek?

MikeAlhayek commented 8 months ago

@Piedone I agree with 1 and 2. If by 3 you mean add the training module only, yes sure.

Not sure about be rest.

Piedone commented 8 months ago

Thanks!

MarGraz commented 8 months ago

Oh now you just made it to the top of the list! :D

Thanks for your feedback!

I believe what you're after is, does this project have to be part of OSOCE? It doesn't, but the price to pay is increasing our maintenance efforts, since it would be an additional OC solution to maintain. This is why we haven't done it like that, to begin with. It's not rocket science, but it's a nontrivial ongoing effort.

Also, to get rid of the necessity to set up Node, we'd need to get rid of the Node.js Extensions dependency, and thus the pickr library, as well as removing the frontend asset processing tutorial step. These are doable, and since NE has samples too, we don't need them here.

The Helpful Libraries dependency can remain, since it makes the GraphQL sample a lot simpler, and it can be just a NuGet dependency anyway.

Note that this project doesn't yet use OC 1.8 (see #124), it'll only target .NET 8 after that. Otherwise, we always target the latest LTS.

I'm coming here from discussion #132

Yes, the effort to maintain different branches must be considered. Can you create a dedicated branch that contains only the demo project? If yes, it could be done automatically from the release pipeline of OC. You can decide to release one (or more projects, depending on the dependencies) in a dedicated branch. In this way, when you release OC, the Demo project would be automatically updated. Of course, it is necessary that the Demo project is not dependent on Node.js.

Right now, I don't have full mastery of the solution, so it is probably something you have already thought about šŸ˜œ

I'm also working on a quick start guide in MD format. I will share it with you when I have a beta version ready šŸ˜Š

Piedone commented 8 months ago

That challenge is not really in changing the NuGet references (though somebody needs to do that too) but adapting to all the API changes (especially breaking changes) in OC and changes in .NET/C#. These are all more efficient to do in bulk (like fixing a new analyzer violation coming with a new C# version for the whole solution, not in N solutions).

Piedone commented 8 months ago

@MikeAlhayek @MarGraz Can you please check out the work in progress under https://github.com/Lombiq/Orchard-Training-Demo-Module/pull/134? I removed the Node dependency and there's now a standalone solution that can be directly used, with Auto Setup. Addressed all the points above.

MarGraz commented 8 months ago

@MikeAlhayek @MarGraz Can you please check out the work in progress under #134? I removed the Node dependency and there's now a standalone solution that can be directly used, with Auto Setup. Addressed all the points above.

I tried it now, nice job @Piedone. A clean solution with only 3 projects and easy to start. Thank you so much šŸ„³

Piedone commented 8 months ago

Great!

MikeAlhayek commented 8 months ago

@Piedone so much cleaner and easier now. Great work.

Why do we need App_Data by default? I think the App_Data should not exists by default. It should be fairly simple process to setup a tenant. You could even use the Workthoughts module for the setup screen "if needed" :)

Also, why do we need .AddSetupFeatures("OrchardCore.AutoSetup") in the startup of the web project?

I think a new pair of eyes should visit all the docs/instructions in the training module to ensure that the workflow of the instruction is smooth for the reader.

Piedone commented 8 months ago

I'm not sure I understand. The App_Data folder is created by OC to store tenant data like the SQLite DB. But it's not something you have to care about.

Auto Setup is used to run the Training Demo recipe on launch.

MikeAlhayek commented 8 months ago

I'm not sure I understand. The App_Data folder is created by OC to store tenant data like the SQLite DB. But it's not something you have to care about.

Yes. But let the trainee create the default tenant instead of creating one for them. The App_Data folder is part of the checked in files.

Piedone commented 8 months ago

Where do you see that? Because it isn't: https://github.com/Lombiq/Orchard-Training-Demo-Module/tree/dev/Lombiq.TrainingDemo.Web. The setup is run when you run the app locally.

MikeAlhayek commented 8 months ago

Oh, I see. I cloned the project and run it. I guess because auto startup is there, it automatically created the default site.

Never mind. Although it may not be a bad idea to let the user create the tenant to avoid what appears to be magic.

Anyway, the training module is so much easier to work with now

Piedone commented 8 months ago

Great then!

When starting to work with this module, one should already be familiar with the setup screen (see Prerequisites so I don't think there's much point in not using Auto Setup. That's also explained under https://github.com/Lombiq/Orchard-Training-Demo-Module?tab=readme-ov-file#how-to-start-learning-orchard-core-with-this-module too.