Skip to main content

Development

Getting Started

The basics are the same as in the Quick Start section, but we'll need to download more dependencies.

Prerequisites

Steps

1. Clone the repository

git clone git@github.com:goniszewski/grimoire.git

2. Rename the .env.example file to .env

mv .env.example .env # on Linux/MacOS
# or
ren .env.example .env # on Windows

The default .env file will look like this:

.env
# Set it if you're using external PocketBase installation (default: http://pocketbase)
# Example: PUBLIC_POCKETBASE_URL=https://grimoire.mydomain.com:8090
PUBLIC_POCKETBASE_URL=
# RECOMMENDED: Change this to your email
ROOT_ADMIN_EMAIL=admin@grimoire.localhost
# RECOMMENDED: Use a secure password. Can be later changed in PocketBase's admin panel
ROOT_ADMIN_PASSWORD=changeme
# Set this to your domain name (default: http://localhost:5173)
# Example: PUBLIC_ORIGIN=grimoire.mydomain.com
PUBLIC_ORIGIN=http://localhost:5173
# Set this to true if you're using HTTPS (default: false)
# Example: PUBLIC_HTTPS_ONLY=true
PUBLIC_HTTPS_ONLY=
# Change to the port you want the app to listen on (default: 5173)
# Example: PORT=80
PORT=5173
# Set this to true if you want to disable public signups (default: false)
PUBLIC_SIGNUP_DISABLED=false

To run the application in development mode, you'll need to set the PUBLIC_POCKETBASE_URL to http://localhost:8090:

PUBLIC_POCKETBASE_URL=http://localhost:8090

3. Build and run the containers

Now we'll use the run-dev.sh script as a shortcut to run the container for PocketBase and run the application in development mode:

chmod +x ./run-dev.sh && ./run-dev.sh

4. Start developing!

Congratz! You can now open your favorite IDE and start tinkering! Go to the http://localhost:5173 to see the changes in real time, thanks to hot-reloading built into Vite.

Next Steps