this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

change readme

+9 -215
+2 -208
README.md
··· 1 - # create-t3-turbo 2 - 3 - <img width="1758" alt="turbo2" src="https://user-images.githubusercontent.com/51714798/213819392-33e50db9-3e38-4c51-9a22-03abe5e48f3d.png"> 4 - 5 - ## Installation 6 - 7 - There are two ways of initializing an app using `create-t3-turbo` starter. You can either use this repository as a template or use Turbo's CLI to init your project: 8 - 9 - ```bash 10 - npx create-turbo@latest -e https://github.com/t3-oss/create-t3-turbo 11 - ``` 12 - 13 - ## About 14 - 15 - Ever wondered how to migrate your T3 application into a monorepo? Stop right here! This is the perfect starter repo to get you running with the perfect stack! 16 - 17 - It uses [Turborepo](https://turborepo.org/) and contains: 18 - 19 - ``` 20 - .github 21 - └─ workflows 22 - └─ CI with pnpm cache setup 23 - .vscode 24 - └─ Recommended extensions and settings for VSCode users 25 - apps 26 - ├─ expo 27 - | ├─ Expo SDK 48 28 - | ├─ React Native using React 18 29 - | ├─ Navigation using Expo Router 30 - | ├─ Tailwind using Nativewind 31 - | └─ Typesafe API calls using tRPC 32 - └─ next.js 33 - ├─ Next.js 13 34 - ├─ React 18 35 - ├─ Tailwind CSS 36 - └─ E2E Typesafe API Server & Client 37 - packages 38 - ├─ api 39 - | └─ tRPC v10 router definition 40 - ├─ auth 41 - └─ authentication using next-auth. **NOTE: Only for Next.js app, not Expo** 42 - └─ db 43 - └─ typesafe db-calls using Prisma 44 - ``` 45 - 46 - ## FAQ 47 - 48 - ### Can you include Solito? 49 - 50 - No. Solito will not be included in this repo. It is a great tool if you want to share code between your Next.js and Expo app. However, the main purpose of this repo is not the integration between Next.js and Expo - it's the codesplitting of your T3 App into a monorepo, the Expo app is just a bonus example of how you can utilize the monorepo with multiple apps but can just as well be any app such as Vite, Electron, etc. 51 - 52 - Integrating Solito into this repo isn't hard, and there are a few [offical templates](https://github.com/nandorojo/solito/tree/master/example-monorepos) by the creators of Solito that you can use as a reference. 53 - 54 - ### What auth solution should I use instead of Next-Auth.js for Expo? 55 - 56 - I've left this kind of open for you to decide. Some options are [Clerk](https://clerk.dev), [Supabase Auth](https://supabase.com/docs/guides/auth), [Firebase Auth](https://firebase.google.com/docs/auth/) or [Auth0](https://auth0.com/docs). Note that if you're dropping the Expo app for something more "browser-like", you can still use Next-Auth.js for those. [See an example in a Plasmo Chrome Extension here](https://github.com/t3-oss/create-t3-turbo/tree/chrome/apps/chrome). 57 - 58 - The Clerk.dev team even made an [official template repository](https://github.com/clerkinc/t3-turbo-and-clerk) integrating Clerk.dev with this repo. 59 - 60 - ### Does this pattern leak backend code to my client applications? 61 - 62 - No, it does not. The `api` package should only be a production dependency in the Next.js application where it's served. The Expo app, and all other apps you may add in the future, should only add the `api` package as a dev dependency. This lets you have full typesafety in your client applications, while keeping your backend code safe. 63 - 64 - If you need to share runtime code between the client and server, such as input validation schemas, you can create a separate `shared` package for this and import on both sides. 65 - 66 - ## Quick Start 67 - 68 - To get it running, follow the steps below: 69 - 70 - ### Setup dependencies 71 - 72 - ```diff 73 - # Install dependencies 74 - pnpm i 75 - 76 - # In packages/db/prisma update schema.prisma provider to use sqlite 77 - # or use your own database provider 78 - - provider = "postgresql" 79 - + provider = "sqlite" 80 - 81 - # Configure environment variables. 82 - # There is an `.env.example` in the root directory you can use for reference 83 - cp .env.example .env 84 - 85 - # Push the Prisma schema to your database 86 - pnpm db:push 87 - ``` 88 - 89 - ### Configure Expo `dev`-script 90 - 91 - #### Use iOS Simulator 92 - 93 - 1. Make sure you have XCode and XCommand Line Tools installed [as shown on expo docs](https://docs.expo.dev/workflow/ios-simulator/). 94 - > **NOTE:** If you just installed XCode, or if you have updated it, you need to open the simulator manually once. Run `npx expo start` in the root dir, and then enter `I` to launch Expo Go. After the manual launch, you can run `pnpm dev` in the root directory. 95 - 96 - ```diff 97 - + "dev": "expo start --ios", 98 - ``` 99 - 100 - 3. Run `pnpm dev` at the project root folder. 101 - 102 - > **TIP:** It might be easier to run each app in separate terminal windows so you get the logs from each app separately. This is also required if you want your terminals to be interactive, e.g. to access the Expo QR code. You can run `pnpm --filter expo dev` and `pnpm --filter nextjs dev` to run each app in a separate terminal window. 103 - 104 - #### For Android 105 - 106 - 1. Install Android Studio tools [as shown on expo docs](https://docs.expo.dev/workflow/android-studio-emulator/). 107 - 2. Change the `dev` script at `apps/expo/package.json` to open the Android emulator. 108 - 109 - ```diff 110 - + "dev": "expo start --android", 111 - ``` 112 - 113 - 3. Run `pnpm dev` at the project root folder. 1 + # Graysky 114 2 115 - ## Deployment 116 - 117 - ### Next.js 118 - 119 - #### Prerequisites 120 - 121 - _We do not recommend deploying a SQLite database on serverless environments since the data wouldn't be persisted. I provisioned a quick Postgresql database on [Railway](https://railway.app), but you can of course use any other database provider. Make sure the prisma schema is updated to use the correct database._ 122 - 123 - **Please note that the Next.js application with tRPC must be deployed in order for the Expo app to communicate with the server in a production environment.** 124 - 125 - #### Deploy to Vercel 126 - 127 - Let's deploy the Next.js application to [Vercel](https://vercel.com/). If you have ever deployed a Turborepo app there, the steps are quite straightforward. You can also read the [official Turborepo guide](https://vercel.com/docs/concepts/monorepos/turborepo) on deploying to Vercel. 128 - 129 - 1. Create a new project on Vercel, select the `apps/nextjs` folder as the root directory and apply the following build settings: 130 - 131 - <img width="927" alt="Vercel deployment settings" src="https://user-images.githubusercontent.com/11340449/201974887-b6403a32-5570-4ce6-b146-c486c0dbd244.png"> 132 - 133 - > The install command filters out the expo package and saves a few second (and cache size) of dependency installation. The build command makes us build the application using Turbo. 134 - 135 - 2. Add your `DATABASE_URL` environment variable. 136 - 137 - 3. Done! Your app should successfully deploy. Assign your domain and use that instead of `localhost` for the `url` in the Expo app so that your Expo app can communicate with your backend when you are not in development. 138 - 139 - ### Expo 140 - 141 - Deploying your Expo application works slightly differently compared to Next.js on the web. Instead of "deploying" your app online, you need to submit production builds of your app to the app stores, like [Apple App Store](https://www.apple.com/app-store/) and [Google Play](https://play.google.com/store/apps). You can read the full [Distributing your app](https://docs.expo.dev/distribution/introduction/), including best practices, in the Expo docs. 142 - 143 - 1. Make sure to modify the `getBaseUrl` function to point to your backend's production URL: 144 - 145 - https://github.com/t3-oss/create-t3-turbo/blob/656965aff7db271e5e080242c4a3ce4dad5d25f8/apps/expo/src/utils/api.tsx#L20-L37 146 - 147 - 2. Let's start by setting up [EAS Build](https://docs.expo.dev/build/introduction/), which is short for Expo Application Services. The build service helps you create builds of your app, without requiring a full native development setup. The commands below are a summary of [Creating your first build](https://docs.expo.dev/build/setup/). 148 - 149 - ```bash 150 - // Install the EAS CLI 151 - $ pnpm add -g eas-cli 152 - 153 - // Log in with your Expo account 154 - $ eas login 155 - 156 - // Configure your Expo app 157 - $ cd apps/expo 158 - $ eas build:configure 159 - ``` 160 - 161 - 3. After the initial setup, you can create your first build. You can build for Android and iOS platforms and use different [**eas.json** build profiles](https://docs.expo.dev/build-reference/eas-json/) to create production builds or development, or test builds. Let's make a production build for iOS. 162 - 163 - ``` 164 - $ eas build --platform ios --profile production 165 - ``` 166 - 167 - > If you don't specify the `--profile` flag, EAS uses the `production` profile by default. 168 - 169 - 4. Now that you have your first production build, you can submit this to the stores. [EAS Submit](https://docs.expo.dev/submit/introduction/) can help you send the build to the stores. 170 - 171 - ``` 172 - $ eas submit --platform ios --latest 173 - ``` 174 - 175 - > You can also combine build and submit in a single command, using `eas build ... --auto-submit`. 176 - 177 - 5. Before you can get your app in the hands of your users, you'll have to provide additional information to the app stores. This includes screenshots, app information, privacy policies, etc. _While still in preview_, [EAS Metadata](https://docs.expo.dev/eas/metadata/) can help you with most of this information. 178 - 179 - 6. Once everything is approved, your users can finally enjoy your app. Let's say you spotted a small typo; you'll have to create a new build, submit it to the stores, and wait for approval before you can resolve this issue. In these cases, you can use EAS Update to quickly send a small bugfix to your users without going through this long process. Let's start by setting up EAS Update. 180 - 181 - The steps below summarize the [Getting started with EAS Update](https://docs.expo.dev/eas-update/getting-started/#configure-your-project) guide. 182 - 183 - ```bash 184 - // Add the `expo-updates` library to your Expo app 185 - $ cd apps/expo 186 - $ pnpm expo install expo-updates 187 - 188 - // Configure EAS Update 189 - $ eas update:configure 190 - ``` 191 - 192 - 7. Before we can send out updates to your app, you have to create a new build and submit it to the app stores. For every change that includes native APIs, you have to rebuild the app and submit the update to the app stores. See steps 2 and 3. 193 - 194 - 8. Now that everything is ready for updates, let's create a new update for `production` builds. With the `--auto` flag, EAS Update uses your current git branch name and commit message for this update. See [How EAS Update works](https://docs.expo.dev/eas-update/how-eas-update-works/#publishing-an-update) for more information. 195 - 196 - ```bash 197 - $ cd apps/expo 198 - $ eas update --auto 199 - ``` 200 - 201 - > Your OTA (Over The Air) updates must always follow the app store's rules. You can't change your app's primary functionality without getting app store approval. But this is a fast way to update your app for minor changes and bug fixes. 202 - 203 - 9. Done! Now that you have created your production build, submitted it to the stores, and installed EAS Update, you are ready for anything! 204 - 205 - ## References 206 - 207 - The stack originates from [create-t3-app](https://github.com/t3-oss/create-t3-app). 208 - 209 - A [blog post](https://jumr.dev/blog/t3-turbo) where I wrote how to migrate a T3 app into this. 3 + AT Protocol client
+7 -7
apps/expo/src/app/login.tsx
··· 11 11 12 12 const agent = new BskyAgent({ 13 13 service: "https://bsky.app", 14 - // persistSession(evt: AtpSessionEvent, sess?: AtpSessionData) { 15 - // // store the session-data for reuse 16 - // console.log({ 17 - // evt, 18 - // sess, 19 - // }); 20 - // }, 14 + persistSession(evt: AtpSessionEvent, sess?: AtpSessionData) { 15 + // store the session-data for reuse 16 + console.log({ 17 + evt, 18 + sess, 19 + }); 20 + }, 21 21 }); 22 22 23 23 export default function Login() {