https://github.com/speakeasy-api/speakeasy-trpc-example
https://github.com/speakeasy-api/speakeasy-trpc-example
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/speakeasy-api/speakeasy-trpc-example
- Owner: speakeasy-api
- License: apache-2.0
- Created: 2024-04-03T21:04:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-03T21:11:32.000Z (over 1 year ago)
- Last Synced: 2025-03-15T23:56:01.755Z (9 months ago)
- Language: TypeScript
- Size: 131 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This example tRPC app demonstrates Speakeasy-recommended practices for generating clear OpenAPI specifications and SDKs.
## Prerequisites
You need to have [Node.js](https://nodejs.org/) installed on your system to run this project.
To generate an SDK, you'll also need the Speakeasy CLI installed, or use the Speakeasy dashboard.
## Installation
To install the application on your local machine:
1. Clone the repository:
```bash
git clone https://github.com/speakeasy-api/speakeasy-trpc-example.git
```
2. Navigate into the directory:
```bash
cd speakeasy-trpc-example
```
3. Install all dependencies for the application using Yarn:
```bash
npm install
```
4. [Install Speakeasy CLI](https://github.com/speakeasy-api/speakeasy#installation):
```bash
brew install speakeasy-api/homebrew-tap/speakeasy
```
## Running the application
### Working with the OpenAPI specification
To generate an OpenAPI spec in YAML format, run:
```bash
npm run generate-openapi
```
Additionally, you can generate both the specification file and a TypeScript SDK for your API using:
```bash
npm run generate-openapi-and-sdk
```
## License
This project is licensed under the terms of the Apache 2.0 license.