Live data from Hacker News

Pocketbase: Open-source back end in one file

pocketbase.io

111–120 of 151 posts

Re: Pocketbase: Open-source back end in one file

#111

I've skimmed at the docs, and it's not clear to me how it would deal with: * Something like row-level access control, so that people can only access the data in tables that belong to them (say clients can only view their own purchases, and also not modify them after they checked them out). * Integration with the rest of the world, e.g. sending email, acting on triggers, etc. * Something like CSV export/import. * Inte…

I've been developing for PocketBase for 2 months.

As someone else mentioned, API rules can control access to rows.

It can send emails. Set timers. And send its own requests to other webservers. (I haven't used any of these features.) https://pocketbase.io/docs/js-sending-emails/

I had to write my own CSV importer. (I'm hoping to open-source it.)

As for internationalization, what specific features did you want? That seems more like a front-end feature.

Re: Pocketbase: Open-source back end in one file

#112

So it's the "Supabase of SQLite"? Aren't there entire classes of problems that shouldn't exist for SQLite because it's intended to be an embedded database, as opposed to a client/server architecture like Postgres/Supabase? And as such, I'm confused why this exists.

PocketBase is trying to be a simple webserver, code-running backend, and database. I believe the author chose SQLite because it is simple. PocketBase isn't trying to have every feature nor be high performance.

Re: Pocketbase: Open-source back end in one file

#113

How are database migrations handled in this? Ive never understood how BaaSes are to be used when I need to add a new column to my table and do some inserts into it in the same migration

PocketBase has a pb_migrations/ directory. If you throw a file of a certain format, PocketBase will automatically loaded it and update the DB.

Re: Pocketbase: Open-source back end in one file

#114
post #66

I feel like this will be super interesting when pairing with static site generator such as eleventy. Using static site generator is sometimes difficult because of lacking a web backend and ghost is too heavy for me.

Could you explain a bit more this setup? I have been looking for a way to have a tool to fill pages for a static site generator that's local and then just git push in a simplified way. The idea is to create a website for my mother, without having to deal with hosting at all (static github pages). Does this combination work that way?

No. PocketBase runs on a server. It needs a host.

It is simple, so its single program is (1) a webserver, (2) runs server-side code, and (3) hosts a DB. I'm running a $12-per-month server on Vultr and its only service is PocketBase.

You don't need to host the webpages on PocketBase. If you wanted all your webpages to be on Github Pages, you could do that.

Re: Pocketbase: Open-source back end in one file

#115
post #83

this is great. What would be the frontend equivalent? A simple, no bells and whistles frontend to throw something together quickly?

I was happy with Svelte. But it only does single-page apps. But it's simple and the tutorial is delightful.

When I moved to multiple pages, I had to use SvelteKit, which is complicated and not well documented.

Re: Pocketbase: Open-source back end in one file

#116

What minimal front-ends are there that one could combine with this minimal back-end to provide a minimal end-to-end?

If you want a front-end for a single-page webapp, I loved Svelte. It puts all the HTML, JavaScript/TypeScript, and CSS together in the same place. The tutorial is delightful.

BUT, if you need a multi-page webapp, SvelteKit is complicated and not well documented.

Re: Pocketbase: Open-source back end in one file

#117

Cool homepage but I don't even understand what this thing does.

It is a simple program that (1) hosts a webserver, (2) runs server-side code, and (3) hosts a database. It also has built-in support for logging in and permissions to data.

Thus, if you want to write a simple website that needs permissions, storage, and server-side code, it's a great backend solution. The limitation is that it isn't high performance.

Re: Pocketbase: Open-source back end in one file

#118
post #100

I'm not sure I understand what exactly is. I like the tips, but I don't understand: is it an app that I can run on my local machine?

It's a binary called "pocketbase" that you can download and run on your machine. When you run it, it starts a localhost web server. That server includes a web based UI tool that lets you create "collections" (effectively database tables) and insert/update/delete data in them. More importantly, it provides a JSON API (and a client library) for interacting with those collections.

But people build apps on top of it and deploy it to the cloud, too, right? Does it then compete with stuff like AWS RDS?

Re: Pocketbase: Open-source back end in one file

#119
post #100

Earlier quoted context omitted.

It's a binary called "pocketbase" that you can download and run on your machine. When you run it, it starts a localhost web server. That server includes a web based UI tool that lets you create "collections" (effectively database tables) and insert/update/delete data in them. More importantly, it provides a JSON API (and a client library) for interacting with those collections.

But people build apps on top of it and deploy it to the cloud, too, right? Does it then compete with stuff like AWS RDS?

I think it's more like a self-hosted Firebase - you run it on a server (with a disk drive that can persist the data) to get a hosted API for your apps to talk to.

Re: Pocketbase: Open-source back end in one file

#120

So it's the "Supabase of SQLite"? Aren't there entire classes of problems that shouldn't exist for SQLite because it's intended to be an embedded database, as opposed to a client/server architecture like Postgres/Supabase? And as such, I'm confused why this exists.

>And as such, I'm confused why this exists.

Beyond the standalone server mode, I'm able to literally import this as a library/framework right into my Go app (https://pocketbase.io/docs/go-overview/). Having a single binary that contains my custom business logic + a very nice DB/Auth/Admin/... is a very compelling option.

Post reply on HN