Zero-API, React, & TypeScript
A monorepo containing:
- Next.js web app
- React Native app with Expo
- A tRPC-API that is inferred straight into the above.
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).
Very rough video recorded in 2 minutes
git clone [email protected]:KATT/zart.git cd zart yarn yarn dev
yarn devin 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.
||Starts Postgres, Expo & Next.js|
||Starts Postgres on port
||Runs the latest Database migrations after updating the Prisma schema|
||Kills the database|
. ├── 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
- Create a Postgres Database
- Set env
DATABASE_URLpointing towards that db
Shoot me a message on Twitter!
- tRPC and this example is made by @alexdotjs
apps/expois basically a copy-paste from