
Pocketbase is a interresting project that can run a selfhosted backend based on SQLite from a single file. It supports Auth, Hooks, SSE, files and much more and enables users spinning up a backend in seconds. This library is a simple c driver to interact with the pocketbase backend and could easily be ported to a microcontroller.
Symmetric, Asysmetic, Block and Stream ciphers
Publish/Subscribe as a client to topics.
Subscribe to database events/
Login using Token
Upload and download files.
Admin operations.
This lightweight library allows you to authenticate as a PocketBase client directly against your PocketBase backend. If a user record exists within your PocketBase Auth Collection, you can use those credentials to log that user in via C/C++ and subsequently perform authorized requests. The library provides a streamlined interface to CRUD (Create, Read, Update, Delete) records within your collections in real-time. It utilizes Radikant-Url-C to make https request and Radikant-Jwt-C to handle auth tokens.
Initially the user will log in with a username and a password beloging tot he Pocketbase user, the api requests a JWT id token from Pocketbase subequently return a response in json format containing; an id token and a refresh token. The id token can be used for TTL 1 hour to make requests and therefore is shortlived. The library doesnt automatically refresh tokens but checks upon ` request if the current token in possesion is still valid and if its expired use the refresh token to get a new id token and acces token. Therefore during a lengthy session the plain username and password is only sent once. It is possible to store the refresh token across reboots and continue a session but its comes with its own security considerations.
An admin is a “superuser” account which lives in a system auth collection. Super user have god-admin rights. Extra care is required from the user to use this superpower. It is very similair to normal user auth and is done by username password that is exchanged for an jwt token. The superuser had unrestricted acces and should really only be reserved for trusted api’s.
Pocketbase API supports really easy file uploads and downloads. Also files can be uploaded to record, a clasic example is to set an avatar to a user.
Pocktbase API natively supports Server sent events (SSE) (withouth hooks) which is very usefull if the user wants to listen to database changes and get notified by events. Applications can be IoT fleetmangement, chat, syncing a local state.
Pocketbase supports pub sub events in a one to many model. In order to use this functionality you need to install a js hook in pocketbase pb_hooks folder. In the source there is a folder hooks with an example.
Pocketbase supports pub sub events in a one to many model.
Pocketbase supports pub sub events in a one to many model.