diff --git a/.env.example b/.env.example index 51bae42..81c1e87 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,7 @@ ZERO_GET_QUERIES_FORWARD_COOKIES="true" ZERO_MUTATE_URL="http://localhost:3000/api/zero/mutate" ZERO_MUTATE_FORWARD_COOKIES="true" + +PLAID_CLIENT_ID= +PLAID_SECRET= +PLAID_ENV=sandbox diff --git a/.gitignore b/.gitignore index 1e10e19..480bda9 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,8 @@ yarn-error.* *.pem # local env files -.env +.env* +!.env.example # typescript *.tsbuildinfo @@ -45,4 +46,3 @@ app-example .direnv/ .db/ .logs -.env diff --git a/README.md b/README.md index 48dd63f..d754509 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,20 @@ -# Welcome to your Expo app 👋 +# Money -This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app). +Personal finance application by [Max Koon](https://max.koon.us). Writen with Typescript, Expo/React Native, Zero Sync Engine, Better Auth, and Drizzle. -## Get started +## Development -1. Install dependencies - - ```bash - npm install - ``` - -2. Start the app - - ```bash - npx expo start - ``` - -In the output, you'll find options to open the app in a - -- [development build](https://docs.expo.dev/develop/development-builds/introduction/) -- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/) -- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/) -- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo - -You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction). - -## Get a fresh project - -When you're ready, run: - -```bash -npm run reset-project +```sh +git clone https://git.koon.us/max/money.git +direnv allow +cp .env.example .env.dev +ln -s .env.dev .env +vim .env.dev # Update with Plaid credentials +pnpm install +pnpm dev ``` -This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing. +## Deployment -## Learn more +An example deployment of this application can be found [here](https://git.koon.us/max/os/src/branch/main/host/ark/service/money.nix). -To learn more about developing your project with Expo, look at the following resources: - -- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides). -- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web. - -## Join the community - -Join our community of developers creating universal apps. - -- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute. -- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions. diff --git a/api/src/zero.ts b/api/src/zero.ts index d220065..8817369 100644 --- a/api/src/zero.ts +++ b/api/src/zero.ts @@ -24,11 +24,11 @@ import { Configuration, CountryCode, PlaidApi, PlaidEnvironments, Products } fro import { randomUUID } from "crypto"; import { db } from "./db"; import { balance, plaidAccessTokens, plaidLink, transaction } from "@money/shared/db"; -import { asc, desc, eq, inArray, sql, type InferInsertModel } from "drizzle-orm"; +import { eq, inArray, sql, type InferInsertModel } from "drizzle-orm"; const configuration = new Configuration({ - basePath: PlaidEnvironments.production, + basePath: process.env.PLAID_ENV == 'production' ? PlaidEnvironments.production : PlaidEnvironments.sandbox, baseOptions: { headers: { 'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID,