Git Product home page Git Product logo

project-yoota's Introduction

Disclaimer

Full stack pet project built with "the preferred stack" (at the time of writing), featuring:

๐ŸŒย  Next.js
๐Ÿ“ฑย  React Native
๐Ÿ”—ย  tRPC
๐Ÿ˜ย  Prisma (PostgreSQL)

Deployed at Vercel ๐Ÿš€

Table of Contents

Getting Started

Install Node dependencies

NextAuth requires Node 16 ATM. So use Node 16 or install dependencies using the --ignore-engines flag for now.

yarn install --ignore-engines

The above command should be executed in the root of the monorepo.

You may also run multiple versions of Node using homebrew.

Build packages

Build the project by running the following command in the root of the monorepo.

yarn build

The above command will run the local build command for all apps and packages.

Note that changes to packages will require a rebuild. This may also be performed from within the specific package folder, e.g.:

cd packages/db
yarn build

Install Docker

Docker is used to spin up a local Postgres database. Make sure Docker is installed and up and running.

Launch the backend

Make sure the local Postgres database is up and running by executing the following command.

yarn db:start

The above command will take longer the first time, as Docker needs to fetch the Postgres image.

If this is the first time starting the database, you also wanna run any migrations after the database has launched.

yarn db:migrate:dev

This will create the needed tables by running the migrations contained in the db package. It will also seed the database with any relevant test data.

Finally start the web app (containing the API) by running.

yarn dev

Running on device

Besides running the simulator against http://localhost:3000, you may also run the app on a physical device against your local backend. This may require additional configuration.

Add the following entry to the NSAppTransportSecurity dictionary defined in Info.plist, where 192.168.68.115 is your local IP:

<key>NSAppTransportSecurity</key>
<dict>
	<key>NSExceptionDomains</key>
	<dict>
		<key>localhost</key>
		<dict>
			<key>NSExceptionAllowsInsecureHTTPLoads</key>
			<true/>
		</dict>
		<key>192.168.68.115</key>
		<dict>
			<key>NSExceptionAllowsInsecureHTTPLoads</key>
			<true/>
		</dict>
	</dict>
</dict>

Instruct the app to use your local IP as it's BASE_URL in ./apps/mobile/.env:

BASE_URL=http://192.168.68.115:3000

Finally, make sure that the NEXTAUTH_URL_INTERNAL environment variable is set to the same base URL, for the process running the backend. This can be done by starting the backend using the following command:

NEXTAUTH_URL_INTERNAL=http://192.168.68.115:3000 yarn dev

Make sure to perform a clean build of the mobile app for the changes to take effect.

Staging

The staging database (currently hosted at Supabase), can be used by running the following command.

yarn staging

It requires a .env.staging file at the root of the monorepo - this file should not be known by git.

YOOTA_DATABASE_URL="postgresql://postgres:**********@db.nilmyfbphfwperdpedfv.supabase.co:5432/postgres"

Testing

Unit tests

Jest is used as the primary driver for running unit tests. Running the following command will launch the test script across all apps and packages:

yarn test

Not all packages have direct units tests (yet), but they will at least run the TypeScript compiler and the linter as part of their test script, e.g.:

{
    "test": "tsc --noEmit && yarn lint"
}

E2E tests

Mobile

End-to-end testing foundation (for iOS) has been added, powered by Detox.

To run the test suite locally, navigate to the mobile app directory, and start by building a debug build of the app, e.g.:

cd apps/mobile
yarn build:detox:ios:debug

Once complete, start the test suite by running the following:

yarn test:detox:ios:debug

You may target a specific deployment/URL and/or a specific mocked user, by passing in launch arguments via Detox, e.g.:

detox test --configuration ios.sim.debug --app-launch-args='-base-url https://yoota-o7oipzzam-yoota.vercel.app -mock-user jane' --cleanup

Web

  • Add end-to-end testing support using Playwright

Authentication

Email

  • Document

Google OAuth Provider

  • Document

Apple OAuth Provider

  • Document

project-yoota's People

Contributors

kim-knudsen avatar

Watchers

 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.