ITP (SS24) project by:
First make sure you satisfy the prerequisites:
pnpm env use --global latest
This will set the latest version to be the default on your system. Check if everything was succesful by running ǹode -v
- you should see a version output../pocketbase
folder.To get started with development you need to do the following:
pnpm install
in the same folder as the package.json
file. This will install all the dependencies and prepare everything needed for development. Note: You need to run pnpm install
again if there is a dependency you are missing!pocketbase serve
from your shell. This should print the an URL where you can access the resources needed. Normally this should be:
pnpm dev
. Again this will print an URL from which you can access the actual application:
PocketBase is our back end which comes in a single binary. The two folders pb_data
and pb_migrations
are going to be created and important because that is our actual application data.
pg_migrations
PocketBase uses migrations this means that the whole database is modeled with files (located in pg_migrations
) an therefore it can be programmed. It simply runs SQL commands on the database (using the PocketBase API) which makes it possible to check it into the Git repository. Now everybody automatically has the same data and this makes it very easy to collaborate. By default an admin account is created to manage the backend you can find out its credentials by checking the appropriate migration file (1710628388_create_default_admin_account.js
) for it and get an idea how it works. Additionally every project member has an account see the 1710633905_default_users.js
for futher information.
See the PocketBase documentation for more information.
pb_data
This is where the actual data is stored i.e. the database - PocketBase uses SQLite to store its data. Because of the migrations we don't have to care about this folder in any other way. It isn't tracked by Git either as we can always use the migrations to recreate the exact same database from them.