Code Monkey home page Code Monkey logo

expo-next-monorepo-example's Introduction

Expo + Next.js Monorepo Example

Here is an example showing how to create a universal React app using Expo and Next.js in a monorepo.

You'll find included:

  • Expo SDK 43 (with Hermes on iOS and Android)
  • Next.js 12
  • React Native for Web
  • TypeScript
  • Babel config that works for Expo and Next.js with Reanimated in a monorepo
  • Reanimated
  • React Native Bottom Sheet
  • Dripsy

And ready-to-use (small configuration required):

  • Expo Application Services
  • Custom Development Client
  • Sentry

Architecture

App

Code shared between iOS, Android and Web

cd packages/app

Expo

Native

Expo entrypoint: packages/expo/App.tsx

cd packages/expo

yarn start:expo to start iOS and Android app with Expo

Demo: https://expo.dev/@poolpoolpool/example?release-channel=production

Pro tip: build and launch a custom development client with SCHEME=com.example.axel yarn run:ios -d (replace axel with your first name)

Next.js

Web

Next.js entrypoint: packages/next/src/pages/_app.tsx

cd packages/next

yarn dev to start web app

Demo: https://expo-next-monorepo-example.vercel.app

Notes

Root

  • Don't add any package here

App

  • Don't add any package here

Expo

  • Add all your React Native and universal packages here
  • Publish to Expo with yarn publish:production

Next.js

  • Add your web-only packages here
  • Deploy to Vercel with yarn deploy -- if it fails, make sure to configure your project correctly: go to your project settings on Vercel and set the "Framework Preset" to Next.js and the "Root Directory" to packages/next

Navigation

Here is an example of how to handle navigation: axeldelafosse#1

What should I do next?

Here are some ideas to get you started:

  • Use React Navigation
  • Style your app with Dripsy
  • Animate your app with Moti
  • Do some requests with SWR or Apollo Client
  • Build cool things with Expo Modules
  • Create a custom development client
  • Add Sentry
  • Add CI/CD with EAS via GitHub Actions
  • ...

Related monorepo example

I also recommend to check out this example from Cedric: https://github.com/byCedric/eas-monorepo-example. It includes some EAS GitHub Actions and a bare workflow (ejected) example.

License

MIT

expo-next-monorepo-example's People

Contributors

axeldelafosse avatar

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.