JtotheDoubleO / trpc-resto-api

⚒️ Minimal tRPC API boilerplate for separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

Home Page:https://trpc-resto-api.onrender.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tRPC API Boilerplate Heisenberg

[![CI][ci-badge]][ci-url]

Minimal tRPC API boilerplate for separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

Monorepos are great, but sometimes we are targeting backend and frontend as separate (mono)repositories.

We might aim for backend and frontend repositories separation of:

  • domain/business logic - expose only what need to be exposed through API.
  • developers - larger teams/companies.
  • CI/CD pipelines, PRs, issues, etc.

... in that case checkout this boilerplate.

Running locally

Easily set up a local development environment

  • clone repo
  • npm install
  • npm run dev
  • make changes to tRPC API & push - new package is released 📦 [![npm version][npm-badge]][npm-url]

Use repository to share types by running npm run trpc-api-export and push code changes.
In your frontend app consume types by running npm run trpc-api-import.

Database Setup

Before this step, copy the env.example file content into .env file and make changes to these environment variables Set up Docker container for PostgresSQL database and PgAdmin for monitoring database

npm run ecosystem:up

Database migrating and seeding

Run these command to generate database, migrate schema and seed mock data

npm run db:generate
npm run db:migrate
npm run db:seed

About

⚒️ Minimal tRPC API boilerplate for separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

https://trpc-resto-api.onrender.com/

License:MIT License


Languages

Language:TypeScript 91.5%Language:JavaScript 8.5%