Skip to content

Commit

Permalink
docs: update playgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
unnoq committed Nov 19, 2024
1 parent f8abece commit a10e203
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 23 deletions.
39 changes: 35 additions & 4 deletions apps/content/content/docs/playground.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,41 @@
---
title: Playground
description: The playground for oRPC
description: Interactive development environments for exploring and testing oRPC functionality.
icon: Code
---

The oRPC Playground is an interactive environment for testing and experimenting with oRPC without local setup.
Try it out on [StackBlitz](https://stackblitz.com/~/github/unnoq/orpc-playground).
Explore oRPC implementations through our interactive playgrounds,
featuring pre-configured examples accessible instantly via StackBlitz or local setup.

<iframe src="https://stackblitz.com/~/github.com/unnoq/orpc-playground?embed=1" className="w-full"></iframe>
## Available Playgrounds

| Environment | StackBlitz | GitHub Source |
|------------|------------|---------------|
| Next.js Playground | [Open in StackBlitz](https://stackblitz.com/github/unnoq/orpc/tree/main/playgrounds/nextjs?file=src%2Frouter%2Findex.ts) | [View Source](https://github.com/unnoq/orpc/tree/main/playgrounds/nextjs/src/router/index.ts) |
| OpenAPI Playground | [Open in StackBlitz](https://stackblitz.com/github/unnoq/orpc/tree/main/playgrounds/openapi?file=src%2Frouter%2Findex.ts) | [View Source](https://github.com/unnoq/orpc/tree/main/playgrounds/openapi/src/router/index.ts) |
| OpenAPI with Contract Playground | [Open in StackBlitz](https://stackblitz.com/github/unnoq/orpc/tree/main/playgrounds/contract-openapi?file=src%2Frouter%2Findex.ts) | [View Source](https://github.com/unnoq/orpc/tree/main/playgrounds/contract-openapi/src/router/index.ts) |
| Express.js Playground | [Open in StackBlitz](https://stackblitz.com/github/unnoq/orpc/tree/main/playgrounds/expressjs?file=src%2Frouter%2Findex.ts) | [View Source](https://github.com/unnoq/orpc/tree/main/playgrounds/expressjs/src/router/index.ts) |

## Local Development

If you prefer working locally, you can clone any playground using the following commands:

```bash
# Clone specific playground environments
npx copy-github-directory https://github.com/unnoq/orpc/tree/main/playgrounds/nextjs orpc-nextjs-playground
npx copy-github-directory https://github.com/unnoq/orpc/tree/main/playgrounds/openapi orpc-openapi-playground
npx copy-github-directory https://github.com/unnoq/orpc/tree/main/playgrounds/contract-openapi orpc-contract-openapi-playground
npx copy-github-directory https://github.com/unnoq/orpc/tree/main/playgrounds/expressjs orpc-expressjs-playground
```

For each project, set up the development environment:

```bash
# Install dependencies
npm install

# Start the development server
npm run dev
```

That's it! You can now access the playground at `http://localhost:2026`.
6 changes: 3 additions & 3 deletions playgrounds/contract-openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "orpc-openapi-playground",
"name": "orpc-contract-openapi-playground",
"version": "0.0.0",
"description": "oRPC OpenAPI Playground",
"description": "oRPC Contract OpenAPI Playground",
"type": "module",
"scripts": {
"dev": "tsx --watch src/main.ts",
"start": "tsx src/main.ts"
},
"keywords": ["orpc", "openapi", "playground", "unnoq"],
"keywords": ["orpc", "contract", "openapi", "playground", "unnoq"],
"author": "",
"license": "ISC",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/contract-openapi/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"isolatedModules": true,
"skipLibCheck": true
}
}
}
11 changes: 3 additions & 8 deletions playgrounds/expressjs/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"name": "orpc-openapi-playground",
"name": "orpc-expresjs-playground",
"version": "0.0.0",
"description": "oRPC OpenAPI Playground",
"description": "oRPC ExpressJS Playground",
"type": "module",
"scripts": {
"dev": "tsx --watch src/main.ts",
"start": "tsx src/main.ts"
},
"keywords": [
"orpc",
"openapi",
"playground",
"unnoq"
],
"keywords": ["orpc", "expressjs", "playground", "unnoq"],
"author": "",
"license": "ISC",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/expressjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"isolatedModules": true,
"skipLibCheck": true
}
}
}
6 changes: 3 additions & 3 deletions playgrounds/nextjs/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextConfig } from "next";
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
/* config options here */
};
}

export default nextConfig;
export default nextConfig
6 changes: 4 additions & 2 deletions playgrounds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "orpc-nextjs-playground",
"version": "0.1.0",
"description": "oRPC NextJS Playground",
"private": true,
"keywords": ["orpc", "nextjs", "playground", "unnoq"],
"scripts": {
"dev": "next dev",
"dev": "next dev --port 2026",
"build": "next build",
"start": "next start",
"start": "next start --port 2026",
"lint": "next lint"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/openapi/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"isolatedModules": true,
"skipLibCheck": true
}
}
}

0 comments on commit a10e203

Please sign in to comment.