TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pocketbase: Open-source back end in one file

630 pointsby dgudkovover 1 year ago

49 comments

rijavecbover 1 year ago
Pocketbase is amazing! So far I had a great experience using it as a backend&#x2F;database for the app I&#x27;m building where I&#x27;m using React with Vite for the frontend. I&#x27;m using it mainly for auth and for keeping track of paid and free accounts. Some things that I found rather useful:<p>- It&#x27;s super easy to host. I was initially thinking of using Appwrite or Supabase but found it a tricky to self-host them, especially Supabase. I could spin up Appwrite quickly via CapRover, but found it an overkill for what I needed.<p>- View collections [1] make it easy to return just a subset of the data that you need. In my case I&#x27;m using a view collection as a join for users and paid_users collections, where I just return their paid through date.<p>- The fact that you can extend it with Go or JS [2] should make it possible to completely skip having a backend, at least if your needs aren&#x27;t very complex.<p>I definitely plan to continue using it for some smaller&#x2F;side projects. Currently I&#x27;m thinking of trying to use it as CMS for an Astro blog and in the future as backend for some browser extensions.<p>[1] - <a href="https:&#x2F;&#x2F;pocketbase.io&#x2F;docs&#x2F;collections&#x2F;#view-collection" rel="nofollow">https:&#x2F;&#x2F;pocketbase.io&#x2F;docs&#x2F;collections&#x2F;#view-collection</a><p>[2] - <a href="https:&#x2F;&#x2F;pocketbase.io&#x2F;docs&#x2F;use-as-framework&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pocketbase.io&#x2F;docs&#x2F;use-as-framework&#x2F;</a>
评论 #38901599 未加载
mdnahasover 1 year ago
I&#x27;ve been developing on PocketBase for 2 months. The system goes into production in 1 to 2 months.<p>I&#x27;m exceptionally happy with it. I&#x27;m developing an webapp for a friend&#x27;s company and wanted a very simple system to hand-off. The whole thing is running with one binary: Pocketbase. It runs a webserver, server-side Javascript (compiled TypeScript) code, and SQLite database. The single process is hosted on Vultr for $12 per month. My frontend is written in SvelteKit (static adapter) + Svelte + TypeScript.<p>Pocketbase is well done. The author has been exceptionally responsive to my questions. He is fast and clear.<p>I have had a few minor issues: The documentation has bare spots (but is very good for most things). I had to write my own CSV loader. (I hope to open-source it.) Writing lots of objects through the CRUD interface is slow. (It&#x27;s possible to write faster using server-side code.) Unit testing for the server-side JavaScript had to be shoehorned in. And I wish Copilot&#x2F;ChatGPT could answer questions better. But these issues have been minor, given all my work on the project.<p>It has some quirks. There&#x27;s no way to set the 404 page on the webserver. And the binary&#x27;s location in the filesystem matters. It was designed for the author&#x27;s use and you have to live with these choices.<p>As I said, I&#x27;ve been happy using it. It fit my needs exactly: simple and I could code everything in one language, TypeScript. Pocketbase is not high-performance, but I didn&#x27;t need that. I&#x27;ve had a few ideas for side projects and, when I&#x27;m done this work, I&#x27;ll implement one on Pocketbase because it is that easy.<p>And, as part of my contract, my friend&#x27;s company will donate to Pocketbase. :)
评论 #38910120 未加载
jddjover 1 year ago
I&#x27;ve been using Pocketbase in production for a few months now, with alpinejs on the front end.<p>The development philosophy is on point. It&#x27;s genuinely pleasant, pragmatic software which serves a real purpose and it improves weekly without feature creep.<p>I watch the discussions and issues slowly getting more tiresome as it becomes more mainstream and worry that he&#x27;ll burn out trying to keep up with the level of support he&#x27;s offered until now.<p>I would very strongly encourage anyone using this to generate income to support the project on open collective.
评论 #38901240 未加载
BilalBudhaniover 1 year ago
I have been following PocketBase since its early day - what I absolutely love about this project is how it actively tries to avoid complexity and focuses on simple yet minimalist approach. Moreover, the ease of deployment by simply uploading a single binary on the server makes it even more attractive.<p>After they introduced Javascript support in the backend - I feel it became a serious contender to challenge Remix, Next.js etc. frameworks.<p>Looking forward to v1
评论 #38899746 未加载
评论 #38899978 未加载
melicerteover 1 year ago
I was looking for a frontend I could use out of the box on top of a sqlite database to design and store my wine collection (since I removed Vivino and its 800+ &quot;partners&quot; it shares my data with).<p>Looks like a single executable, the admin interface and the database I can store on my laptop (and add it to my backup) is all I was looking for. Thank you for PocketBase and thank you for sharing it.<p>That&#x27;s why I always come back to HN :-)
karencaritsover 1 year ago
It is great to see the number of good opensource projects in this area. Grist and NocoDB deserve mentions, although more targeted towards database management. It is also amazing that they provide so simple ways to get started (single file&#x2F;electron)<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;gristlabs">https:&#x2F;&#x2F;github.com&#x2F;gristlabs</a><p>- <a href="https:&#x2F;&#x2F;nocodb.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nocodb.com&#x2F;</a>
评论 #38901119 未加载
notyoutubeover 1 year ago
I&#x27;ve skimmed at the docs, and it&#x27;s not clear to me how it would deal with:<p>* 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).<p>* Integration with the rest of the world, e.g. sending email, acting on triggers, etc.<p>* Something like CSV export&#x2F;import.<p>* Internationalization.<p>Would that all be possible? Straightforward? Do those all require extending (with go or js)?<p>Looks like a nice tool.
评论 #38905219 未加载
评论 #38900936 未加载
评论 #38900953 未加载
ilrwbwrkhvover 1 year ago
Out of all the PaaS I tried including Supabase and Appwrite, Pocketbase is the best. Great performance, intuitive features, actually self hosted and a joy to deploy.
sonoviceover 1 year ago
Have been using pocketbase in production for a mobile app for a couple of month now and so far it was a _very_ pleasent experience. Together with the JS SDK it is now my go to backend framework for everything where I don&#x27;t need specialized libraries (like ML stuff etc.)
fayazaraover 1 year ago
Pocketbase is amazing, I had made a small starter with nuxt 3.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;fayazara&#x2F;pocketbase-nuxt">https:&#x2F;&#x2F;github.com&#x2F;fayazara&#x2F;pocketbase-nuxt</a><p>Example has 1. Auth 2. Route rules 3. CRUD actions 4. Realtime events 5. Storage<p>Needs refactoring but I really enjoyed working with it, I want to add stripe subscriptions to this taking routes rules to it&#x27;s limits, not sure how yet, will figure it out.
efieldsover 1 year ago
The demo is kind of incredible. It’s the admin ux of an app we built internally over 2ish years.<p>It’s just… right there :)
Ilaskyover 1 year ago
Been using Pocketbase for almost all of my projects lately. Its realtime database is especially nice to introduce multiplayer functionality with relative ease.<p>It plus SvelteKit has been a dream to get up and running using the JS SDK.
评论 #38902411 未加载
thangngoc89over 1 year ago
I&#x27;ve been using Pocketbase for several projects. While it&#x27;s a delightful experience for solo-dev to quickly finish a project from backend to complicated frontend, I wish it has bulk-insert out of the box.
WM6vover 1 year ago
What are realistic bottlenecks to expect from a backend like this? Eg. a web app serving users that write posts simultaneously
评论 #38900446 未加载
fullstackchrisover 1 year ago
Very cool. Reminds me of the encore framework, also written in go: <a href="https:&#x2F;&#x2F;github.com&#x2F;encoredev&#x2F;encore">https:&#x2F;&#x2F;github.com&#x2F;encoredev&#x2F;encore</a><p>Need to spend some more time looking into these go based frameworks, they seem great for quick prototyping
评论 #38902447 未加载
rbosingerover 1 year ago
I&#x27;ve been using Pocketbase for personal projects on the machine I use to self-host services. It&#x27;s great. You get CRUD and real-time stuff for free and I didn&#x27;t really have to spend much time learning to start working with it and having it running in an LXC.
jadayesnaamsiover 1 year ago
It is the first time I see that &quot;hook&quot; pattern in a Go API backend: `hook.Hook` and `hook.TaggedHook`.<p>Where does it come from?<p>Why is it useful here?<p>What are the alternatives? Advantages&#x2F;Drawbacks?<p>Is there an article somewhere, outside of the Pocketbase docs, presenting that pattern?<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;pocketbase&#x2F;pocketbase&#x2F;blob&#x2F;master&#x2F;core&#x2F;app.go">https:&#x2F;&#x2F;github.com&#x2F;pocketbase&#x2F;pocketbase&#x2F;blob&#x2F;master&#x2F;core&#x2F;ap...</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;pocketbase&#x2F;pocketbase&#x2F;tree&#x2F;master&#x2F;tools&#x2F;hook">https:&#x2F;&#x2F;github.com&#x2F;pocketbase&#x2F;pocketbase&#x2F;tree&#x2F;master&#x2F;tools&#x2F;h...</a>
评论 #38906807 未加载
twstedover 1 year ago
Pocketbase seems really well done and useful.<p>I am building something similar but at a lower level and based on PostgreSQL.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sted&#x2F;smoothdb">https:&#x2F;&#x2F;github.com&#x2F;sted&#x2F;smoothdb</a><p>It aims to be compatible with the PostgREST API.
turtlebitsover 1 year ago
I like the idea, but after using it, the query apis aren&#x27;t expressive enough. I wish I could write SQL instead of making 2+ api calls to get the data I want.
评论 #38904903 未加载
评论 #38904883 未加载
eternityforestover 1 year ago
Looks like what you hope LibreOffice Base will be, when one first years of the existence of those kinds of tools.<p>Really nice, looks like something I&#x27;d love to work with someday!
Fire-Dragon-DoLover 1 year ago
I&#x27;m not sure I understand what exactly is. I like the tips, but I don&#x27;t understand: is it an app that I can run on my local machine?
评论 #38904556 未加载
评论 #38906112 未加载
tiffanyhover 1 year ago
So it&#x27;s the &quot;Supabase of SQLite&quot;?<p>Aren&#x27;t there entire classes of problems that shouldn&#x27;t exist for SQLite because it&#x27;s intended to be an embedded database, as opposed to a client&#x2F;server architecture like Postgres&#x2F;Supabase?<p>And as such, I&#x27;m confused why this exists.
评论 #38905655 未加载
评论 #38905234 未加载
评论 #38906096 未加载
miguelgargalloover 1 year ago
PocketBase is amazing, I can achieve almost all my projects self hosted without any thirdparty on dockers with this<p><a href="https:&#x2F;&#x2F;github.com&#x2F;miguelgargallo&#x2F;docker-pocketbase">https:&#x2F;&#x2F;github.com&#x2F;miguelgargallo&#x2F;docker-pocketbase</a>
chazeonover 1 year ago
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.
评论 #38904564 未加载
tamimioover 1 year ago
I like this for testing and quick&#x2F;simple database, very useful in concept for building a platform for embedded work, where you don’t need to go down the rabbit hole in the whole full stack tech.
tommicaover 1 year ago
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
评论 #38905246 未加载
评论 #38904838 未加载
mihalycsabaover 1 year ago
Can this thing be used for a forum type site + a minimal game feature with around 5k daily users? How could you scale this with a single common database?
评论 #38910524 未加载
roliszover 1 year ago
I mostly know Python. Is there something similar in Python? Or the backend language is not relevant, because you mostly use this from JavaScript anyway?
评论 #38901085 未加载
评论 #38900468 未加载
评论 #38913842 未加载
account-5over 1 year ago
Dart SDK, excellent. Just what I&#x27;m looking for.
mrwyndhamover 1 year ago
If anyone is interested in extending I have done some work on it and can confirm it is quite easy. I extended it to be able to use stripe check it out below:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mrwyndham&#x2F;pocketbase-stripe">https:&#x2F;&#x2F;github.com&#x2F;mrwyndham&#x2F;pocketbase-stripe</a>
remramover 1 year ago
I am a bit confused, is it the backend&#x27;s backend? E.g. something that is used by the HTTP server app, like a DBMS would be?<p>Or is it actually the backend, e.g. the frontend (browser) talks to it directly?
评论 #38902006 未加载
评论 #38902431 未加载
imperialdriveover 1 year ago
This looks too good to be true for a project I had in mind—kudos!
igtztorreroover 1 year ago
Good Golang anda Svelte code organization, I Will take as example
RamblingCTOover 1 year ago
So it&#x27;s just auth + files on top of a db, essentially providing auth&#x27;d CRUD with extras? So you write the business logic in the frontend?
xsumirxover 1 year ago
Didn&#x27;t know tool like this existed. Thanks for sharing.
Humphreyover 1 year ago
It looks really cool! I can imagine using this for small projects. I wonder if it would be possible to also support a GraphQL API in the future?
wg0over 1 year ago
After ent.io entity framework, that&#x27;s the other most beautiful piece of software that I have seen in Go!<p>The simplicity is simply mind boggling!<p>Going to give it a try!
评论 #38904985 未加载
air7over 1 year ago
this is great. What would be the frontend equivalent? A simple, no bells and whistles frontend to throw something together quickly?
评论 #38905296 未加载
jarekceborskiover 1 year ago
Simple is beautiful! I think it could be more than enough for 90% or more use cases, and without over-engineering.
082349872349872over 1 year ago
What minimal front-ends are there that one could combine with this minimal back-end to provide a minimal end-to-end?
评论 #38900906 未加载
评论 #38900369 未加载
评论 #38905315 未加载
oschvrover 1 year ago
Really cool, I&#x27;ll give it a try
brabelover 1 year ago
It seems to me that redbean is a much simpler, vastly lighter one-file web server + sqlite DB: <a href="https:&#x2F;&#x2F;redbean.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;redbean.dev&#x2F;</a><p>As a bonus, the same file runs on basically any OS without any dependencies on the local system, not even libc.
评论 #38900598 未加载
评论 #38900370 未加载
评论 #38907481 未加载
评论 #38900522 未加载
Fire-Dragon-DoLover 1 year ago
How much can the &quot;crud operations page&quot; can be customized?
bambaxover 1 year ago
First time I hear about this... looks absolutely fantastic! Will try.
saasjoshover 1 year ago
Cool homepage but I don&#x27;t even understand what this thing does.
评论 #38900536 未加载
评论 #38905333 未加载
评论 #38901250 未加载
punnerudover 1 year ago
Seems like a JavaScript based version similar to Django (Python)?
评论 #38901482 未加载
zffrover 1 year ago
What are the pros&#x2F;cons of this over firebase?
评论 #38903384 未加载
TruthWillHurtover 1 year ago
Very cool, but this is a security anti-pattern.<p>Having the auth, db and file server in the same service.. an attacker doesn&#x27;t even need lateral traversal or privilege escalation once inside..
评论 #38901366 未加载
doublerabbitover 1 year ago
Scouring the documentation there&#x27;s mention of a way to use PocketBase without JavaScript or Dart. Are they the only methods?
评论 #38900796 未加载
评论 #38900547 未加载