This is a monorepo that is built with PNPM workspaces and Turbo for managing multiple applications and shared packages.
The root directory contains configuration files that govern the entire monorepo:
package.json: Root-level dependencies and scriptspnpm-workspace.yaml: Defines workspace packages (apps and packages directories)turbo.json: Turbo configuration for task orchestration, caching, and pipeline definitions- Root-level commands affect all workspaces unless filtered
Each application in the apps/ directory is a self-contained project:
- Individual
package.json: Application-specific dependencies and scripts - Independent development: Can be run separately from other apps
- Shared code access: Can import from shared packages in the monorepo
- Port configuration: Each app typically runs on its own port
PNPM provides powerful filtering capabilities to target specific workspaces:
# Install dependencies for all workspaces
pnpm install
# Install dependencies for a specific app
pnpm install --filter f3-nation-map
# Install dependencies for multiple specific apps
pnpm install --filter f3-nation-map --filter another-app
# Install dependencies for all apps
pnpm install# Start development server for all apps
pnpm dev
# Start development server for specific app
pnpm dev --filter f3-nation-map
# Start development server with custom turbo flags
pnpm dev --filter f3-nation-map -- --port 3001# Build all workspaces
pnpm build
# Build specific app
pnpm build --filter f3-nation-map# Run tests for specific workspace
pnpm test --filter f3-nation-map
# Run linting for specific workspace
pnpm lint --filter f3-nation-map
The turbo.json file defines the build pipeline and task dependencies for the monorepo. It enables:
- Task pipelines: Define how tasks (dev, build, test, lint) depend on each other
- Caching strategy: Configure what files and outputs should be cached
- Environment variables: Specify which env vars affect task outputs for caching
- Output logging: Control what gets logged during task execution
The monorepo leverages Turbo's caching system:
- Incremental builds: Only rebuild what changed
- Remote caching: Share cache across team members and CI
- Parallel execution: Run tasks concurrently when possible
- Dependency graph: Smart task ordering based on dependencies
-
Clone the repository:
git clone https://github.com/F3-Nation/f3-nation.git && cd f3-nation
-
Install PNPM globally (if not already installed):
npm install -g pnpm
-
Install dependencies:
pnpm install
-
Environment setup:
- Get env.zip from F3 Nation Slack
- Unzip and rename to
.env - Important: Environment variables are application-specific. Place the
.envfile in the appropriate application directory, not the monorepo root - For the map app: place in
apps/map/.env - See F3 Nation Map README for app-specific setup details
- For PaxMiner data admin tooling, see Admin README
-
Start development:
# Start all apps pnpm dev # Start specific app only pnpm dev --filter f3-nation-map
| Application | Directory | Port | Description |
|---|---|---|---|
| F3 Nation Map | apps/map/ |
3000 | Interactive map application for F3 Nation locations and events - README |
| Admin (PaxMiner) | apps/admin/ |
- | PaxMiner MySQL admin scripts for backups, migrations, and seeding - README |
Additional applications will be added to this registry as they are developed
| Package | Directory | Description |
|---|---|---|
| API | packages/api/ |
Backend API routes and ORPC routers |
| Auth | packages/auth/ |
Authentication utilities and configurations |
| DB | packages/db/ |
Database client, schema, and migrations |
| Shared | packages/shared/ |
Common utilities and shared logic |
| UI | packages/ui/ |
Reusable UI components |
| Validators | packages/validators/ |
Data validation schemas |
Environment variables are application-specific in this monorepo. The .env file should be placed in the application directory (e.g., apps/map/) rather than the monorepo root.
- Make changes in the appropriate app or package directory
- Test locally using filter flags to run only what you need
- Lint and test before committing:
pnpm lint --filter <your-workspace> pnpm test --filter <your-workspace>
- Commit changes - Turbo will handle optimal task execution
- Use ADMIN_BASE_DATABASE_URL from doppler if available
- For dev migrations use the
dev_genericuser - For staging migrations use the
dev_genericuser - For production migrations use the
f3slackbotuser