benallfree / awesome-pocketbase

A collection of PocketBase community resources.
Creative Commons Zero v1.0 Universal
658 stars 44 forks source link

Add PocketBase plugins section #16

Closed iamelevich closed 1 year ago

iamelevich commented 1 year ago

Add Plugins sections with my plugins. Probably can be useful for someone.

benallfree commented 1 year ago

Hi, thanks for submitting this! :)

I'm not sure I understand the purpose of this plugin, can you provide a use case to explain?

iamelevich commented 1 year ago

Hi, thanks for submitting this! :)

I'm not sure I understand the purpose of this plugin, can you provide a use case to explain?

Sure. There are 3 plugins:

Telegram auth plugin

Add route that implements auth with Telegram.

Use cases

Ngrok plugin

Add ability to use ngrok for PocketBase application easily. Basically creates tunnel that makes your app avalilable with https or http in internet.

Use cases

Proxy plugin

Simple proxy for non PocketBase routes.

Use cases

@benallfree Is it clear enough? Probably make sense to update description in the PR somehow?

benallfree commented 1 year ago
  1. I'm kind of stumbling over the term plugin - does PocketBase have an official Plugin API?
  2. Telegram - makes sense!
  3. ngrok - I'm not understanding why it's necessary. Can't users just run the ngrok CLI tool? What am I missing :)
  4. proxy - From what I can gather, you are using ngrok to create a single entry point so you can test from your mobile device, then this proxy plugin routes requests to next.js or pocketbase based on routing rules, right? This is an interesting solution, but it requires making a custom build of PocketBase. I imagine there are many lightweight proxy apps that can be used for dev purposes, have you considered that approach? For example, https://www.npmjs.com/package/local-web-server
iamelevich commented 1 year ago
  1. Not sure about official API, but it provides a lot of hooks to upgrade behaviour of PocketBase. Also it have 2 some built-in plugins https://github.com/pocketbase/pocketbase/tree/master/plugins. So I'd tried to use the same interfaces.
  2. Yep, unfortunately PocketBase maintainer not want to merge it in main repo, cause it's not standart OAuth and he don't want to support it. But as plugin it works also.
  3. Yep, you can. But it this plugin just let you do that in one command and also add custom behaviour with ngrok URL. Use case for me: Telegram require https to work with WebApps and you should let Telegram know which URL it should use. So after ngrok start I also update Telegram menu button with Telegram API. Probably someone also can find it useful. In any case you can not use it, it just useful for me and I want to share it if someone needed.
  4. Yep you can, but I want have only one process that I can stop in any time, just don't like have different terminals with different processes, difficult to manage.

In any case all plugins can be used only in situation when you are using PocketBase as framework. Probably in future we will have some other options to create plugins, but for now as is.

benallfree commented 1 year ago

Okay, I understand now. Thank you!