bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
309 stars 82 forks source link

Nestjs combined with Nx-electron #204

Open IbnAdamnet opened 1 year ago

IbnAdamnet commented 1 year ago

Really, the nx-electron is a live saver! I am just trying out it now though, and so happen to look towards how to combine it with module based nodejs frameworks like nestjs.

The nestjs documentation has this line: npm i --save @nestjs/core @nestjs/common rxjs reflect-metadata for manual way installation, however I am kind of lost!!!

Looking forward to your guide, thank you.

jasonbdt commented 1 year ago

An official plugin that works together with NX already exists: Take a look here!

IbnAdamnet commented 1 year ago

Thanks for the quick response. However, that would a configured independent Nestjs app, while I want some to simply integrate it with Nx-electron as one app.

I think I have gotten an idea, don't know if that's the right approach though.

In the same Nx-electron file of app.ts where mainWindow is being created, I simply added a method similar to Nestjs bootstrap function with Nestjs specifics, called it after electron window created - and behold I have a Nestjs server app running whenever Nx-electron serves!

Correct me if I'm wrong. Once again, thanks.

On Tue, Feb 21, 2023, 2:40 PM jason.bdt @.***> wrote:

An official plugin that works together with NX already exists: Take a look here! https://nx.dev/packages/nest

— Reply to this email directly, view it on GitHub https://github.com/bennymeg/nx-electron/issues/204#issuecomment-1438510263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOAIPDJQRTAY7ROULXSTC7LWYTAUXANCNFSM6AAAAAAVA56ATQ . You are receiving this because you authored the thread.Message ID: @.***>

IbnAdamnet commented 1 year ago

Hello Sir Please do check out my query. Need help. The Nx-electron is not buildings the project, it's looking for some index.js in dist directory of the project.

I have added screenshot in GitHub issue page. Thanks

On Tue, Feb 21, 2023, 3:02 PM Mahmud Adam Usman @.***> wrote:

Thanks for the quick response. However, that would a configured independent Nestjs app, while I want some to simply integrate it with Nx-electron as one app.

I think I have gotten an idea, don't know if that's the right approach though.

In the same Nx-electron file of app.ts where mainWindow is being created, I simply added a method similar to Nestjs bootstrap function with Nestjs specifics, called it after electron window created - and behold I have a Nestjs server app running whenever Nx-electron serves!

Correct me if I'm wrong. Once again, thanks.

On Tue, Feb 21, 2023, 2:40 PM jason.bdt @.***> wrote:

An official plugin that works together with NX already exists: Take a look here! https://nx.dev/packages/nest

— Reply to this email directly, view it on GitHub https://github.com/bennymeg/nx-electron/issues/204#issuecomment-1438510263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOAIPDJQRTAY7ROULXSTC7LWYTAUXANCNFSM6AAAAAAVA56ATQ . You are receiving this because you authored the thread.Message ID: @.***>