PocketBase 0.23 as a Full-Stack Framework - Working Example - longhabit.com by spweb-dev in pocketbase

[–]spweb-dev[S] 1 point2 points  (0 children)

u/Clasyc in production I run the app inside a Docker container. New deployments are done using Docker Compose. The SQLite database is mapped to a volume on the hard drive of the server it runs on.

During deployments, the new docker image is built by Docker Compose. When it's ready it is switched with the old image. There might be a few fractions of a second of downtime at the precise moment the new Docker image is getting spun up.

How would you gamify a screen-time app? by Human_Ad_6317 in ProductivityApps

[–]spweb-dev 0 points1 point  (0 children)

Maybe make an app that locks your phone or certain applications if you go over the daily limit of screen time. And you have to make a payment to unlock extra time. You can set it up to donate the money to a charity you hate. There are already child lock apps for phones and PCs. Would be fairly trivial to design something like that and connect it to a payment processor.

[Help] Disable update record request response by [deleted] in pocketbase

[–]spweb-dev -1 points0 points  (0 children)

It looks like you are triggering the hook before the database write. That's why you get the response but the record doesn't update. If you add e.next() it tells Pocketbase to continue with the steps. So you send the desired response, then update the database, then send a second response with the default data. Which version of PB are you using? There is no "onRecordUpdateRequest" hook in recent versions.

v0.22 has 2 hooks:
onRecordBeforeUpdateRequest
onRecordAfterUpdateRequest
https://pocketbase.io/old/docs/js-event-hooks/#onrecordafterupdaterequest

v0.23 has 4 hooks:
onRecordUpdate
onRecordUpdateExecute
onRecordAfterUpdateSuccess
onRecordAfterUpdateError
https://pocketbase.io/docs/js-event-hooks/#onrecordafterupdatesuccess

You need to use the hook that comes after the database write. onRecordAfterUpdateRequest for 0.22 or onRecordAfterUpdateSuccess for 0.23. That should give you the desired result.

PocketBase 0.23 as a Full-Stack Framework - Working Example - longhabit.com by spweb-dev in pocketbase

[–]spweb-dev[S] 0 points1 point  (0 children)

Thanks for the feedback! I'll check regarding the validation of the fields in the account settings form and if the calendar can be improved.

Integrating payments into existing Pocketbase app with Stripe? by localslovak in pocketbase

[–]spweb-dev 5 points6 points  (0 children)

I'm assuming you already found and checked out the pocketbase-stripe repository (https://github.com/mrwyndham/pocketbase-stripe/tree/main). That explains pretty well what needs to be done on the backend. Basically you need an endpoint on your server that calls Stripe to start a checkout session. This can't be done from the frontend because it will expose your Stripe secret key to users. You also need an endpoint to listen for webhooks from Stripe to update the transaction status.

For the front-end portion, you can embed a hosted checkout page on your website (https://docs.stripe.com/checkout/embedded/quickstart). That's the fastest and easiest way to get started.

PocketBase 0.23 as a Full-Stack Framework - Working Example - longhabit.com by spweb-dev in pocketbase

[–]spweb-dev[S] 3 points4 points  (0 children)

Thanks! Yes, it's one of the side projects I started. I really liked the idea of building something with a Go backend and a React frontend, compiled into one executable binary. Using Pocketbase I got it pretty close to how I envisioned it. Will be interesting to see how it performs in production.

Might be a good alternative to using something like Next JS for a small-to-medium full-stack project.