Skip to content

Latest commit

 

History

History
45 lines (25 loc) · 3.33 KB

creating-app.md

File metadata and controls

45 lines (25 loc) · 3.33 KB

Creating a New Frapid Module

Developing an application in Frapid is no different than developing plain old ASP.net MVC applications. These are the checklist you need to remember:

Creating an App

Locate the Frapid Console utility under:

/bin/frapid.exe

and enter the command to create your app:

create app MyAwesomeApp

The application will be created on /Areas/MyAwesomeApp. Edit the file AppInfo.json and open the solution file MyAwesomeApp.sln in Visual Studio.

Controllers

  • Inherit from Frapid.Areas.BaseController instead of Controller for public controllers. In other words, for pages which do not require user to be logged in.

  • Inherit from Frapid.Areas.FrapidController for controllers which may or may not require the user to be logged in. This is useful in cases when you want to display additional information for logged in user, whilst keeping the remainder of the page public. Please note that FrapidController extends BaseController.

  • Inherit from Frapid.WebsiteBuilder.Controllers.WebsiteBuilderController for frontend pages. For example, the Sign Up Feature extends WebsiteBuilderController. Please note that WebsiteBuilderController extends FrapidController.

  • Inherit from Frapid.Dashboard.Controllers.DashboardController for protected pages, which require user to be logged in and additionally require to use the backend theme layout file. For example, the User List Backend Page extends DashboardController.

  • Inherit from Frapid.Dashboard.Controllers.BackendController instead of DashboardController for protected pages which do not require backend theme layout file (master page). For example, the Sales Ticket Report extends BackendController instead of DashboardController because, even though the sales ticket is a protected page, it does not need any layout or master page.

Uncategorized:

  • Decorate your controller with [Antiforgery] attribute if your controller contains any action except GET, HEAD, OPTIONS. In other words, if your controller allows data to be written or deleted, you must use the [Antiforgery] attribute. Remember that you cannot substitute this attribute with System.Web.Mvc.ValidateAntiForgeryTokenAttribute.
  • Views can be overridden on tenants and themes.
  • Decorate your action method with [RestrictAnonymous] attribute if you are not inheriting from DashboardController or BackendController and still want to protect that action from anonymous access.
  • If you want to execute your custom code during application start, implement the interface IStartupRegistraion. For example, the account app upserts installed domains by implementing this interface.
  • Ask questions in MixERP Forums, we will try to help you as much as we can.

Back to Developer Documentation