Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PocketBase integration into the administration area #73

Open
viktarovich opened this issue Jul 4, 2024 · 4 comments
Open

PocketBase integration into the administration area #73

viktarovich opened this issue Jul 4, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@viktarovich
Copy link

viktarovich commented Jul 4, 2024

I really like what you're doing. I saw that you are going to add an admin part to your starter.

Have you thought about integrating a ready-made solution into starter like https://pocketbase.io/?

I get the impression that it could complement your solution well.

#question

@mikestefanello
Copy link
Owner

Thank you! That's much appreciated.

It's funny you mention Pocketbase. I came across it somewhat recently and took a pretty deep dive into the project and was incredibly impressed. They really did an amazing job with it. That was part of my motivation to switch this project to use SQLite. I also had the same exact thought as you - including this admin panel would be a gigantic improvement. If there's one thing I would most want to include it would be exactly that.

I started on a fork of this project that used Pocketbase as the backend (replacing Ent, custom auth, etc) just to see how it would go. It was a bit difficult to get something working as it's meant to be API-only, it uses the beta v5 of Echo, and extending it from an entity perspective is easy from the UI but not at all easy via code (as far as I can tell). It's possible I didn't spend enough time on it but I felt the disconnect between entities you try to define in code (so you can have the full control you'd want if you were developing more than a bare-bones CRUD app) and those you define via the UI/config was too large and difficult to deal with. I couldn't find a way to even sync up validation logic that I put in code vs the limited set of controls you have via the UI. I can't remember the details but I also faced issues using the hooks, access, querying, etc, with in-code entities. In the end, I felt like it was too frameworky (for lack of a better word) to feel comfortable enough really building on top of. Also, dealing with SSR for everything but the admin panel, which needs to remain API-based, was also a headache. For instance, Echo only has one error handler you can register and for the main app we'd need to return HTML; but that breaks all errors the API returns (which wants JSON).

I'm all for any ideas or proposals that can leverage Pocketbase or something else (custom or not) to provide some form of an admin panel. There's probably no good way to make it completely dynamic/automatic the way Pocketbase does (entity types, filtering/paging/search, forms, validation, access control, etc), but maybe there's a way to provide the groundwork so it's easy enough for someone to plug in their own entities. If you have any thoughts, please let me know.

@viktarovich
Copy link
Author

viktarovich commented Jul 4, 2024

Thanks for the quick reply.

It looks like that if to use PocketBase, then only as a convenient UI for database schema generation, migration tool and possibly database backup. There was a question asked here about this:
pocketbase/pocketbase#489
The author suggested disabling the creation of new tables/collections to eliminate disconnect between entities in production.

Then for example the Ent can generate Ent schemas from the existing SQL database, as described here:
https://entgo.io/blog/2021/10/11/generating-ent-schemas-from-existing-sql-databases/

However for me it looks complicated and we lose many PocketBase functions.

@mikestefanello
Copy link
Owner

One thing we should look in to is how far we can get with Ent alone. I haven't tried so I'm curious if we can dynamically list out all entity types and perhaps create pages/lists of each entity in order to at least create some starting point of an admin dashboard. Or maybe make it really easy to register which entities types you want to appear on the dashboard (then we don't need everything to be so dynamic). Access control, forms, validation, etc, is a challenge but let's start small.

@mikestefanello mikestefanello added the enhancement New feature or request label Aug 27, 2024
@gedw99
Copy link
Contributor

gedw99 commented Sep 30, 2024

I hear you both. I have used PB and Pagoda.

I am finding this to be a nice HTMX based way to present the DB in the GUI.
It works fine. just go run , etc and kick the tires.

https://github.com/gedw99/goPocJsonSchemaForm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants