Skip to content

Rock-n-Prog/apollo-monorepo-poc

Repository files navigation

Apollo Monorepo POC

Example monorepo to use Apollo Federation in a Turborepo codebase.

See the docs, for list of features, guides, explanations.

Made with love by Fabien Roy.

Status

Name Type Status
General General General
Web App Build Web App
API Gateway Service Build API Gateway
Contents Service Service Build Contents Service Gateway
Reviews Service Service Build Reviews Service Gateway
Contents Database Package Build Contents Database Package
Reviews Database Package Build Reviews Database Package
Theme Package Build Theme Package
Web UI Package Build Web UI Package
Web Forms Package Build Web Forms Package
Web Locales Package Build Web Locales Package
Web Storage Package Build Web Storage Package

Apps

Services

Packages

Setup

Install dependencies

pnpm install

Prepare pre-commit hook

pnpm prepare

Setup database

# Copy env file
pnpm env:local

# Run databases
docker compose up

# Generate Prisma client
pnpm db:generate

# Apply migrations
pnpm db:migrate:dev

# If wanted, generate example data
pnpm db:seed

Setup web GraphQL types and hooks

Be sure that services and API Gateway are running first!

pnpm web:generate

Available scripts

Run apps

pnpm dev

# Running a single app and its deps
pnpm dev:web
pnpm dev:mobile

Run services / API Gateway

pnpm dev

pnpm dev:services

# Run after services
pnpm dev:api

Run storybook

Web UI Library

Storybook will be running on http://localhost:6006;

pnpm storybook:web

Mobile UI Library

Storybook will be running on Expo Go.

pnpm storybook:mobile

Build all

pnpm build

Lint all

pnpm lint

# To fix lint
pnpm lint:fix

# For file names
pnpm lint:ls

# To only apply to root
pnpm lint:root
pnpm lint:root:fix

# Fix lint on staged files
pnpm lint:staged

Format

pnpm format

# To fix format
pnpm format:fix

Cleanup files

pnpm yeet