RaythaHQ/raytha

how to embed or migrate my MVC views, actions and controllers With html, js css into Raytha

Closed this issue · 2 comments

Hello, I have been toying around and like your approach, over orchard, umbraco, mix core.

Now, imagine for a minute I have a simple html page with JS, CSS code - (that is handled as an ASP MVC view, action CRUD). Watching your videos I was unable to understand how to port/migrate those

  • First, do I migrate all that using the frontend Crete new type??; Or, do I do it in paste it the Code behind, if so where?
  • To keep it separate from Raytha - do I do this as a plugin - do you have any of those concepts in Raytha where plugins can go into your CMS
  • Is there an auto update like WP
  • scans/ddos (I see audits), how can I lock out users bruteforcing?
  • Should I paste the html as a template or how do I access that, the custom JS code etc?
  • POCO objects
  • The controller CRUD for the POCO
  • where do I put my js code, and lib
  • where do I put my css, and actions/controller code?

Hi,

Without knowing too much about what you are migrating over to Raytha, there are some general principles you can follow. The best video that might be applicable to what you are doing is this one: https://www.youtube.com/watch?v=6iXkLkaWH6Q&t=302s

When would you use a content type?

Content types are for CRUD items that you want to show on your public facing website. Examples are pages and blog posts, help articles for a knowledge base...Basically all your data should be mapped to content types.

Where to put the HTML, CSS, and JS

If you are able to use Raytha completely out of the box (no modification of the actual code base), then all your HTML/CSS/JS goes into Templates: https://docs.raytha.com/articles/templates_intro.html. You would most likely put it all into the _Layout template which is the default parent template. You can modify these templates as you see fit (and its what the youtube video mentioned above covers in detail).

Since that video was created, we added a feature to allow you to upload files (like images, css assets and js assets right into the template engine for convenience)

image

So you can just write <script src="..."> </script> in the theme if you prefer not to in-line your javascript.

I need to migrate the actual c# code and database classes

Then you would be treating Raytha less like a CMS and more like the starter template of an MVC application with RBAC and all that goodness. You can then treat Raytha like any other .NET application and you can migrate your controllers and front end code as you would any other, but there are things to be aware of.

  • Raytha is built on top of the popular Clean Architecture template: https://github.com/jasontaylordev/CleanArchitecture -- so the entire coding pattern from the database layer to the front end layer is well documented there.
  • You can add your controllers, views, etc here: https://github.com/RaythaHQ/raytha/tree/main/src/Raytha.Web/Areas/Public and your js and css assets to wwwroot and choose to forego using Raytha's Template engine entirely. The benefit of using Raytha's Template engine is that you can make changes to the website HTML structure without having to load up the code base and deploy the web application. But if that's not applicable to you, you can skip over it completely.

We are releasing our Cloud Hosted service of Raytha in the coming days and our entire self-service portal itself is built on a customized fork of Raytha using the methodology described above.

Login

If you need more advanced login controls, we recommend disabling Raytha's Email & Password login and turn on Single Sign On. Raytha supports both JWT and SAML-based SSO. This lets you use something like Okta, Auth0, Google Workspace, or Office 365 login. Docs here: https://docs.raytha.com/articles/saml.html

Thanks

moving to GH discussions board