An open-source wiki built with Pocketbase as backend, based on next-leaflet (a template), easily deploy this yourself via the instructions below.
Development
-
Install docker and docker compose.
- Windows: Docker Desktop
- Linux: Guide from Digital Ocean
- Ubuntu >20.04: Guide from Thijmen Heuvelink
Ensure that you've cloned the repository and are on the correct path.
docker compose up
The stack is now accessible on your preferred browser at http://localhost:3000, the pocketbase interface can be found at http://localhost:3000/pb/_/
To stop the stack from running simply execute the CTRL + C
shortcut.
Production
-
Create a
.env
file:- Locate the
.env.sample
file in your project directory. - Duplicate or copy the contents of this file.
- Rename the duplicate or copied file to
.env
.
- Locate the
-
Configure the environment variable:
- Open the
.env
file in a text editor. - Locate the line that defines the
PRODUCTION
variable. - Set the value of
PRODUCTION
to"true"
(include the quotes).
- Open the
Unlike in the development steps we now add the
-d
flag which makes the service run in the background.
docker compose up -d
The stack is now accessible on your preferred browser at http://localhost:3000 or on a differently defined port as stated in the .env
file, the pocketbase interface can be found at http://localhost:3000/pb/_/
docker compose down
Install Node Packages
docker compose exec next npm i -D <package>
docker compose exec next npm r <package>
NPM
MODULES
Next Navigation API
Instead of using next/navigation
you should opt for the helper at @helpers/navigation
, this is a replacement required by next-intl
it offers the same functionality.
Link
useRouter
Redirect
usePathname
Accessing Pocketbase
Pocketbase has a client executable, below is an example that outputs all available commands. You can learn more on how to use it here.
docker compose exec pocketbase pocketbase --help
CLI
Schema Snapshots
Executing the following will generate a schema snapshot in src/backend/migrations
, note that this process does not save any collection data.
docker compose exec pocketbase pocketbase migrate collections
Pocketbase
Migrations
Continuous Integration
The workflow has been set up to connect to any VPS via SSH as defined in the Repository Secrets.
-
Install docker and docker compose on your VPS.
- Windows: Docker Desktop
- Linux: Guide from Digital Ocean
- Ubuntu >20.04: Guide from Thijmen Heuvelink
-
Setup a Runner on GitHub
-
Create a new Runner
-
Navigate to
Settings > Actions > Runners
To set up a new self-hosted runner, follow the instructions provided by GitHub to configure the runner to listen for jobs. It is advisable to install it as a service.
-
-
Define environment variables
-
Navigate and create new secrets in
Settings > Secrets and variables > Actions
Name Expects Description SSH_KEY Private Key Generated private ssh-key which will beused to access the VPS. SSH_HOST IP Address The address of your VPS that runs theGitHub Actions Runner. SSH_USER Username System user which should be utilized for deployments. SSH_PORT Port Number The port that will be used to connectwith the VPS, default is 22. APP_ENV Environment Contents of the .env
file withadjusted values for deployment.
-
-
Define the branch in .github/deploy.yml
and modify it from being disabled
to an existing branch. Any modifications made to that particular branch will automatically trigger the Action, deploying your stack to your VPS.