这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: Add Turborepo Fastify template with shared packages and Docker support. #10592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ashutosh7i
Copy link

Description

This PR adds a Turborepo template demonstrating shared Fastify packages for development. Includes a reusable @repo/fastify package with common server configuration and a sample fastify-api app that uses it. Features full TypeScript support, Docker containerization, and Jest testing setup.

Key additions:

  • Shared Fastify package (packages/fastify/) with CORS, Helmet, and logging
  • Sample Fastify example app(apps/fastify-api/)
  • Docker multi-stage builds with Turborepo pruning
  • Comprehensive test suite using Fastify injection testing

Testing Instructions

# Install
npm install

# Start development servers
npm run dev
# Verify: http://localhost:3001/status - express-api
# Verify: http://localhost:3002/status - fastify-api

# Run tests
npm run test

# Test Docker setup
# Create a network, which allows containers to communicate with each other, by using their container name as a hostname
docker network create app_network

# Build prod using new BuildKit engine
$env:COMPOSE_DOCKER_CLI_BUILD=1
$env:DOCKER_BUILDKIT=1
docker-compose -f docker-compose.yml build

# Start prod in detached mode
docker-compose -f docker-compose.yml up -d

# Verify: http://localhost:3001/status - express-api
# Verify: http://localhost:3002/status - fastify-api
# To shutdown all running containers:

# Stop running containers started by docker-compse
 docker-compose -f docker-compose.yml down

@ashutosh7i ashutosh7i requested a review from a team as a code owner June 22, 2025 22:59
@turbo-orchestrator turbo-orchestrator bot added area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage labels Jun 22, 2025
Copy link

vercel bot commented Jun 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 10:59pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 10:59pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 10:59pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 10:59pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 10:59pm

Copy link

vercel bot commented Jun 22, 2025

@ashutosh7i is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@anthonyshew anthonyshew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the PR!

Per our contribution guidelines, can this example be focused to one specific technology? I see Fastify, Docker, and Jest all mentioned.

We already have Docker and Jest examples, so concentrating on Fastify would be great.

@ashutosh7i
Copy link
Author

thanks for the update @anthonyshew,
i will tailor it down to fastify only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants