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 ofController
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 thatFrapidController
extendsBaseController
. -
Inherit from
Frapid.WebsiteBuilder.Controllers.WebsiteBuilderController
for frontend pages. For example, the Sign Up Feature extendsWebsiteBuilderController
. Please note thatWebsiteBuilderController
extendsFrapidController
. -
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 extendsDashboardController
. -
Inherit from
Frapid.Dashboard.Controllers.BackendController
instead ofDashboardController
for protected pages which do not require backend theme layout file (master page). For example, the Sales Ticket Report extendsBackendController
instead ofDashboardController
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 exceptGET, 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 withSystem.Web.Mvc.ValidateAntiForgeryTokenAttribute
. - Views can be overridden on tenants and themes.
- Decorate your action method with
[RestrictAnonymous]
attribute if you are not inheriting fromDashboardController
orBackendController
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.