chore: better env management and readme
This commit is contained in:
@@ -12,3 +12,7 @@ ZERO_GET_QUERIES_FORWARD_COOKIES="true"
|
|||||||
|
|
||||||
ZERO_MUTATE_URL="http://localhost:3000/api/zero/mutate"
|
ZERO_MUTATE_URL="http://localhost:3000/api/zero/mutate"
|
||||||
ZERO_MUTATE_FORWARD_COOKIES="true"
|
ZERO_MUTATE_FORWARD_COOKIES="true"
|
||||||
|
|
||||||
|
PLAID_CLIENT_ID=
|
||||||
|
PLAID_SECRET=
|
||||||
|
PLAID_ENV=sandbox
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -31,7 +31,8 @@ yarn-error.*
|
|||||||
*.pem
|
*.pem
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env
|
.env*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
@@ -45,4 +46,3 @@ app-example
|
|||||||
.direnv/
|
.direnv/
|
||||||
.db/
|
.db/
|
||||||
.logs
|
.logs
|
||||||
.env
|
|
||||||
|
|||||||
56
README.md
56
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
|
```sh
|
||||||
|
git clone https://git.koon.us/max/money.git
|
||||||
```bash
|
direnv allow
|
||||||
npm install
|
cp .env.example .env.dev
|
||||||
```
|
ln -s .env.dev .env
|
||||||
|
vim .env.dev # Update with Plaid credentials
|
||||||
2. Start the app
|
pnpm install
|
||||||
|
pnpm dev
|
||||||
```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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ import { Configuration, CountryCode, PlaidApi, PlaidEnvironments, Products } fro
|
|||||||
import { randomUUID } from "crypto";
|
import { randomUUID } from "crypto";
|
||||||
import { db } from "./db";
|
import { db } from "./db";
|
||||||
import { balance, plaidAccessTokens, plaidLink, transaction } from "@money/shared/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({
|
const configuration = new Configuration({
|
||||||
basePath: PlaidEnvironments.production,
|
basePath: process.env.PLAID_ENV == 'production' ? PlaidEnvironments.production : PlaidEnvironments.sandbox,
|
||||||
baseOptions: {
|
baseOptions: {
|
||||||
headers: {
|
headers: {
|
||||||
'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID,
|
'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user