B
B
BugHunter2020-08-03 21:36:58
C++ / C#
BugHunter, 2020-08-03 21:36:58

What is the best way to connect frontend with backend in c#?

Good afternoon!
I am developing an online service, the main function of which is to collect some information on external resources and display it in the form of cards / tables to the user.

I implemented the main functionality in C# .Net Framework, that is, a console application that runs on the server in an endless loop. It checks certain fields in the database for changes, if any, then a separate thread is launched in which information is collected from external resources. After that, the collected information is recorded in the database.

I plan to implement the frontend on HTML + JS. And also a part of the backend in php for writing requests to the database.

Scheme:
User -> Creates a "task" to collect some information -> Presses "Start" ->
When a user creates a "task", PHP script -> Creates an entry in the database about the user's request.
C# application running on the server -> Processes the user's request and collects data -> Writes the collected data to the database.
All this time the user is waiting for processing, and here I think to make JS execute a request to the PHP script every second, which will check if there is already collected data. As soon as data is entered into the database, the content of the page is updated. Namely, instead of a loading wheel, cards with collected information or just a table are added.

Due to my inexperience in developing such applications, I am sure that this is far from the best way to implement it. Write how to implement your plan correctly, without deviating from the scheme in which the main functionality will be performed by a C # application on the server.
Sincerely.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-08-03
@Egolds

why don't you like net mvc, net api ?
write pages at least on a razor, at least on mvc, or you can just vue, react , angular
Why PHP ????

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question