Starting Up
In getting-started guide we’ll bring up a local TrailBase instance, explore the admin dashboard, and implement our first, small application.
Starting TrailBase
The quickest way to get TrailBase up and running is to use docker:
On first start, TrailBase will generate a traildepot
folder in your working
directory containing its configuration, the database, secrets and a few more
things.
It will also generate a new admin user for you. The credentials will be printed
on the command line as follows:
If you like, feel free to change the Email or password later in the dashboard.
Independently, if you ever forget your password, you can reset it using the
trail user reset-password admin@localhost <new_pw>
command.
The Admin Dashboard
After successfully starting TrailBase, we can check out the admin dashboard under http://localhost:4000/_/admin/. After logging in with the admin credentials from the terminal, there’s a couple of pages to explore.
- First and maybe most importantly: the data browser () that let’s you explore and alter both the data as well as table schemas. It provides access to tables, views, virtual tables, indexes, trggiers as well as your TrailBase API settings.
- The simple SQL editor () lets you run arbitrary queries against the database and take full control. It also lets you access SQLite features which aren’t (yet) exposed via the dashboard.
- The accounts page () lets you manage your registered users.
- The logs page () lets you see what’s going on. At this early stage you’re probably just seeing your own interactions with the admin dashboard.
- The settings page () lets you configure instance-wide settings. Alternatively, you can also directly edit TrailBase’s config file, however, unlike the UI you’ll need to restart the server to apply the changes. TrailBase uses protobuf for its configuration. The schema can be found here.
We encourage you to take a minute, click around, and maybe create a few tables.
Don’t worry about breaking anything. Also note that when creating, altering, or
deleting a table a schema migration file will be created in
traildepot/migrations
.