### Setting Up and Running the tRPC SSE Project Source: https://github.com/trpc/examples-next-sse-chat This sequence of commands initializes the project by cloning the repository, installing dependencies using pnpm, configuring environment variables, and starting the development server. It's the standard procedure to get the tRPC SSE example running locally. ```Shell git clone git@github.com:trpc/examples-next-sse-chat.git pnpm i cp .env.example .env pnpm dev ``` -------------------------------- ### Install tRPC Packages (deno) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Installs the necessary `@trpc/server` and `@trpc/client` packages using deno. ```Shell deno add npm:@trpc/server npm:@trpc/client ``` -------------------------------- ### Installing and Running Fastify Example in Dev Mode (Shell) Source: https://github.com/trpc/trpc/tree/main/examples/fastify-server This snippet navigates into the Fastify server example directory, installs its dependencies with Yarn, and starts the example in development mode. This assumes the main tRPC project has already been set up. ```Shell cd ./examples/fastify-server yarn yarn dev ``` -------------------------------- ### Install tRPC Packages (bun) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Installs the necessary `@trpc/server` and `@trpc/client` packages using bun. ```Shell bun add @trpc/server @trpc/client ``` -------------------------------- ### Setting up tRPC Next.js SSE Chat Example Source: https://github.com/trpc/examples-next-sse-chat This shell script provides the necessary commands to get the tRPC Next.js SSE chat example running. It involves cloning the repository, installing project dependencies using pnpm, copying the example environment file, and starting the development server. ```Shell git clone git@github.com:trpc/examples-next-sse-chat.git pnpm i cp .env.example .env pnpm dev ``` -------------------------------- ### Initial Project Setup Commands (Shell) Source: https://github.com/t3-oss/create-t3-turbo This snippet provides essential shell commands for setting up the project. It covers installing dependencies using pnpm, configuring environment variables by copying the example file, and pushing the Drizzle schema to the database. ```shell # Install dependencies pnpm i # Configure environment variables # There is an `.env.example` in the root directory you can use for reference cp .env.example .env # Push the Drizzle schema to the database pnpm db:push ``` -------------------------------- ### Initializing tRPC Prisma WebSockets Starter Project Source: https://github.com/trpc/examples-next-prisma-websockets-starter These commands guide the initial setup of the project. First, navigate into the project directory, then install dependencies using pnpm, and finally start the development environment which includes a PostgreSQL database, migrations, seeds, and the Next.js application. ```Shell cd trpc-prisma-websockets-starter pnpm i pnpm dx ``` -------------------------------- ### Install tRPC Packages (npm) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Installs the necessary `@trpc/server` and `@trpc/client` packages using npm. ```Shell npm install @trpc/server @trpc/client ``` -------------------------------- ### Install tRPC Packages (pnpm) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Installs the necessary `@trpc/server` and `@trpc/client` packages using pnpm. ```Shell pnpm add @trpc/server @trpc/client ``` -------------------------------- ### Install tRPC Packages (yarn) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Installs the necessary `@trpc/server` and `@trpc/client` packages using yarn. ```Shell yarn add @trpc/server @trpc/client ``` -------------------------------- ### Initializing tRPC Next.js Prisma TodoMVC Project (Shell) Source: https://github.com/trpc/examples-next-prisma-todomvc These commands guide the user through setting up the TodoMVC project. It involves creating a new Next.js application from a tRPC example, navigating into the project directory, installing dependencies, and starting the development server. ```Shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-todomvc trpc-todo cd trpc-todo pnpm pnpm dev ``` -------------------------------- ### Building and Starting Fastify Example from Fresh Build (Shell) Source: https://github.com/trpc/trpc/tree/main/examples/fastify-server This snippet demonstrates how to build the Fastify server example and then start it from the compiled output. This is an alternative to running it in development mode, useful for production-like environments. ```Shell yarn build yarn start ``` -------------------------------- ### Setting Up the tRPC Next.js Prisma Starter Project Source: https://github.com/trpc/examples-next-prisma-starter These commands guide you through initializing the tRPC Next.js Prisma starter project. It involves creating a new Next.js application from the tRPC example, navigating into the project directory, installing dependencies, and starting the development server. ```Shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter cd trpc-prisma-starter pnpm pnpm dx ``` -------------------------------- ### Running Development Server with pnpm Source: https://github.com/trpc/trpc/tree/main/examples/tanstack-start These commands initialize the project by installing necessary dependencies and then start the development server. `pnpm install` fetches all packages, and `pnpm dev` launches the application in development mode. ```Shell pnpm install pnpm dev ``` -------------------------------- ### Running a Minimal tRPC Development Server (Shell) Source: https://github.com/trpc/trpc/tree/main/examples/minimal These commands install project dependencies and start the development server for the minimal tRPC example. Node.js 18 or higher is required for global fetch support. Users can then modify TypeScript files to observe live type checking. ```Shell npm i npm run dev ``` -------------------------------- ### Building and Starting a Minimal tRPC Application (Shell) Source: https://github.com/trpc/trpc/tree/main/examples/minimal These commands compile the tRPC application for production and then start the built application. This is typically used for deploying the application after development. ```Shell npm run build npm run start ``` -------------------------------- ### Cloning and Building Main tRPC Project (Shell) Source: https://github.com/trpc/trpc/tree/main/examples/fastify-server This snippet provides commands to clone the main tRPC repository, navigate into it, install dependencies using Yarn, and start the development server. It's a prerequisite for running the Fastify example. ```Shell git clone git@github.com:trpc/trpc.git cd ./trpc yarn yarn dev ``` -------------------------------- ### Setting Up tRPC Next.js Prisma Starter Project Source: https://github.com/trpc/examples-next-prisma-starter This sequence of commands initializes a new Next.js project using the tRPC Prisma starter template, navigates into the newly created project directory, installs all necessary dependencies using pnpm, and then starts the development server, including database setup. ```Shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter cd trpc-prisma-starter pnpm pnpm dx ``` -------------------------------- ### Setting Up a New Project with pnpm Source: https://github.com/trpc/examples-next-prisma-starter-websockets This command sequence initializes a new Next.js project using pnpm, cloning a specific tRPC example that integrates Prisma and WebSockets. It then navigates into the newly created project directory, installs all necessary dependencies, and starts the development server for immediate use. ```Shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter cd trpc-prisma-websockets-starter pnpm i pnpm dx ``` -------------------------------- ### Initializing tRPC Backend Helpers (TypeScript) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Initializes the tRPC backend using `initTRPC.create()` and exports reusable `router` and `publicProcedure` helpers for defining API endpoints. This setup is typically done once per backend application. ```TypeScript import { initTRPC } from '@trpc/server'; /** * Initialization of tRPC backend * Should be done only once per backend! */ const t = initTRPC.create(); /** * Export reusable router and procedure helpers * that can be used throughout the router */ export const router = t.router; export const publicProcedure = t.procedure; ``` -------------------------------- ### Setting Up tRPC Next.js Prisma WebSockets Starter Project (pnpm) Source: https://github.com/trpc/examples-next-prisma-websockets-starter This command sequence initializes a new Next.js project using the tRPC, Prisma, and WebSockets example from the tRPC repository. It then navigates into the new project directory, installs dependencies using pnpm, and starts the development server. ```shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter cd trpc-prisma-websockets-starter pnpm i pnpm dx ``` -------------------------------- ### Running a Local Edge Runtime Server Source: https://edge-runtime.vercel.app/getting-started This example illustrates how to expose the Edge Runtime locally via HTTP using runServer. It sets up an initialCode to handle fetch events, extracting a URL from search parameters and fetching it, allowing the runtime to act as a local proxy server. ```JavaScript import { EdgeRuntime, runServer } from 'edge-runtime' import { onExit } from 'signal-exit' const initialCode = ` addEventListener('fetch', event => { const { searchParams } = new URL(event.request.url) const url = searchParams.get('url') return event.respondWith(fetch(url)) })` const edgeRuntime = new EdgeRuntime({ initialCode }) const server = await runServer({ runtime: edgeRuntime, port: 3000 }) console.log(`> Edge server running at ${server.url}`) onExit(() => server.close()) ``` -------------------------------- ### Initializing a tRPC Next.js Prisma Project with pnpm Source: https://github.com/trpc/examples-next-prisma-starter This snippet provides the commands to initialize a new Next.js project using the tRPC Prisma starter template, navigate into the project directory, install dependencies, and start the development environment, including PostgreSQL setup. ```shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter cd trpc-prisma-starter pnpm pnpm dx ``` -------------------------------- ### Initializing a new tRPC Next.js Project with pnpm Source: https://github.com/trpc/examples-next-prisma-websockets-starter This command sequence initializes a new Next.js project using pnpm, specifically cloning the tRPC Next.js Prisma WebSockets starter example. It then navigates into the new directory, installs dependencies, and starts the development environment. ```Shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter cd trpc-prisma-websockets-starter pnpm i pnpm dx ``` -------------------------------- ### Installing Edge Runtime with npm Source: https://edge-runtime.vercel.app/getting-started This command installs the Edge Runtime package using npm, the Node.js package manager. It's the first step to integrate Edge Runtime into your project. ```Shell npm install edge-runtime ``` -------------------------------- ### Complete tRPC Backend Router and Server - TypeScript Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Combines imports for tRPC, Zod, the simulated database, and the tRPC instance. It defines the complete `appRouter` with `userList` (query), `userById` (query with input), and `userCreate` (mutation with input) procedures, exports the router type, and sets up and starts the standalone HTTP server. ```ts import { createHTTPServer } from "@trpc/server/adapters/standalone"; import { z } from "zod"; import { db } from "./db"; import { publicProcedure, router } from "./trpc"; const appRouter = router({ userList: publicProcedure .query(async () => { const users = await db.user.findMany(); return users; }), userById: publicProcedure .input(z.string()) .query(async (opts) => { const { input } = opts; const user = await db.user.findById(input); return user; }), userCreate: publicProcedure .input(z.object({ name: z.string() })) .mutation(async (opts) => { const { input } = opts; const user = await db.user.create(input); return user; }), }); export type AppRouter = typeof appRouter; const server = createHTTPServer({ router: appRouter, }); server.listen(3000); ``` -------------------------------- ### Setting Up tRPC Next.js Prisma WebSockets Project (Shell) Source: https://github.com/trpc/examples-next-prisma-starter-websockets These shell commands outline the initial steps to set up the tRPC Next.js Prisma WebSockets starter project. It involves creating a new Next.js application from the tRPC example, navigating into the newly created project directory, installing all necessary dependencies using pnpm, and finally starting the development environment. ```Shell pnpm create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter cd trpc-prisma-websockets-starter pnpm i pnpm dx ``` -------------------------------- ### Starting tRPC Server with Deno Task Source: https://github.com/trpc/trpc/tree/main/examples/deno-deploy This command initiates the tRPC server using Deno's task runner. It is executed after Deno installation and assumes a `deno.json` file defines the 'server' task. This command starts the backend service, making it ready to accept client connections. ```Shell deno task server ``` -------------------------------- ### Installing Dependencies and Starting tRPC SIWE Monorepo Source: https://github.com/codingwithmanny/trpc-siwe-monorepo This snippet provides the commands to install all project dependencies using pnpm and then start the entire monorepo application in development mode. This initiates both the frontend and backend services, making the application accessible locally. ```Shell pnpm install; pnpm run dev; ``` -------------------------------- ### Manually Starting Expo App for iOS Simulator Source: https://github.com/t3-oss/create-t3-turbo This command starts the Expo development server. When run from `apps/expo`, it allows manual launch of Expo Go on an iOS simulator by pressing 'I' after the server starts, useful for initial setup or after Xcode updates. ```Shell npx expo start ``` -------------------------------- ### Install Deno using Shell (macOS/Linux) Source: https://deno.com/manual/getting_started/installation This command downloads and executes the Deno installation script using `curl`. It's a recommended method for macOS and Linux users for optimal performance, directly installing the Deno binary. ```Shell curl -fsSL https://deno.land/install.sh | sh ``` -------------------------------- ### Installing Dependencies and Starting Application - Shell Source: https://github.com/codingwithmanny/trpc-siwe-monorepo This sequence of shell commands first installs all project dependencies using pnpm, then starts the development server for the entire monorepo. The expected output shows the successful initialization of both the Vite frontend and the Node.js backend, indicating the application is ready for use. ```Shell pnpm install; pnpm run dev; # Expected Output: # [nodemon] 2.0.20 # [nodemon] to restart at any time, enter `rs` # [nodemon] watching path(s): *.* # [nodemon] watching extensions: ts,json # [nodemon] starting `ts-node --files src/server.ts` # VITE v3.2.4 ready in 307 ms # ➜ Local: http://localhost:5173/ # ➜ Network: use --host to expose # Listening on port 5001. ``` -------------------------------- ### Install Deno using Scoop (Windows) Source: https://deno.com/manual/getting_started/installation Installs Deno on Windows using the Scoop command-line installer. Scoop provides a convenient way to install and manage applications on Windows. ```Shell scoop install deno ``` -------------------------------- ### Extending Web APIs in Edge Runtime Source: https://edge-runtime.vercel.app/getting-started This example shows how to extend the default Web APIs available in the Edge Runtime context. It customizes the fetch API to automatically prepend https:// to URLs that don't already have a protocol, demonstrating how to modify or enhance built-in functionalities. ```TypeScript import { EdgeRuntime } from 'edge-runtime' const runtime = new EdgeRuntime({ extend: (context) => { const rawFetch = context.fetch.bind(context.fetch) context.fetch = async (input: RequestInfo | URL, init?: RequestInit) => rawFetch( typeof input === 'string' && !input.startsWith('https://') ? `https://${input}` : String(input), init ) return context }, }) const result = await runtime.evaluate("fetch('example.com')") console.log(result) ``` -------------------------------- ### Serving tRPC API with Standalone Adapter - TypeScript Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/quickstart Imports the `createHTTPServer` function from the tRPC standalone adapter. It creates an HTTP server instance, passing the defined `appRouter`, and starts the server listening on port 3000. ```ts import { createHTTPServer } from '@trpc/server/adapters/standalone'; const appRouter = router({ // ... }); const server = createHTTPServer({ router: appRouter, }); server.listen(3000); ``` -------------------------------- ### Verify Deno Installation Source: https://deno.com/manual/getting_started/installation Checks if Deno is successfully installed by printing its version to the console. A successful output indicates Deno is correctly set up and accessible in the system's PATH. ```Shell deno --version ``` -------------------------------- ### Install Deno using npm (Global) Source: https://deno.com/manual/getting_started/installation Installs Deno globally via npm. While convenient, this method may affect Deno's startup time compared to direct shell script installations. It's suitable for Node.js developers familiar with npm. ```npm npm install -g deno ``` -------------------------------- ### Install Deno using PowerShell (Windows) Source: https://deno.com/manual/getting_started/installation Downloads and executes the Deno installation script using PowerShell's `Invoke-RestMethod` and `Invoke-Expression`. This is the recommended method for Windows users for better performance. ```PowerShell irm https://deno.land/install.ps1 | iex ``` -------------------------------- ### Building and Starting Production Application with pnpm Source: https://github.com/trpc/trpc/tree/main/examples/tanstack-start These commands are used to prepare the application for production. `pnpm build` compiles the project, and `pnpm start` runs the compiled application, typically for deployment. ```Shell pnpm build pnpm start ``` -------------------------------- ### Starting a Single Package for Development Source: https://github.com/skillrecordings/products This command navigates into a specific package directory and starts its development server using PNPM. Replace `{{packagename}}` with the actual name of the package. ```Shell cd packages/{{packagename}} && pnpm dev ``` -------------------------------- ### Installing pnpm and Project Dependencies Source: https://github.com/skillrecordings/products This command first globally installs pnpm using npm, then proceeds to install all project dependencies using pnpm. This ensures that pnpm is available and all necessary packages for the monorepo are installed. ```shell npm i pnpm -g && pnpm i ``` -------------------------------- ### Installing Project Dependencies with PNPM Source: https://github.com/t3-oss/create-t3-turbo This command installs all necessary project dependencies using the PNPM package manager, as defined in the `pnpm-workspace.yaml` and individual `package.json` files across the monorepo. ```Shell pnpm i ``` -------------------------------- ### Starting a Single Application for Development Source: https://github.com/skillrecordings/products This command navigates into a specific application directory and starts its development server using PNPM. Replace `{{appname}}` with the actual name of the application. ```Shell cd apps/{{appname}} && pnpm dev ``` -------------------------------- ### Install Deno using Nix Source: https://deno.com/manual/getting_started/installation Installs Deno using the Nix package manager, providing a reproducible and declarative way to manage software environments. This command enters a shell with Deno available. ```Shell nix-shell -p deno ``` -------------------------------- ### Update Deno to Latest Version Source: https://deno.com/manual/getting_started/installation Updates a previously installed Deno version to the latest stable release. This command fetches the new binary from GitHub and replaces the existing executable. ```Shell deno upgrade ``` -------------------------------- ### Starting Local Development for a Specific Package Source: https://github.com/skillrecordings/products This command navigates into a specific package directory within the monorepo and then starts the development server using pnpm. It's used for focused local development of a single application or library. ```shell cd packages/{{packagename}} && pnpm dev ``` -------------------------------- ### Install tRPC Dependencies (bun) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/server/adapters/fetch Use this command with bun to install the necessary tRPC server and client packages, along with Zod for input validation (optional but used in examples). ```shell bun add @trpc/server @trpc/client zod ``` -------------------------------- ### Testing Local Edge Server with Curl Source: https://edge-runtime.vercel.app/getting-started This curl command demonstrates how to interact with the locally running Edge Runtime server. It sends an HTTP GET request to the server on port 3000, passing a url query parameter that the server's initialCode will process. ```Shell curl http://[::]:3000?url=https://example.vercel.sh ``` -------------------------------- ### Create Next.js tRPC Prisma Starter (deno) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses `deno init --npm next-app` to initialize a new Next.js project based on the tRPC next-prisma-starter example from the tRPC GitHub repository. This command fetches the example and sets up the project directory `trpc-prisma-starter`. ```sh deno init --npm next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter ``` -------------------------------- ### Create Next.js tRPC Prisma Starter (bun) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses `bunx create-next-app` to initialize a new Next.js project based on the tRPC next-prisma-starter example from the tRPC GitHub repository. This command fetches the example and sets up the project directory `trpc-prisma-starter`. ```sh bunx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter ``` -------------------------------- ### Display Deno CLI Help Source: https://deno.com/manual/getting_started/installation Shows the help text for Deno's command-line interface, documenting available flags and usage. This command is useful for understanding Deno's various CLI options. ```Shell deno help ``` -------------------------------- ### Configure Expo Dev Script for Android Emulator (Diff) Source: https://github.com/t3-oss/create-t3-turbo This diff snippet illustrates how to update the 'dev' script in 'apps/expo/package.json' to start the Expo application on an Android emulator. The script is modified to 'expo start --android'. This requires Android Studio tools to be installed. ```diff + "dev": "expo start --android", ``` -------------------------------- ### Starting Full Development Environment (Postgres, Migrations, Seed, Next.js) Source: https://github.com/trpc/examples-next-prisma-websockets-starter This comprehensive command sets up the entire development environment. It starts the PostgreSQL database, runs any pending migrations, seeds the database with initial data, and then starts the Next.js application. ```Shell pnpm dx # starts postgres db + runs migrations + seeds + starts next.js ``` -------------------------------- ### Create Next.js tRPC Prisma Starter (npm) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses `npx create-next-app` to initialize a new Next.js project based on the tRPC next-prisma-starter example from the tRPC GitHub repository. This command fetches the example and sets up the project directory `trpc-prisma-starter`. ```bash npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter ``` -------------------------------- ### Installing Expo Updates and Configuring EAS Update in Shell Source: https://github.com/t3-oss/create-t3-turbo These shell commands add the `expo-updates` library to the Expo application using pnpm and then configure EAS Update for the project. This setup enables over-the-air (OTA) updates for the app. ```Shell cd apps/expo pnpm expo install expo-updates eas update:configure ``` -------------------------------- ### Install Deno using Chocolatey (Windows) Source: https://deno.com/manual/getting_started/installation Installs Deno on Windows using the Chocolatey package manager. Chocolatey simplifies software installation and management on Windows systems. ```Shell choco install deno ``` -------------------------------- ### Initial Project Setup - Shell Source: https://github.com/trpc/examples-next-prisma-starter-websockets These shell commands are used to set up the tRPC Next.js Prisma WebSockets starter project. They include navigating into the project directory, installing necessary dependencies, and initiating the development environment. ```Shell s/next-prisma-websockets-starter trpc-prisma-websockets-starter cd trpc-prisma-websockets-starter pnpm i pnpm dx ``` -------------------------------- ### Install Deno using MacPorts (macOS) Source: https://deno.com/manual/getting_started/installation Installs Deno on macOS using the MacPorts package manager. This command requires superuser privileges to install the Deno port. ```Shell sudo port install deno ``` -------------------------------- ### Create Next.js tRPC Prisma Starter (pnpm) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses `pnpx create-next-app` to initialize a new Next.js project based on the tRPC next-prisma-starter example from the tRPC GitHub repository. This command fetches the example and sets up the project directory `trpc-prisma-starter`. ```sh pnpx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter ``` -------------------------------- ### Install Deno using Winget (Windows) Source: https://deno.com/manual/getting_started/installation Installs Deno on Windows using the Winget package manager. Winget is Microsoft's official package manager for Windows, offering a centralized way to install applications. ```Shell winget install DenoLand.Deno ``` -------------------------------- ### Configuring Environment Variables Source: https://github.com/t3-oss/create-t3-turbo This command copies the example environment variables file (`.env.example`) to create the active `.env` file. Users should then populate this file with their specific environment configurations. ```Shell cp .env.example .env ``` -------------------------------- ### Configure Expo Dev Script for iOS Simulator (Diff) Source: https://github.com/t3-oss/create-t3-turbo This diff snippet shows how to modify the 'dev' script in 'apps/expo/package.json' to launch the Expo application on an iOS simulator. It changes the script to 'expo start --ios'. This requires Xcode and XCommand Line Tools to be installed. ```diff + "dev": "expo start --ios", ``` -------------------------------- ### Install Deno using Homebrew (macOS) Source: https://deno.com/manual/getting_started/installation Installs Deno on macOS using the Homebrew package manager. This is a common and convenient method for macOS users to manage software packages. ```Shell brew install deno ``` -------------------------------- ### Initializing Project with Turbo CLI Source: https://github.com/t3-oss/create-t3-turbo This command initializes a new project using the `create-turbo` CLI, leveraging the `create-t3-turbo` starter repository as a template. It sets up the monorepo structure with PNPM as the package manager. ```Shell npx create-turbo@latest -e https://github.com/t3-oss/create-t3-turbo ``` -------------------------------- ### Create Next.js tRPC WebSocket Starter with deno Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses deno init with the --npm flag to create a new Next.js project named 'trpc-prisma-websockets-starter' based on the tRPC WebSocket starter example from the tRPC repository. ```sh deno init --npm create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter ``` -------------------------------- ### Add Deno Plugin to vfox Source: https://deno.com/manual/getting_started/installation Adds the Deno plugin to the vfox version manager, allowing vfox to manage Deno installations. This is a prerequisite for installing Deno versions via vfox. ```Shell vfox add deno ``` -------------------------------- ### Create Next.js tRPC Prisma Starter (yarn) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses `yarn create next-app` to initialize a new Next.js project based on the tRPC next-prisma-starter example from the tRPC GitHub repository. This command fetches the example and sets up the project directory `trpc-prisma-starter`. ```sh yarn create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter ``` -------------------------------- ### Installing subShape in Node.js Source: https://github.com/paritytech/scale-ts This command shows how to install the subShape library as a dependency in a Node.js project using npm. ```Shell npm install subshape ``` -------------------------------- ### Development and Testing Commands - Shell Source: https://github.com/trpc/examples-next-prisma-starter-websockets This section provides a comprehensive list of `pnpm` commands for various development and testing tasks, including building the application, managing the database, starting servers, and running unit and end-to-end tests. ```Shell pnpm build # runs `prisma generate` + `prisma migrate` + `next build` pnpm db-nuke # resets local db pnpm dev # starts next.js + WebSocket server pnpm dx # starts postgres db + runs migrations + seeds + starts next.js pnpm test-dev # runs e2e tests on dev pnpm test-start # runs e2e tests on `next start` - build required before pnpm test:unit # runs normal Vitest unit tests pnpm test:e2e # runs e2e tests ``` -------------------------------- ### Create Next.js tRPC WebSocket Starter with npm Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses npx to create a new Next.js project named 'trpc-prisma-websockets-starter' based on the tRPC WebSocket starter example from the tRPC repository. ```bash npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter ``` -------------------------------- ### Install Latest Deno with vfox Source: https://deno.com/manual/getting_started/installation Downloads and installs the latest stable version of Deno using the vfox version manager. This command makes the latest Deno available for use within vfox. ```Shell vfox install deno@latest ``` -------------------------------- ### Managing tRPC Prisma WebSockets Project with pnpm Source: https://github.com/trpc/examples-next-prisma-websockets-starter This set of pnpm commands provides various utilities for building, database management, development, and testing. It covers common operations like building the application, resetting the database, starting development servers, and running different types of tests (unit and end-to-end). ```Shell pnpm build # runs \`prisma generate\` + \`prisma migrate\` + \`next build\` pnpm db-nuke # resets local db pnpm dev # starts next.js + WebSocket server pnpm dx # starts postgres db + runs migrations + seeds + starts next.js pnpm test-dev # runs e2e tests on dev pnpm test-start # runs e2e tests on \`next start\` - build required before pnpm test:unit # runs normal Vitest unit tests pnpm test:e2e # runs e2e tests ``` -------------------------------- ### Install Latest Deno with asdf Source: https://deno.com/manual/getting_started/installation Downloads and installs the latest stable version of Deno using the asdf version manager. This command makes the latest Deno available for use within asdf. ```Shell asdf install deno latest ``` -------------------------------- ### Create Next.js tRPC WebSocket Starter with bun Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/example-apps Uses bunx to create a new Next.js project named 'trpc-prisma-websockets-starter' based on the tRPC WebSocket starter example from the tRPC repository. ```sh bunx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-websockets-starter trpc-prisma-websockets-starter ``` -------------------------------- ### Initializing SSR Match for Docs Query in JavaScript Source: https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr This snippet handles the hydration of data for the `/query/latest/docs` route. It includes a large JSON payload representing documentation configuration, categorized by 'Getting Started' and 'Guides & Concepts' with various framework-specific sub-sections (react, solid, vue, svelte, angular). ```JavaScript if (typeof __TSR_SSR__ !== 'undefined') __TSR_SSR__.cleanScripts()__TSR_SSR__.initMatch({"id":"/query/latest/docs","__beforeLoadContext":"{}","loaderData":"{\"config\":{\"sections\":[{\"label\":\"Getting Started\",\"children\":[],\"frameworks\":[{\"label\":\"react\",\"children\":[{\"label\":\"Overview\",\"to\":\"framework/react/overview\"},{\"label\":\"Installation\",\"to\":\"framework/react/installation\"},{\"label\":\"Quick Start\",\"to\":\"framework/react/quick-start\"},{\"label\":\"Devtools\",\"to\":\"framework/react/devtools\"},{\"label\":\"Videos & Talks\",\"to\":\"framework/react/videos\"},{\"label\":\"Comparison\",\"to\":\"framework/react/comparison\"},{\"label\":\"TypeScript\",\"to\":\"framework/react/typescript\"},{\"label\":\"GraphQL\",\"to\":\"framework/react/graphql\"},{\"label\":\"React Native\",\"to\":\"framework/react/react-native\"}]},{\"label\":\"solid\",\"children\":[{\"label\":\"Overview\",\"to\":\"framework/solid/overview\"},{\"label\":\"Quick Start\",\"to\":\"framework/solid/quick-start\"},{\"label\":\"Installation\",\"to\":\"framework/solid/installation\"},{\"label\":\"Devtools\",\"to\":\"framework/solid/devtools\"},{\"label\":\"TypeScript\",\"to\":\"framework/solid/typescript\"}]},{\"label\":\"vue\",\"children\":[{\"label\":\"Overview\",\"to\":\"framework/vue/overview\"},{\"label\":\"Installation\",\"to\":\"framework/vue/installation\"},{\"label\":\"Quick Start\",\"to\":\"framework/vue/quick-start\"},{\"label\":\"Devtools\",\"to\":\"framework/vue/devtools\"},{\"label\":\"TypeScript\",\"to\":\"framework/vue/typescript\"},{\"label\":\"Reactivity\",\"to\":\"framework/vue/reactivity\"},{\"label\":\"GraphQL\",\"to\":\"framework/vue/graphql\"}]},{\"label\":\"svelte\",\"children\":[{\"label\":\"Overview\",\"to\":\"framework/svelte/overview\"},{\"label\":\"Installation\",\"to\":\"framework/svelte/installation\"},{\"label\":\"Devtools\",\"to\":\"framework/svelte/devtools\"},{\"label\":\"SSR & SvelteKit\",\"to\":\"framework/svelte/ssr\"},{\"label\":\"Reactivity\",\"to\":\"framework/svelte/reactivity\"}]},{\"label\":\"angular\",\"children\":[{\"label\":\"Overview\",\"to\":\"framework/angular/overview\"},{\"label\":\"Installation\",\"to\":\"framework/angular/installation\"},{\"label\":\"Quick Start\",\"to\":\"framework/angular/quick-start\"},{\"label\":\"Angular HttpClient and other data fetching clients\",\"to\":\"framework/angular/angular-httpclient-and-other-data-fetching-clients\"},{\"label\":\"Devtools\",\"to\":\"framework/angular/devtools\"},{\"label\":\"TypeScript\",\"to\":\"framework/angular/typescript\"},{\"label\":\"Zoneless\",\"to\":\"framework/angular/zoneless\"}]}]},{\"label\":\"Guides & Concepts\",\"children\":[],\"frameworks\":[{\"label\":\"react\",\"children\":[{\"label\":\"Important Defaults\",\"to\":\"framework/react/guides/important-defaults\"},{\"label\":\"Queries\",\"to\":\"framework/react/guides/queries\"},{\"label\":\"Query Keys\",\"to\":\"framework/react/guides/query-keys\"},{\"label\":\"Query Functions\",\"to\":\"framework/react/guides/query-functions\"},{\"label\":\"Query Options\",\"to\":\"framework/react/guides/query-options\"},{\"label\":\"Network Mode\",\"to\":\"framework/react/guides/network-mode\"},{\"label\":\"Parallel Queries\",\"to\":\"framework/react/guides/parallel-queries\"},{\"label\":\"Dependent Queries\",\"to\":\"framework/react/guides/dependent-queries\"},{\"label\":\"Background Fetching Indicators\",\"to\":\"framework/react/guides/background-fetching-indicators\"},{\"label\":\"Window Focus Refetching\",\"to\":\"framework/react/guides/window-focus-refetching\"},{\"label\":\"Disabling/Pausing Queries\",\"to\":\"framework/react/guides/disabling-queries\"},{\"label\":\"Query Retries\",\"to\":\"framework/react/guides/query-retries\"},{\"label\":\"Paginated Queries\",\"to\":\"framework/react/guides/paginated-queries\"},{\"label\":\"Infinite Queries\",\"to\":\"framework/react/guides/infinite-queries\"},{\"label\":\"Initial Query Data\",\"to\":\"framework/react/guides/initial-query-data\"},{\"label\":\"Placeholder Query Data\",\"to\":\"framework/react/guides/placeholder-query-data\"},{\"label\":\"Mutations\",\"to\":\"framework/react/guides/mutations\"},{\"label\":\"Query Invalidation\",\"to\":\"framework/react/guides/query-invalidation\"},{\"label\":\"Invalidation from Mutations\",\"to\":\"framework/react/guides/invalidations-from-mutations\"},{\"label\":\"Updates from Mutation Responses\",\"to\":\"framework/react/guides/updates-from-mutation-responses\"},{\"label\":\"Optimistic Updates\",\"to\":\"framework/react/guides/optimistic-updates\"},{\"label\":\"Query Cancellation\",\"to\":\"framework/react/guides/query-cancellation\"},{\"label\":\"Scroll Restoration\",\"to\":\"framework/react/guides/scroll-restoration\"},{\"label\":\"Filters\",\"to\":\"framework/react/guides/filters\"},{\"label\":\"Performance & Request Waterfalls\",\"to\":\"framework/react/guides/request-waterfalls\"},{\"label\":\"Prefetching & Router Integration\",\"to\":\"framework/react/guides/prefetching\"},{\"label\":\"Server Rendering & Hydration\",\"to\":\"framework/react/guides/ssr\"},{\"label\":\"Advanced Server Rendering\",\"to\":\"framework/react/guides/advanced-ssr\"},{\"label\":\"Caching\",\"to\":\"framework/react/guides/caching\"},{\"label\":\"Render Optimizations\",\"to\":\"framework/react/guides/render-optimizations\"},{\"label\":\"Default Query Fn\",\"to\":\"framework/react/guides/default-query-function\"},{\"label\":\"Suspense\",\"to\":\"framework/react/guides/suspense\"},{\"label\":\"Testing\",\"to\":\"framework/react/guides/testing\"},{\"label\":\"Does this replace [Redux, MobX, etc]?\",\"to\":\"framework/react/guides/does-this-replace-client-state\"},{\"label\":\"Migrating to v3\",\"to\":\"framework/react/guides/migrating-to-react-query-3\"},{\"label\":\"Migrating to v4\",\"to\":\"framework/react/guides/migrating-to-react-query-4\"},{\"label\":\"Migrating to v5\",\"to\":\"framework/react/guides/migrating-to-v5\"}]},{\"label\":\"solid\",\"children\":[{\"label\":\"Important Defaults\",\"to\":\"framework/solid/guides/important-defaults\"},{\"label\":\"Queries\",\"to\":\"framework/solid/guides/queries\"},{\"label\":\"Query Keys\",\"to\":\"framework/solid/guides/query-keys\"},{\"label\":\"Query Functions\",\"to\":\"framework/solid/guides/query-functions\"},{\"label\":\"Query Options\",\"to\":\"framework/solid/guides/query-options\"},{\"label\":\"Network Mode\",\"to\":\"framework/solid/guides/network-mode\"},{\"label\":\"Parallel Queries\",\"to\":\"framework/solid/guides/parallel-queries\"},{\"label\":\"Dependent Queries\",\"to\":\"framework/solid/guides/dependent-queries\"},{\"label\":\"Background Fetching Indicators\",\"to\":\"framework/solid/guides/background-fetching-indicators\"},{\"label\":\"Window Focus Refetching\",\"to\":\"framework/solid/guides/window-focus-refetching\"},{\"label\":\"Disabling/Pausing Queries\",\"to\":\"framework/solid/guides/disabling-queries\"},{\"label\":\"Query Retries\",\"to\":\"framework/solid/guides/query-retries\"},{\"label\":\"Paginated Queries\",\"to\":\"framework/solid/guides/paginated-queries\"},{\"label\":\"Infinite Queries\",\"to\":\"framework/solid/guides/infinite-queries\"},{\"label\":\"Initial Query Data\",\"to\":\"framework/solid/guides/initial-query-data\"},{\"label\":\"Placeholder Query Data\",\"to\":\"framework/solid/guides/placeholder-query-data\"},{\"label\":\"Mutations\",\"to\ ``` -------------------------------- ### Setting Up a Connect HTTP Server with Middleware Source: https://github.com/senchalabs/connect This example illustrates how to initialize a Connect application and integrate essential middleware. It includes middleware for GZIP/deflate compression, cookie-based session state management, and parsing URL-encoded request bodies. Finally, it defines a simple response handler and starts the HTTP server on port 3000. ```JavaScript var connect = require('connect'); var http = require('http'); var app = connect(); // gzip/deflate outgoing responses var compression = require('compression'); app.use(compression()); // store session state in browser cookie var cookieSession = require('cookie-session'); app.use(cookieSession({ keys: ['secret1', 'secret2'] })); // parse urlencoded request bodies into req.body var bodyParser = require('body-parser'); app.use(bodyParser.urlencoded({extended: false})); // respond to all requests app.use(function(req, res){ res.end('Hello from Connect!\n'); }); //create node.js http server and listen on port http.createServer(app).listen(3000); ``` -------------------------------- ### Starting a Specific Application in Development Mode Source: https://github.com/skillrecordings/products This command allows you to navigate into a specific application's directory and then start its development server using `pnpm dev`. Replace `{{appname}}` with the actual name of the application you intend to work on. This is used for local development and testing of individual applications. ```Shell cd apps/{{appname}} && pnpm dev ``` -------------------------------- ### Installing All Monorepo Dependencies with PNPM Source: https://github.com/skillrecordings/products This command installs all dependencies for all applications and packages within the monorepo. It leverages PNPM's efficient dependency management to optimize installation time and disk space. ```Shell pnpm install ``` -------------------------------- ### Handling Fetch Events in Edge Runtime Source: https://edge-runtime.vercel.app/getting-started This snippet demonstrates how to load initial code into the Edge Runtime to handle fetch events. It sets up an event listener that responds to incoming requests by fetching the requested URL, showcasing how to simulate a serverless function's behavior and process HTTP requests. ```JavaScript import { EdgeRuntime } from 'edge-runtime' const initialCode = ` addEventListener('fetch', event => { return event.respondWith(fetch(event.request.url)) })` const edgeRuntime = new EdgeRuntime({ initialCode }) const response = await edgeRuntime.dispatchFetch('https://example.vercel.sh') // If your code logic performs asynchronous tasks, you should await them. // https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent/waitUntil await response.waitUntil() console.log(await response.text()) ``` -------------------------------- ### Installing tRPC Transformers (Bash) Source: https://www-git-ahmed-llms-txt-trpc.vercel.app/docs/server/data-transformers Provides the command to install the `superjson` and `devalue` packages using Yarn, which are used as data transformers in the tRPC setup. ```Bash yarn add superjson devalue ``` -------------------------------- ### Vercel Install Command for Monorepos Source: https://github.com/skillrecordings/products This command sequence is used by Vercel for monorepo deployments. It first installs PNPM globally, then runs `pnpm i` to install all project dependencies, ensuring the build environment is correctly set up. ```Shell npm i pnpm -g && pnpm i ```