Build a Web Application (ASP.NET Core MVC) and a Mobile App (MAUI) that share components

john john 966 Reputation points
2023-06-25T10:52:53.5633333+00:00

I want to build a simple web application and a mobile app, which have the following main features (to keep the story short) :-

  1. Users' register inside the application.
  2. Admin review the request >> once approved >> and email will be sent to the user to pay for the registration
  3. Shop register inside the application
  4. Admin review the request >> once approved >> and email will be sent to the shop to pay for the registration
  5. the shop will prompt an item to be delivered
  6. users will be notified >> and the nearest user can pick the order

For the web application >> I will build it using ASP.NET Core MVC.

For the Mobile application >> I will build it using .NET MAUI.

now how i can make those 2-components (MVC & MAUI) coupled together so i do not have to do the shared work twice? mainly the server-side and backend side? can anyone guide me on the best architecture approach to follow?

Thanks

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,596 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,502 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,578 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
341 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,056 Reputation points
    2023-06-25T16:36:34.18+00:00

    I’d probably use razor pages rather than mvc. But your the server code needs to be layered. You might focus on the rest api used by mobile app first. The api code should be nothing more than mapping the api parameters to the business objects that do the work.

    you could also do the same functionality in the web and the mobile at the same time. This will encourage sharing the code via refactoring.

    on design issue will be ui state management. The mobile app has state, but the web site will not. You will want ui state management abstracted and not part of the shared server code base.

    you will also want to consider authentication. The website will use cookie, but the mobile app will probably use bearer tokens.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.