- NestJS vs Adonis
Although I would also choose and documented boilerplate of ExpressJS, but that too much of scope now, NestJS at least defined a structure, thus simplify the way and forced you to only using certain flow that enforce by NestJS’s Middleware
- Git Clone my fork of https://github.com/edwardchanjw/cats-nest
- Read the .platform.app.yaml for customized deploy step
- Setup following to your own environment variable in Management Panel of Platform.sh
OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER=https://accounts.google.com OAUTH2_CLIENT_REGISTRATION_LOGIN_SCOPE=openid profile SESSION_SECRET=<super+secret+session+key> OAUTH2_CLIENT_REGISTRATION_LOGIN_CLIENT_ID=<CLIENT_ID>.apps.googleusercontent.com OAUTH2_CLIENT_REGISTRATION_LOGIN_CLIENT_SECRET=<CLIENT_SECRET> OAUTH2_CLIENT_REGISTRATION_LOGIN_REDIRECT_URI=<YOUR_APP_URI> OAUTH2_CLIENT_REGISTRATION_LOGIN_POST_LOGOUT_REDIRECT_URI=<YOUR_APP_URI>
The first three environment variable is static, or the secret is defined by you.
The OAUTH2_CLIENT_REGISTRATION_LOGIN_CLIENT_ID and OAUTH2_CLIENT_REGISTRATION_LOGIN_CLIENT_SECRET is provided by Google’s OAuth2 Client. You can refer the tutorial on dev.to.
The OAUTH2_CLIENT_REGISTRATION_LOGIN_REDIRECT_URI and OAUTH2_CLIENT_REGISTRATION_LOGIN_POST_LOGOUT_REDIRECT_URI is from Platform.sh, you can automate it on .platform.app.yaml and I leave it as a exercise for you. Probably I can update to Platform.sh community when I have time to spin up a machine.
That is. I will go back to worked on boilerplate for NestJS, ExpressJS with firebase Authentication and OAuth2, hopefully their different and the minor different between them.