diff --git a/.env.example b/.env.example index abd0167b..b6fa8374 100644 --- a/.env.example +++ b/.env.example @@ -14,6 +14,7 @@ NX_NEXTAUTH_URL=http://localhost:4200 # We use ngrok to expose a local development environment to the internet # You can sign up for a free account and get an API key at https://ngrok.com NGROK_AUTH_TOKEN= +NGROK_DOMAIN= ######################################################################## # DATABASE @@ -35,7 +36,8 @@ NX_POLYGON_API_KEY= # We use Teller.io for automated banking data. You can sign up for a free # account and get a free API key at https://teller.io NX_TELLER_SIGNING_SECRET= -NX_TELLER_APP_ID= +NEXT_PUBLIC_TELLER_APP_ID= +NEXT_PUBLIC_TELLER_ENV=sandbox NX_TELLER_ENV=sandbox ######################################################################## @@ -57,4 +59,4 @@ NX_POSTMARK_API_TOKEN= ######################################################################## NX_PLAID_SECRET= NX_FINICITY_APP_KEY= -NX_FINICITY_PARTNER_SECRET= \ No newline at end of file +NX_FINICITY_PARTNER_SECRET= diff --git a/.vscode/settings.json b/.vscode/settings.json index b76293a8..475b191d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,7 @@ }, "[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" - } + }, + "typescript.enablePromptUseWorkspaceTsdk": true, + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/README.md b/README.md index a3c8eca8..99a64fbf 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ Get involved: [Discord](https://link.maybe.co/discord) • [Website](https://maybe.co) • [Issues](https://github.com/maybe-finance/maybe/issues) -🚨 NOTE: This is the original React app of the previously-defunct personal finance app, Maybe. This original version used many external services (Plaid, Finicity, etc) and getting it to fully function will be a decent amount of work. - -There's a LOT of work to do to get this functioning, but it should be feasible. - ## Backstory We spent the better part of 2021/2022 building a personal finance + wealth management app called Maybe. Very full-featured, including an "Ask an Advisor" feature which connected users with an actual CFP/CFA to help them with their finances (all included in your subscription). @@ -37,11 +33,12 @@ As a personal finance + wealth management app, Maybe has a lot of features. Here And dozens upon dozens of smaller features. -## Building the app +## Getting started -This is the current state of building the app. You'll hit errors, which we're working to resolve (and certainly welcome PRs to help with that). +This is the current state of building the app. We're actively working to make this process much more streamlined! -You'll need Docker installed to run the app locally. +*You'll need Docker installed to run the app locally.* +[Docker Desktop](https://www.docker.com/products/docker-desktop/) is an easy way to get started. First, copy the `.env.example` file to `.env`: @@ -53,6 +50,14 @@ Then, create a new secret using `openssl rand -base64 32` and populate `NEXTAUTH To enable transactional emails, you'll need to create a [Postmark](https://postmarkapp.com/) account and add your API key to your `.env` file (`NX_POSTMARK_API_TOKEN`). You can also set the from and reply-to email addresses (`NX_POSTMARK_FROM_ADDRESS` and `NX_POSTMARK_REPLY_TO_ADDRESS`). If you want to run the app without email, you can set `NX_POSTMARK_API_TOKEN` to a dummy value. +Maybe uses [Teller](https://teller.io/) for connecting financial accounts. To get started with Teller, you'll need to create an account. Once you've created an account: + +- Add your Teller application id to your `.env` file (`NEXT_PUBLIC_TELLER_APP_ID`). +- Download your authentication certificates from Teller, create a `certs` folder in the root of the project, and place your certs in that directory. You should have both a `certificate.pem` and `private_key.pem`. **NEVER** check these files into source control, the `.gitignore` file will prevent the `certs/` directory from being added, but please double check. +- Set your `NEXT_PUBLIC_TELLER_ENV` and `NX_TELLER_ENV` to your desired environment. The default is `sandbox` which allows for testing with mock data. The login credentials for the sandbox environment are `username` and `password`. To connect to real financial accounts, you'll need to use the `development` environment. +- Webhooks are not implemented yet, but you can populate the `NX_TELLER_SIGNING_SECRET` with the value from your Teller account. +- We highly recommend checking out the [Teller docs](https://teller.io/docs) for more info. + Then run the following yarn commands: ``` @@ -63,6 +68,27 @@ yarn prisma:seed yarn dev ``` +## Set Up Ngrok + +External data providers require HTTPS/SSL webhook URLs for sending data. + +To test this locally/during development, you will need to setup `ngrok`. + +1. Visit [ngrok.com](https://ngrok.com/) +2. Create a free account +3. Visit [this page](https://dashboard.ngrok.com/get-started/your-authtoken) to access your auth token +4. Paste it into your `.env` file: `NGROK_AUTH_TOKEN=your_auth_token` + +You should claim your free static domain to avoid needing to change the URL each time you start/stop the server. + +To do so: + +1. Visit the [domains](https://dashboard.ngrok.com/cloud-edge/domains) page +2. Click on Create Domain +3. Copy the domain and paste it into your `.env` file: `NGROK_DOMAIN=your_domain` + +That's it! As long as you run the project locally using `docker` with `yarn dev:services:all` you'll be good to go. + ## Contributing To contribute, please see our [contribution guide](https://github.com/maybe-finance/maybe/blob/main/CONTRIBUTING.md). diff --git a/apps/client/pages/api/auth/[...nextauth].ts b/apps/client/pages/api/auth/[...nextauth].ts index 3a18412a..a641f0ac 100644 --- a/apps/client/pages/api/auth/[...nextauth].ts +++ b/apps/client/pages/api/auth/[...nextauth].ts @@ -85,7 +85,6 @@ export const authOptions = { strategy: 'jwt' as SessionStrategy, maxAge: 1 * 24 * 60 * 60, // 1 Day }, - providers: [ CredentialsProvider({ name: 'Credentials', diff --git a/apps/client/pages/login.tsx b/apps/client/pages/login.tsx index 84634495..aabcc715 100644 --- a/apps/client/pages/login.tsx +++ b/apps/client/pages/login.tsx @@ -57,6 +57,7 @@ export default function LoginPage() {