Anyone interested (or already has) in Aurelia with NestJS/GraphQL/MongoDB/Passport/OAuth?

So I was wondering if anyone is interested in a boilerplate for Aurelia with NestJS. If there are many persons interested and are willing to contribute (the latter would be really great), I could create a GitHub repo for it.

So I’m in the learning process (personal that is) of Aurelia with NestJS that includes the following

Why I chose NestJS? Because of the following…

  • it’s a NodeJS framework which has Dependency Injection built in
  • TypeScript support by default (also support ES6 if you wish)
  • easy to add GraphQL
  • easy to add Swagger
  • easy to add MongoDB/Mongoose
  • it’s very well organized and structured for a NodeJS framework
  • fastest growing framework of 2018/2019 (it gained almost 10k stars just in 2019, it’s now close to 20k stars)

What you might not like

  • The architecture of NestJS is very similar to Angular 2 since the main author based himself on Angular to build and expand NestJS.

What I got working so far

  1. GraphQL (with Guards requiring user to be authenticated)
  2. Passport OAuth Strategies (all Auths are using REST though)
    • for Google/Facebook/GitHub/LinkedIn/Microsoft Account
    • a lot of the code that I have for this to work with Passport, comes from Aurelia-Auth. I copied a lot of his code and refactored it to get it working with Passport (though I feel that I’ll eventually have to separate that into an external plugin to cleanup the code).
  3. Save OAuth account to MongoDB and reuse them on next login

So the final thought would be that the POC (Proof of Concept) is all done and working, I’m more into adding extra features and learning how to structure everything the correct way. So far so good.

Here’s 2 print screens (OAuth and GraphQL)


4 Likes

For anyone interested, I finally have enough code to share and here is the GitHub aurelia-nest-auth-mongodb repo. After installing and running both client/server, setting up your OAuth keys, you should then get what I showed in earlier print screens. There are some instructions in the README to get you started.

I would be happy to get any feedback and especially contributions.
Thanks

5 Likes

Sounds great, i´m going to check it out next weekend!

2 Likes