3.3.5 • Published 4 months ago

@darraghor/nest-backend-libs v3.3.5

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
4 months ago

nest-backend-libs

Nest backend libraries is a set of NestJS modules that accelerate product builds with the NestJS framework.

This is the code that powers the backend for Miller Start website and some other apps I run.

You can see how this library is used in a NestJS application on GitHub as use-miller.

Modules used in most applications

The library includes the following modules that can be imported into your NestJS application. They are mostly dependant on each other so you should import them all. But they are things that are common to most applications so it makes sense to have them together in this library if you use this stack.

  • Authorization
  • Auth0 for authentication
  • Configuration
  • Postgres + typeorm
  • SQLite + typeorm
  • health checks
  • invitations
  • logging
  • organisations
  • subscriptions
  • payments (Stripe but should work with any)
  • CLI (e.g. for running stable diffusion)

Modules with no dependencies

  • Open API

Stripe Module Notes

A module for integrating stripe into your nest application.

Default functionality

Webhook handling into a queue is automatically added to the module A controller to generate a customer portal session for authenticated users is added to the module

You must manually add the following to your own module

A controller to create a checkout session for either Authenticated or Unauthenticated users (your choice if you want your front end app to force users to auth or not)

A handler for the webhook queue events. You can see an example StripeQueuedEventHandler in Miller but you will probably want to do different actions for your customers.

Env vars

STRIPE_ACCESS_TOKEN Why: To create stripe sessions using the api Where: https://dashboard.stripe.com/apikeys

STRIPE_WEBHOOK_VERIFICATION_KEY Why: To verify the webhook signature Where: https://dashboard.stripe.com/apikeys

STRIPE_REDIRECTS_BASE_URL Why: To securely redirect the user to the correct website after checkout we don't use a full url in the request object, only a path which is combined with this base url Where: your frontend configuration

Testing

https://stripe.com/docs/webhooks/test

brew install stripe/stripe-cli/stripe
stripe login
# setup webhook forwarding - change port to your BACKEND port
 stripe listen --forward-to localhost:34522/payments/stripe/webhook-receiver

# now you can test webhooks

# if you like you can trigger a test webhook
 stripe trigger checkout.session.completed
 stripe trigger payment_intent.succeeded

Testing with local nest-back-end-libs

pnpm add ../../../nest-backend-libs --force
3.3.5

4 months ago

3.3.4

7 months ago

3.3.1

7 months ago

3.3.3

7 months ago

3.3.2

7 months ago

3.2.1

7 months ago

3.2.0

7 months ago

3.3.0

7 months ago

3.1.1

9 months ago

3.1.0

10 months ago

3.0.4

10 months ago

3.0.3

10 months ago

3.0.2

10 months ago

3.0.1

11 months ago

3.0.0

11 months ago

2.42.3

11 months ago

2.42.4

11 months ago

2.42.1

12 months ago

2.42.0

12 months ago

2.42.2

12 months ago

2.41.1

12 months ago

2.41.0

12 months ago

2.40.3

12 months ago

2.40.2

12 months ago

2.40.1

12 months ago

2.34.0

1 year ago

2.39.1

1 year ago

2.39.0

1 year ago

2.38.2

1 year ago

2.38.1

1 year ago

2.38.3

1 year ago

2.38.0

1 year ago

2.37.0

1 year ago

2.40.0

1 year ago

2.36.7

1 year ago

2.36.4

1 year ago

2.36.3

1 year ago

2.36.6

1 year ago

2.36.5

1 year ago

2.36.0

1 year ago

2.36.2

1 year ago

2.36.1

1 year ago

2.35.10

1 year ago

2.35.13

1 year ago

2.35.11

1 year ago

2.35.12

1 year ago

2.35.9

1 year ago

2.35.8

1 year ago

2.35.5

1 year ago

2.35.4

1 year ago

2.35.7

1 year ago

2.35.6

1 year ago

2.35.1

1 year ago

2.35.0

1 year ago

2.35.3

1 year ago

2.35.2

1 year ago

2.33.0

1 year ago

2.32.14

1 year ago

2.29.0

2 years ago

2.32.0

2 years ago

2.32.2

2 years ago

2.32.1

2 years ago

2.32.8

2 years ago

2.32.7

2 years ago

2.32.9

2 years ago

2.32.4

2 years ago

2.32.3

2 years ago

2.32.6

2 years ago

2.32.5

2 years ago

2.28.0

2 years ago

2.31.0

2 years ago

2.32.11

2 years ago

2.32.10

2 years ago

2.32.13

2 years ago

2.32.12

2 years ago

2.27.0

2 years ago

2.30.1

2 years ago

2.30.0

2 years ago

2.26.0

2 years ago

2.25.0

2 years ago

2.23.1

2 years ago

2.22.0

2 years ago

2.21.2

2 years ago

2.21.4

2 years ago

2.21.3

2 years ago

2.21.5

2 years ago

2.24.0

2 years ago

2.23.0

2 years ago

2.18.27

2 years ago

2.18.28

2 years ago

2.18.29

2 years ago

2.18.26

2 years ago

2.19.2

2 years ago

2.19.3

2 years ago

2.19.0

2 years ago

2.19.1

2 years ago

2.21.0

2 years ago

2.21.1

2 years ago

2.20.10

2 years ago

2.20.13

2 years ago

2.20.11

2 years ago

2.20.12

2 years ago

2.20.2

2 years ago

2.20.3

2 years ago

2.20.0

2 years ago

2.20.1

2 years ago

2.20.8

2 years ago

2.20.9

2 years ago

2.20.6

2 years ago

2.20.7

2 years ago

2.20.4

2 years ago

2.20.5

2 years ago

2.18.23

2 years ago

2.11.0

2 years ago

2.18.24

2 years ago

2.18.25

2 years ago

2.4.0

2 years ago

2.18.20

2 years ago

2.18.21

2 years ago

2.18.22

2 years ago

2.8.0

2 years ago

1.40.0

2 years ago

1.44.0

2 years ago

2.0.0

2 years ago

1.48.0

2 years ago

2.15.4

2 years ago

2.15.2

2 years ago

2.15.3

2 years ago

2.18.16

2 years ago

2.15.0

2 years ago

2.18.17

2 years ago

2.15.1

2 years ago

2.18.18

2 years ago

2.18.19

2 years ago

2.18.12

2 years ago

2.18.13

2 years ago

2.18.14

2 years ago

2.18.15

2 years ago

2.18.10

2 years ago

2.18.11

2 years ago

2.10.1

2 years ago

2.3.0

2 years ago

2.10.2

2 years ago

2.10.0

2 years ago

2.7.0

2 years ago

1.41.0

2 years ago

2.18.9

2 years ago

1.45.0

2 years ago

2.18.7

2 years ago

2.18.8

2 years ago

2.18.5

2 years ago

1.49.1

2 years ago

2.18.6

2 years ago

1.49.0

2 years ago

2.18.3

2 years ago

2.18.4

2 years ago

2.18.1

2 years ago

2.10.9

2 years ago

2.18.2

2 years ago

2.14.3

2 years ago

2.10.7

2 years ago

2.18.0

2 years ago

2.10.8

2 years ago

2.14.1

2 years ago

2.10.5

2 years ago

2.14.2

2 years ago

2.10.6

2 years ago

2.10.3

2 years ago

2.14.0

2 years ago

2.10.4

2 years ago

1.39.0

2 years ago

2.17.19

2 years ago

2.17.16

2 years ago

2.17.15

2 years ago

2.17.18

2 years ago

2.17.17

2 years ago

2.17.12

2 years ago

2.17.11

2 years ago

2.2.0

2 years ago

2.17.14

2 years ago

2.17.13

2 years ago

2.6.0

2 years ago

2.17.10

2 years ago

1.42.0

2 years ago

1.46.0

2 years ago

2.17.8

2 years ago

2.17.9

2 years ago

2.17.6

2 years ago

2.17.7

2 years ago

2.17.4

2 years ago

2.17.5

2 years ago

2.17.2

2 years ago

2.17.3

2 years ago

2.17.0

2 years ago

2.17.1

2 years ago

2.13.0

2 years ago

2.12.0

2 years ago

2.5.0

2 years ago

2.9.0

2 years ago

2.1.0

2 years ago

1.43.0

2 years ago

1.47.0

2 years ago

2.12.19

2 years ago

2.12.9

2 years ago

2.12.18

2 years ago

2.12.17

2 years ago

2.12.7

2 years ago

2.12.16

2 years ago

2.12.8

2 years ago

2.12.15

2 years ago

2.12.5

2 years ago

2.12.14

2 years ago

2.12.6

2 years ago

2.12.13

2 years ago

2.12.3

2 years ago

2.16.0

2 years ago

2.12.12

2 years ago

2.12.4

2 years ago

2.12.11

2 years ago

2.12.1

2 years ago

2.12.10

2 years ago

2.12.2

2 years ago

1.35.1

2 years ago

1.37.0

2 years ago

1.35.0

2 years ago

1.21.0

2 years ago

1.25.0

2 years ago

1.23.0

2 years ago

1.29.0

2 years ago

1.27.0

2 years ago

1.32.0

2 years ago

1.30.0

2 years ago

1.30.1

2 years ago

1.34.0

2 years ago

1.19.0

2 years ago

1.38.0

2 years ago

1.19.1

2 years ago

1.20.0

2 years ago

1.26.0

2 years ago

1.24.0

2 years ago

1.28.0

2 years ago

1.33.0

2 years ago

1.31.0

2 years ago

1.18.0

2 years ago

1.15.0

3 years ago

1.14.1

3 years ago

1.14.0

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.11.0

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago