Giter Site home page Giter Site logo

trpc / zart Goto Github PK

View Code? Open in Web Editor NEW
700.0 10.0 36.0 476 KB

๐Ÿคฏ zART-stack โ€” Zero-API, React [Native], & TypeScript

Home Page: https://twitter.com/alexdotjs

Shell 4.44% JavaScript 14.63% TypeScript 80.93%
react expo trpc ios android

zart's Introduction

โ„น๏ธโ„น๏ธโ„น๏ธ This example project is not actively maintained and is using an old version (v9) of tRPC โ„น๏ธโ„น๏ธโ„น๏ธ

If you're looking for alternatives, have a look at https://github.com/t3-oss/create-t3-turbo and other reference projects on https://trpc.io/docs/awesome-trpc


zART-Stack ๐Ÿคฏ

Zero-API, React, & TypeScript

โšก๏ธ Probably the fastest way to build a React Native app with your own backend โšก๏ธ

Introduction

A monorepo containing:

  • Next.js web app
  • React Native app with Expo
  • A tRPC-API which is inferred straight into the above.
  • Prisma as a typesafe ORM

In tRPC you simply write API-functions that are automatically inferred straight into your frontend - no matter if it's React, React Native, or something else (that is TS/JS-based).

Video

Very rough video recorded in 2 minutes ๐Ÿ˜…

ZART

Requirements

You will need docker compose to run the postgres database. It comes with the Docker Desktop App

Getting started

git clone [email protected]:KATT/zart.git
cd zart
yarn
yarn dev

Press i after yarn dev in to launch the iOS Simulator.

Now - head over to one of the ./apps, whilist updating a router in tRPC or the Database Schema and see that the data is directly inferred.

Available commands

Command Description
yarn dev Starts Postgres, Expo & Next.js
yarn db-up Starts Postgres on port 5466
yarn db-migrate-dev Runs the latest Database migrations after updating the Prisma schema
yarn db-nuke Stops and deletes the the database

Folder structure

.
โ”œโ”€โ”€ apps
โ”‚   โ”œโ”€โ”€ expo    # Expo/RN application
โ”‚   โ””โ”€โ”€ nextjs  # Server-side rendered Next.js application
โ”œโ”€โ”€ packages
โ”‚   โ”œโ”€โ”€ api           # tRPC API 
โ”‚   โ”œโ”€โ”€ react         # Shared React-helpers
โ”‚   โ””โ”€โ”€ react-native  # RN components. **Could** be shared between Expo & Next.js if you're in to that sort of thing.
โ””โ”€โ”€ prisma      # Prisma setup

Further reading

Deployment

Vercel

  • Create a Postgres Database
  • Set env DATABASE_URL pointing towards that db
  • Configure "Root Directory" as apps/nextjs and tick Include source files outside of the Root Directory in the Build Step.

Questions?

Shoot me a message on Twitter!

Credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.