Getting Started - digitalgroundgame/pragmatic-papers GitHub Wiki
Requirements
docker
Node.js version 20.9.0+
pnpm
Quick Start
-
Clone the repo and
cdinto it. -
(Optional) Set up the private display font — see Private Font Setup below. Don't worry you can come back to this later.
-
Run
pnpm install. The preinstall hook copiesapps/pragmatic-papers/.envfrom.env.exampleif missing. -
Start dev:
pnpm dev -
Open http://localhost:8000.
Private Font Setup
The @digitalgroundgame/fonts package contains the proprietary display font. It is optional — the site works without it, falling back to system fonts. If you don't have access, skip this section.
If you do have access, create a Classic GitHub Personal Access Token (PAT) at GitHub Settings → Tokens with the read:packages scope.
Set GH_FONT_READ in your environment, it will be referenced by our project's .npmrc:
//npm.pkg.github.com/:_authToken=${GH_FONT_READ}
Set the variable in your shell:
- Mac/Linux — add to
~/.zshrcor~/.bashrc:# ~/.zshrc export GH_FONT_READ=ghp_your_token_here - Windows (PowerShell) — set permanently for your user:
Alternatively, open System Properties → Advanced → Environment Variables (search "environment variables" in the Start menu) and add[System.Environment]::SetEnvironmentVariable("GH_FONT_READ", "ghp_your_token_here", "User")GH_FONT_READunder "User variables".
Restart your terminal after setting the variable.text
Re-run pnpm install after setting up your credentials. You should see ✓ Fonts copied to public/fonts in the output.
[!WARNING] You will see console warnings until GH_FONT_READ is set as an environment variable during development.
Seeding the Database
In order to see some basic content and website functionality it is key to seed your development database with mock content.
- Navigate to
http://localhost:8000/admin - Create a new user. The credentials don't matter here as its local.
- When you land on the dashboard click the
Seed your databaselink. - Wait a few moments and now your website will have some example content when returning to browsing
http://localhost:8000
[!TIP] If your docker database ever gets into a unrecoverable state, or you are switch branches that have different database schemas, be sure to run
pnpm dev:db-nuketo blow away your database and start fresh.
Read more about Seeding The Database
Helpful Commands
Here are the most important scripts available in the root package.json:
pnpm dev: Start the application in development mode.pnpm dev:db: Start the development docker container. This happens automatically when runningpnpm dev.pnpm dev:db-down: Stop the development docker container.pnpm dev:db-nuke: Stop the container and remove the database volume.pnpm lint:fix: Lint files witheslint.pnpm format:fix: Format files withprettier.pnpm check-types: Runs typescript compiler in no emit mode to check for type errors.pnpm migrate:create "name_of_migration": Create the necessary database migrations for your pull request.
[!NOTE] Database Migrations
You do not need to run migrations against your development database, since Drizzle ORM's push mode automatically syncs data changes to your database while in development mode.
Migrations will be required for preview, staging & production environments to properly deploy.