This project was created with Better-T-Stack, a modern TypeScript stack that combines Fastify, and more.
- TypeScript - For type safety and improved developer experience
- Swift - For iOS app (using SwiftUI and Swift Data)
- Fastify - Fast, low-overhead web framework
- Node.js - Runtime environment
- PostgreSQL - Relational Database engine
- Neo4J - Graph DB
- Drizzle - TypeScript-first ORM (for PostgreSQL only)
- Pothos - TS schema builder for GraphQL
- Mercurius - Easily run Graph QL server on Fastify
- Apollo client - GraphQL client for iOS
- Authentication - Better-Auth
- Husky - Git hooks for code quality
- Oxlint - Oxlint + Oxfmt (linting & formatting)
- Turborepo - Optimized monorepo build system
First, install the dependencies:
pnpm installYou need to add a .env file in apps/server with all the relevant environment variables. See packages/env/src/server.ts for the environment variables you need to set.
For Better Auth secret, run openssl rand -base64 32.
For Garage RPC secret, run openssl rand -hex 32.
For Better Auth url, you can default to http://localhost:3000 for local development. For S3 url, you can default to http://localhost:3900 for local development.
The server won't start without all the environment variables, so for GARAGE_ACCESS_KEY and GARAGE_SECRET_KEY you can put in random text before filling in the right values during S3 setup (see guide below).
Because iOS apps can only make HTTPS requests (technically you can disable this, but your app will not be approved), the server is configured to require a certificate and key to run. If you try to run the server without these, the server will error.
To create a local SSL certificate, follow these instructions.
- Install mkcert
- Run
mkcert -install - Run
mkcert -cert-file localhost.pem -key-file localhost-key.pem localhost 127.0.0.01 ::1 - Put localhost.pem and localhost-key.pem in the root directory (where this README is)
This project uses PostgreSQL with Drizzle ORM and Neo4j.
-
Update your
apps/server/.envfile with your connection details as mentioned above. -
Apply the schema to your PostgreSQL database:
pnpm run db:migrateThen, run the development server:
pnpm run devThe API is running at https://localhost:3000.
- Go to the /seed endpoint on the server.
- If you want to use test data, go to the /seed-test-data endpoint on the server (must be after completing step 1).
Important: This must be done after seeding the database.
While running the S3 docker container,
- Go to the admin UI (http://localhost:3909/)
- Go the keys tab and create a key.
- In your apps/server .env file, set GARAGE_ACCESS_KEY = Key ID from Garage and GARAGE_SECRET_KEY = Secret Key from Garage
- Go to the buckets tab and create a bucket called
park-images - In the park-images bucket, go to manage -> permissions and give your key (created in step 2) read, write, and owner permissions.
- Go to https://localhost:3000/seed-s3
Now, you can run the s3 seed script.
Important: Minimum Xcode 16.3
Read the README in the apps/ios folder for instructions on how to add the certificate to the iOS simulator.
- Initialize hooks:
pnpm run prepare
wildlog/
├── apps/
│ └── server/ # Backend API (Fastify)
│ └── ios/ # iOS app (SwiftUI)
├── packages/
│ ├── auth/ # Authentication configuration & logic
│ ├── config/ # Base config
│ ├── env/ # Make build fail if missing any env vars
│ └── db/ # Relational database schema & queries
│ └── graph-db/ # Graph database queries
pnpm run dev: Start all applications in development modepnpm run build: Build all applicationspnpm run dev:server: Start only the serverpnpm run check-types: Check TypeScript types across all appspnpm run db:push: Push schema changes to databasepnpm run db:studio: Open database studio UIpnpm run check: Run Oxlint and Oxfmtpnpm run package:list: List all packages in workspace
- Make new folder in packages/
- Add package.json (see other packages)
- If it's a TS package, use the base config from the config package for your tsconfig.json (see db package for an example)
- Run pnpm install in root
- Run package:list to check that package is part of workspace
The mobile app is entirely outside of Turborepo's control. Since there's no package.json in the ios/ folder, Turborepo doesn't know the app exists. This is what we want, since Swift apps should be entirely under Xcode's control.
So, to develop the mobile app, only use Xcode and don't worry about Turborepo or build pipelines.
Important: Minimum Xcode 16.3 (Apollo iOS requires Swift 6.1).
Read the README in the apps/ios folder for more info on IOS-specific stuff.