Skip to content

Engineer App created in .NET 6.0 MVC. The topic of the work is Logistic Application which offers wide range of commodities and services, which the customer can order from the company with offer list. Every companies functions is serviced by the user with role administrator.

Notifications You must be signed in to change notification settings

Kowalczyk12340/Engineer-App-created-in-.NET-6.0-MVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Engineer Application created-in ASP .NET 6.0 MVC - (Model View Controller)

Engineer App created in .NET 6.0 MVC. The topic of the work is Wholesaler Application which offers wide range of products and similar app could be used by logistic companies which are able to sending chosen commodities to the dedicated customers. In this application is possible to manage wholesaler app.

Abstract of Thesis in this application

Abstract of thesis The main objective of the following thesis was the creation of a project and the implementation of a web application that deals with supporting the work of wholesale merchandise trade, typical for the employees of the company. The application has a user who can have administrator rights and an ordinary wholesaler. Their powers are similar. The application allows all CRUD operations (Create, Read, Update, Delete) for database entities such as Product Category, Frequency, Supplier, Delivery, Goods, Offer. The above project makes it possible to create an order made from a certain product, created in the system, which has a certain quantity based on the order of the customer to whom the order is addressed at a certain address. You have the option to accept, reject or have your order wait. The administrator has the right, unlike an ordinary employee, to register, block and unlock new users that are available in the system. The web application implemented in this project is a simple but extremely useful tool for the work of the wholesale trade. The project was implemented on . NET using the ASP . NET Core MVC Framework. This application was implemented in C# with . NET 6. 0. The entire code solution is created with Visual Studio Community 2022. The application also has a relational database in T-SQL that can be easily accessed with Microsoft SQL Server Management Studio 18.

A Dropshipping online shop which is created in ASP .NET 6.0 MVC(Model-View-Controller) as an Engineer Work

Project uses a C# code with ASP .NET MVC project created in Visual Studio 2022, architecture concept used as Unit Of Work and Repository pattern. Frontend piece of project is created in Razor Pages file with using jQuery, Datatables and Boostrap 5.0. Apart from that this project is prepared with collaborating with Docker and Azure pipelines to future deploy after one year from end of study.

Architectural pattern: Repository and Unit of work

Structure of project

Description of the implementation

Description of technologies used during the implementation

This engineering thesis uses the modern .NET 6.0 technology, which is almost immediately recognized as supported by Microsoft for a longer period of time, and which saw the light of day at the beginning of 2022. The programming language in which this system was created is C #, using the ASP .NET CORE MVC framework, version 6.0. The backend part of the application is created entirely in C # using libraries such as: EntityFramework, EntityFramework.Core, EntityFramework.Core.SqlServer, EntityFramework.Identity, EntityFramework.Identity.UI, Dapper, SignalR, Dotnet Tools for Migrations, System.Net. Json, System.Data.SqlClient or Microsoft.AspNet.Mvc, this library is intended for this type of application. All packages available in the project will be listed below, and they were added using Package Manager - NuGet Package Manager Console. The Nunit library and the NUnitFramework were used for testing. The application is also supported by containerization elements related to docker.compose.yml and Dockerfile files. The application is connected to a relational database created in SQL, in the T-SQl dialect in the Microsoft SQL Server Management Studio 18 environment. There, through appropriately constructed models or a context class, the data was migrated with the use of EF Core tools. In the database, it is also possible to view all operations of a given system. The frontend part of the application was created using tools such as Razor Pages and cshtml files with a clear division of the project into parts for the administrator and the employee, whose roles were specified in the Startup class when setting the authorization policy. In the Startup class, all project-related configurations are set, such as setting a connection string to the database, or adding dependency injection for services and time units. Configuration of controllers with views, with the addition of builds for Razor Pages, and with any settings for individual project parameters. On the frontend side, such libraries as: Bootstrap, jQuery, or those from Datatables, which are attached to Razor Pages views, which connect to controllers that display endpoints, were used. Sweetalert2 library was also used to display messages. The project uses available libraries for styles and scripts are supported by code written in this class in Javascript or CSS.

Justification for the choice of the above technologies

The basic criterion for selecting the above technologies in this project is the fact that C # is one of the most modern and fastest developing programming languages ​​in the world. C # is the most popular programming language available on the .NET platform. In the application that is described in this engineering thesis, this technology was used because it is characterized by: high efficiency, continuous dynamic development and improvement of the method of implementation of a given language. In addition, C # is portable, and its documentation on Microsoft's website is written very clearly for the person using it and allows a very good understanding of the specificity of software development in accordance with the principles of this language. C # is widely available on the Internet, many books have been written about C #, and the ease of learning it is definitely an argument that supports the above thesis. Another extremely important fact is the large number of job offers related to the .NET platform or the C # language, which are extremely popular on the programming market in the world or in Poland, which is confirmed by all sources available on the Internet. C # always ranks in the top 5 of the most popular. Of all the available technologies on the .NET platform, three definitely stand out: ASP .NET Core Web API, ASP .NET Core MVC, and recently also ASP .NET Blazor. This project uses ASP .NET Core MVC, due to the extremely transparent integration of projects with frontend libraries such as Bootstrap or jQuery, which significantly facilitated the creation of the application's appearance. Another advantage of this framework is its dynamic development in the .NET 6.0 version, as well as the fact that this framework perfectly matches the system architecture selected in this project, and the architectural pattern described below, besides the availability of documentation for ASP .NET MVC, in view of how much it is used on the market, is definitely one of the greatest advantages of this solution. Bootstrap, jQuery or Razor Pages are libraries that are compatible with the backend technology selected in this project. Sweetalert 2 and Datatables, on the other hand, are efficient in table operations, hence their selection is also supported by many interesting facts, such as the fact that the architectural pattern supports the use of these libraries. Any documentation selected in Any documentation of the technologies selected in this project allow for the creation of a project based on free sources available to everyone. ASP .NET MVC technology provides an advanced pattern-based way to create dynamic web sites that allows for a clean separation of problems and gives you full control over markup for fun, flexible programming. The technologies and architectural patterns used in the project are perfectly adapted to the MVC-style software development model. The application mainly uses elements related to the EntityFramework that support data migrations, creating websites and controllers, but some websites also use ORM elements called Dapper, which is a library supporting dynamically transferred data in the form of stored procedures or dynamic variables, which may overwrite previously entered values.

Description of the tools used during the implementation

In the process of developing an application related to the thesis written in C #, the most popular environment related to this language was used, namely Visual Studio Community 2022, which is by far the most popular tool for developing this type of software in the world, and is very often available in various versions. used on the production market among developers all over the world. The great advantages of the Visual Studio environment are: smooth syntax control of many programming languages, a wide selection of plugins to improve work, multilingual support, low weight with high efficiency. In addition, it is one of the most developed environments, supporting the work of programmers at all types of stages of creating effective software. In Visual Studio Community for .NET 6.0, it is possible to include SONAR LINT code syntax checking and even use the database from within the development environment by executing SQL commands and even previewing database elements. A tool such as Postman will be used to test the endpoints, which will allow you to verify the performance of backend operations by examining the consistency of the database results with the endpoint results from the controllers during the application's operation. Another important tool is the Microsoft SQL Server Management Studio 18 environment in which a relational database in the T-SQL dialect has been defined. The database is connected to the project through a special library related to Entity Framework. As for the front-end part of the project, it could be easily implemented in C # with Razor Pages templates in the Visual Studio Community, because the environment also supports the creation of scripts or cascading style sheets in projects for ASP .NET MVC.

Justification for the choice of the above tools

The basic criterion for selecting the above technologies is the fact that the latest release of this environment allows the development of applications in the latest version of .NET 6.0, supported by Microsoft. In this tool, it is possible to connect a version control system, such as GitHub, or to use the unit and integration test explorer. In addition, in Visual Studio 2022 there is a NuGet package management manager, and the ability to start the project on various platforms and adapt it to the requirements of the market. As part of the environment, a basic configuration of the docker image has been created, which may be useful in the basic configuration of the project, and in the event of a possible launch of the product on the production market by adapting it to the possible containerization of the project. Visual Studio Community is the most popular and free environment for developing applications in C # in various frameworks available under a given technology. Visual studio provides mechanisms such as Manager Console, in which, with the help of internal commands, it is possible to do migration, publish project publications, and a well-developed infrastructure for working with various version control systems, comparing classes side by side, error validator, and a built-in mechanism of displayed logs in an extremely transparent way for the developer. The amazing advantage of this environment is the fact that it has a very cleverly arranged debugging mode, from which the code creator can draw a lot of information in order to eliminate bugs, bugs or slight shortcomings. When it comes to Microsoft SQL Server Management Studio 18, it is the best environment for creating databases in the T-SQL dialect, and considering the fact that the creator of both these environments is Microsoft, both these environments are compatible with each other. T-SQL is a dialect that allows you to perform a huge number of operations in a well-developed environment that is very programmer-friendly.

Description of the organizational structure of the project

The project has been separated into smaller appropriate parts of the code, in which each subproject is responsible for a given layer of the application. Such a solution makes any changes made by programmers of similar systems in corporations in different, individually adapted to a given problem or sub-problem tasks easier and in the event of any errors, does not violate the security and integrity of another layer that works properly. The backend part of this system has a clear division into 5 components, recommended in the documentation. In the C # language, it is possible to create class libraries that cannot be set as startup projects, which automatically become libraries supporting the startup project, which in this case is the presentation layer, which is also recommended in the documentation of ASP .NET CORE MVC related applications.

There are 3 such libraries in this project named EngineerDatabase.Entities, EngineerDatabase.Helpers, EngineerDatabase.ContextStructure. Besides, there is a main startup project in the project, which includes all types of controllers and views associated with them, which together are responsible for the final appearance of the given system. The last instance of this solution is a project, which is associated with the NUnit library and is used to create integration and unit tests in this system. The first and basic class library in this project is EngineerApplication.Entities. It represents the model classes available in the project, from which the migrations to the database were created, thanks to which the appearance of the database diagram was created, which is related to the tables available in the system. In this class library there are also ViewModels, which are sometimes needed and are a useful bridge between entities and the logic of the system operation. In the ASP .NET MVC model, ViewModels fulfill a similar function as the DTO classes in REST API applications. The model classes and their ViewModels can then be used in other libraries by linking to each other.

The second library called EngineerApplication.ContextStructure presents the application layer in which the repositories, services, and a class representing often contexts are located, in the case of this application it is a single context that extends the IdentityDbContext class and allows you to migrate tables that can be used in this class assign appropriate parameters for columns or define their integrity or complexity. It is worth mentioning that this class also includes a seeder that fills the project with the data needed to start using such an application. In the websites implemented using the generic Repository class and the UnitOfWork class, the services responsible for the application logic were created. The Repository class is responsible both for the basic template of the service structure, but it is also a method proposed by the .NET platform to properly connect the Ajax library, because using LINQ and the Split method, you can easily split the rendered elements in DataTables and send them asynchronously both on the frontend side and backend. There are classes in the EngineerApplication.Helpers class library that are useful in a project, usually as constants or some important information related to the configuration of the application's actions. In this case, a class with several constants, or a class with confirmation of sending e-mails. Despite the fact that it is not fully implemented, it is prepared so that in the event of putting this application on a production server, it could be easily implemented. In a startup project named EngineerApplication, there is an association with all other layers of the project. In this library, which is the main one in the project, we can find the Program and Startup classes responsible for the configuration and the ability to launch the application, the appsetttings.json file in which a connection to the database created in SQL Server is created, and controllers and views as finishing elements apps. In this project, there is also a wwwroot folder, in which there are libraries used in this project, described in the above technological stack, and all kinds of photos added to the application that have been configured in the Startup class, cascading style sheet files - with the .css extension, and script files with the extension .js. This project also includes all views using the already mentioned Razor Pages for specific views, and a class representing the basic Layout of the application. The application allows you to use localization for the languages ​​available in the application. 3 languages ​​will be available on the website described in this diploma thesis. The basic language set in the application is Polish, but it is possible to easily switch the language in the application header to English or German. The application is available for mobile devices as its appearance can be displayed responsively for different resolutions. In addition, it is worth emphasizing the fact that the implementation of service classes in the infrastructure layer is asynchronous, because the methods are set by the async keyword and the Task return type, which significantly speeds up the operation of the application on many threads. Automatically by creating service classes with asynchronous methods, the methods in the controllers and integration tests are also asynchronous.

The application has a home page and an offer that are available to not logged in users, customers and administrators. Besides, the customer can use the photo gallery. The administrator, on the other hand, can deal with the implementation of more. Most of the application is made up of asynchronous methods and functions to improve application performance on multiple threads. The multithreading of this application is especially visible at the stage of creating websites and their implementation, and then, in accordance with the asynchronous principles, it is reproduced in controllers. The application includes a module for containerization of the entire application for the Docker tool, which allows the application to be launched on many different URLs from one environment.

Description of the implementation of application functions (selected)

The most important and, at the same time, integral function of this system is the creation of orders on the customer's side based on the goods available in the system, providing them with appropriate information about deliveries, suppliers, categories or the quantity of these goods.

Description of the testing and verification phase of the system

Adopted Test Principles

The integration and unit test project has been included as the fifth component of this project and it uses the NUnit library along with the use of libraries such as Moq or System.Data.SqlClient. The test project is divided into two basic segments, such as controller integration tests, and tests of the lower layer of the project, namely tests of services located in the layer responsible for the application logic, which is the basis for the presentation layer, of which the above-mentioned controllers are an integral part. The test design is implemented in accordance with the Behavior Driven Development approach, in which the methods distinguish three separate parts, namely - Arrange, Act, Assert, speaking colloquially, it is an AAA-style testing principle that comes from the first letters of the individual names of the parts of testing . The Arrange part initializes the objects and sets the value of the data passed to the test method. In the Act part, you call the test method from the spread parameters. The Assert section is responsible for checking if the action of the test method works as expected. For .NET frameworks, the methods in the Assert class are often used for validation. Another idea to test this application will be to verify the correctness of endpoints in Postman and to verify the correct operation of individual system functions, apart from unit tests. Another way to test the system written as part of this thesis will be to use a testing tool such as Selenium, in which it will be easy to verify the correctness of the application's transition between individual views, in accordance with the specification and needs of the entire system.

Database Diagram: diagramEngineer

Use Case Diagram: diagramUseCase

Class Diagram diagramClass

Presentation of the created system

The system created as part of this engineering thesis will be presented below. There are two superior roles in the system, such as: Administrator and Customer. In addition, a non-logged user may also function in the system, who, like the customer, can order goods, although on slightly different terms, but the application gives such opportunities to the customer who does not want to register in the system. The most important and, at the same time, integral function of this system is the creation of orders on the client's side based on the goods available in the system. The customer can choose from one to many different goods in any quantity and can add them to the basket, and change the quantity of a given product at any time, and can even remove it from the basket. When adding a given product, the consumer chooses its quantity and adds it to the basket through a special view confirming that he wants to add it to the basket. After selecting the appropriate amount of given goods, the system summarizes the purchase price of the goods on an ongoing basis, and also calculates the VAT price, which in the case of selling goods and services is equal to 23%. After selecting all the goods in the basket that the customer wants to obtain in an appropriate manner, he or she has the option to go to the order summary tab, in which he selects a specific delivery method offered by the system, a payment method offered by the system, and even a specific supplier who has a given deliver the parcel, as long as he cooperates with a company using this web application, which is also available to users of mobile devices. The next stage of order processing on the customer's side is to provide personal data to which the shipment is to be delivered, and then the address data to which the shipment is to be sent. When the customer confirms this transaction, an alert appears about the order completion date by the supplier, which is 14 days from placing the order. The system administrator can manage data that will be presented to the customer when he wants to place an order. The basic task of a user with the role of an administrator is to manage suppliers, methods of delivery and payments, as well as goods and services that, when they are added to the system, will then be automatically displayed in the offer, which will be presented to the customer, who will be able to add them to the basket and order, according to the procedure described above. The system administrator can manage a photo gallery and assign specific employees to specific services offered by the company, and manage orders by assigning them rejected and completed statuses, as well as continuous observation of order details, which are recorded on an ongoing basis and the administrator always has the ability to preview them. Another important task of a user with this role is user management, as well as the ability to register new users with any role, and even block users and unblock them when needed. Another important task of the administrator is the ability to constantly edit data or delete them if necessary, as well as the ability to monitor and manage the status of the order by accepting or rejecting orders that are pending by default. The administrator adds new goods and services to the system, which are then displayed in the offer for the customer who can buy any number of such goods. The administrator also manages the categories of goods and services, as well as employees in the system, shipment suppliers, and even the methods of delivery and payment available in the system. The customer has the option to buy goods using the basket that is present in the application, and to obtain information about services by contacting employees assigned to the services. It is also important that the customer may be a person who is not logged in, because the system assumes that customers who want to buy something at one time and do not want to register may also want to order something, which generates additional profit for the company using the application.

Interface prototype

image image image image image image image image image image image image image

Summary

The system created as part of this diploma thesis is a web application, also available on mobile devices, which allows you to manage the turnover of goods and services in a logistics company managed by the methodology of Dropshipping-style operation, i.e. the so-called quick sale. The system is designed for a specific, specialized industry of automation and robotics, but could also be easily adapted to the needs of other logistics companies. The application allows you to order all kinds of goods and services available on offer, which is prepared by the system administrator, who is the second role in this application. The customer can buy many goods at once through the basket implemented in the application. The buyer has the option to add any number of goods, remove goods from the basket and select purchases accordingly, and once he has made the selection, he can then go to the order summary section. In addition, it is worth emphasizing that the customer can choose the method of delivery, payment method and even a specific supplier during the execution of the order. The customer also provides his address data and approves the execution of the order, which, in accordance with business rules, is to be completed within 14 days from the date of sending the order by the customer. An important feature of this system is the fact that it includes all the steps needed to create and configure a project, such as creating a database, writing the initial business logic based on the rules specified in this document. The system contains a specific, selected architectural model, namely the Repository and Work Unit model, which is an example of the use of Onion Architecture, i.e. one divided into project layers that divide it into smaller subprojects in order to optimize the code and the entire project. It is worth noting that the application was created in accordance with the Code First work rule. The application contains specifically tailored models, generic methods in the repository and services that, by programming in an asynchronous manner, allow for extremely efficient time and computational complexity. The code from the websites is injected through the Dependency Injection container to the controllers that put out ready endpoints on the backend. The project is prepared using Entity Framework CORE version 6.0 and Dapper, which are implemented as part of the application development in the MVC model, and more specifically in ASP .NET 6.0 MVC. The entire backend layer uses C # code, relegated for use in .NET, and views created in Razor Pages files. The project also includes unit tests, integration tests, manual tests, and End-To-End tests. The entire project is supported by the Docker platform, on which you can run the project locally in the Visual Studio 2022 environment, and by Azure services, which are useful in the implementation phase, which, however, in this case is kept only for the application developer. The frontend part is also supported by jQuery and Ajax in Javascript. The application database is created using SQL code, using the T-SQL dialect on the Microsoft SQL Server platform, which is connected to the database through the appsettings.json file and the properly configured EngineerDbContext class. The application is backed by Azure KeyVault, Application Insights, and the entire design pattern for supporting Azure Pipelines in a Visual Studio environment. The entire application is adapted to customers and allows the customer to select the offer tab, in which goods and services are available, divided into subcategories. The application correctly allows you to manage data in it from the administrator role, and to purchase appropriate goods on the customer's side, and order services. The application has a prepared Azure pipeline that can potentially be used in the future.

Bibliography

Books from which knowledge was drawn during the implementation of the project and during the creation of documentation:

  • "C # 10 and .NET 6 - Mark J. Price
  • "Programming in ASP .NET Core - Dino Esposito
  • "ASP .NET MVC with Entity Framework and CSS - Lee Naylor
  • "Serverless Computing using Azure Functions" - Varun Klimar
  • "MS SQL Server" - Adam Pelikant

Engineer Work Author: Marcin Kowalczyk © 2022/2023

About

Engineer App created in .NET 6.0 MVC. The topic of the work is Logistic Application which offers wide range of commodities and services, which the customer can order from the company with offer list. Every companies functions is serviced by the user with role administrator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published