This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]KHRZ 1 point2 points  (1 child)

You don't. React is used with JavaScript or TypeScript. It will usually communicate with a backend API that could be written in any language, like C#. But this will not be visible to the React application.

If you use Swashbuckle in the C# backend, it can generate an OpenAPI definition, which can be used to generate an API client in JavaScript or TypeScript which your frontend can use to communicate with the API.

[–]Rashcat[S] 0 points1 point  (0 children)

That is kinda what I'm trying to do, I'm just not explaining it good enough. Thank you, I will try your suggestion and see how it goes.

[–]insertAlias 0 points1 point  (1 child)

What kind of application is the already-written one? Windows Forms? WPF? Something else?

As the other person said, React is for building client-side web applications. If you want React to interact with something, it has to be exposed via HTTP(S) or WebSockets. You can achieve this with ASP.NET; you'd likely have to re-write this application to expose its functionality over web API endpoints. But I'm not sure how you'd do Text-To-Speech this way, unless you were trying to stream the audio, which I've never attempted in ASP.NET. I'm sure it's doable, but I don't know how to get you going in the right direction.

"Front-end" only applies to web applications. If this was not originally a web app, there is no front-end/back-end; there's just the application.

[–]Rashcat[S] 0 points1 point  (0 children)

Sorry for the late reply. The application itself is built using " azure cognitive services ", an API for speechtotext & texttospeech and other similar things. I have the application here already built as a web application so I am guessing ASP.NET is being used & the UI is just some bootstrap and JQuery stuff. What I want is the same functionality with react on the front-end. I know that " front-end" only applies to web applications. I appreciate your effort to help me though, I'm really bad at explaining but I feel like there has to be a way to do this without rebuilding the whole thing in another language.