Skip to content

Commit 360dc23

Browse files
authored
Merge pull request #1 from plaid/v1.0.0
v1.0.0
2 parents 078266d + 291babf commit 360dc23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+23592
-1
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = false
9+
10+
[Makefile]
11+
indent_style = tab
12+
13+
[*.md]
14+
indent_size = 4

.env.template

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Your Plaid keys, which can be found in the Plaid Dashboard.
2+
# https://dashboard.plaid.com/account/keys
3+
4+
PLAID_CLIENT_ID=
5+
PLAID_PUBLIC_KEY=
6+
PLAID_SECRET_DEVELOPMENT=
7+
PLAID_SECRET_SANDBOX=
8+
9+
# The Plaid environment to use ('sandbox' or 'development').
10+
# https://plaid.com/docs/#api-host
11+
12+
PLAID_ENV=sandbox

.gitignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
database/last-cleared.dummy
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
25+
.grunt
26+
27+
# Bower dependency directory (https://bower.io/)
28+
bower_components
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (https://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directories
37+
node_modules/
38+
jspm_packages/
39+
40+
# TypeScript v1 declaration files
41+
typings/
42+
43+
# Optional npm cache directory
44+
.npm
45+
46+
# Optional eslint cache
47+
.eslintcache
48+
49+
# Optional REPL history
50+
.node_repl_history
51+
52+
# Output of 'npm pack'
53+
*.tgz
54+
55+
# Yarn Integrity file
56+
.yarn-integrity
57+
58+
# dotenv environment variables file
59+
.env
60+
61+
# next.js build output
62+
.next

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Docker: Attach to Server",
9+
"type": "node",
10+
"request": "attach",
11+
"localRoot": "${workspaceFolder}/server",
12+
"remoteRoot": "/opt/server",
13+
"address": "localhost",
14+
"port": 9229,
15+
"protocol": "inspector",
16+
"restart": true,
17+
}
18+
]
19+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2019 Plaid Technologies, Inc. <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

Makefile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
2+
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
3+
envfile := ./.env
4+
clear_db_after_schema_change := database/last-cleared.dummy
5+
db_schema := database/init/*
6+
7+
.PHONY: help start start-no-webhooks debug sql logs stop clear-db
8+
9+
# help target adapted from https://gist.github.com/prwhite/8168133#gistcomment-2278355
10+
TARGET_MAX_CHAR_NUM=20
11+
12+
## Show help
13+
help:
14+
@echo ''
15+
@echo 'Usage:'
16+
@echo ' make <target>'
17+
@echo ''
18+
@echo 'Targets:'
19+
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
20+
helpMessage = match(lastLine, /^## (.*)/); \
21+
if (helpMessage) { \
22+
helpCommand = substr($$1, 0, index($$1, ":")-1); \
23+
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
24+
printf " %-$(TARGET_MAX_CHAR_NUM)s %s\n", helpCommand, helpMessage; \
25+
} \
26+
} \
27+
{ lastLine = $$0 }' $(MAKEFILE_LIST)
28+
29+
## Start the services
30+
start: $(envfile) $(clear_db_after_schema_change)
31+
@echo "Pulling images from Docker Hub (this may take a few minutes)"
32+
docker-compose pull
33+
@echo "Starting Docker services"
34+
docker-compose up --detach
35+
./wait-for-client.sh
36+
37+
## Start the services without webhooks
38+
start-no-webhooks: $(envfile) $(clear_db_after_schema_change)
39+
@echo "Pulling images from Docker Hub (this may take a few minutes)"
40+
docker-compose pull
41+
@echo "Starting Docker services"
42+
docker-compose up --detach client
43+
./wait-for-client.sh
44+
45+
## Start the services in debug mode
46+
debug: $(envfile) $(clear_db_after_schema_change)
47+
@echo "Starting services (this may take a few minutes if there are any changes)"
48+
docker-compose -f docker-compose.yml -f docker-compose.debug.yml up --build --detach
49+
./wait-for-client.sh
50+
51+
## Start an interactive psql session (services must running)
52+
sql:
53+
docker-compose exec db psql -U postgres
54+
55+
## Show the service logs (services must be running)
56+
logs:
57+
docker-compose logs --follow
58+
59+
## Stop the services
60+
stop:
61+
docker-compose down
62+
docker volume rm $(current_dir)_client_node_modules || true
63+
docker volume rm $(current_dir)_server_node_modules || true
64+
65+
## Clear the sandbox and development databases
66+
clear-db: stop
67+
docker volume rm $(current_dir)_pg_sandbox_data || true
68+
docker volume rm $(current_dir)_pg_development_data || true
69+
70+
$(envfile):
71+
@echo "Error: .env file does not exist! See the README for instructions."
72+
@exit 1
73+
74+
# Remove local DBs if the DB schema has changed
75+
$(clear_db_after_schema_change): $(db_schema)
76+
@$(MAKE) clear-db
77+
@touch $(clear_db_after_schema_change)

README.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,71 @@
1-
# pattern
1+
# Plaid Pattern
2+
3+
![Plaid Pattern client][client-img]
4+
5+
This is a reference application demonstrating an end-to-end [Plaid][plaid] integration, focused on linking items and fetching transaction data.
6+
7+
**This is not meant to be run as a production application.**
8+
9+
## Requirements
10+
11+
- [Docker][docker] Version 2.0.0.3 (31259) or higher, installed and running
12+
- [Plaid API keys][plaid-keys] - [sign up][plaid-signup] for a free Sandbox account if you don't already have one
13+
14+
## Getting Started
15+
16+
1. Clone the repo.
17+
```shell
18+
git clone https://github.plaid.com/plaid/open-pfm.git
19+
cd open-pfm
20+
```
21+
1. Create the `.env` file.
22+
```shell
23+
cp .env.template .env
24+
```
25+
1. Update the `.env` file with your [Plaid API keys][plaid-keys].
26+
1. Start the services. The first run may take a few minutes as Docker images are pulled/built for the first time.
27+
```shell
28+
make start
29+
```
30+
1. Open http://localhost:3000 in a web browser.
31+
1. When you're finished, stop the services.
32+
```shell
33+
make stop
34+
```
35+
36+
## Additional Commands
37+
38+
All available commands can be seen by calling `make help`.
39+
40+
## Architecture
41+
42+
For more information about the individual services, see the readmes for the [client][client-readme], [database][database-readme], and [server][server-readme].
43+
44+
## Troubleshooting
45+
46+
See [`docs/troubleshooting.md`][troubleshooting].
47+
48+
## Additional Resources
49+
50+
- For an overview of the Plaid platform and products, refer to this [Quickstart guide][plaid-quickstart].
51+
- Check out this high-level [introduction to Plaid Link](https://blog.plaid.com/plaid-link/).
52+
- Find comprehensive information on Plaid API endpoints in the [API documentation][plaid-docs].
53+
- Questions? Please head to the [Help Center][plaid-help] or [open a Support ticket][plaid-support-ticket].
54+
55+
## License
56+
57+
[MIT](LICENSE)
58+
59+
[client-img]: docs/pattern_screenshot.png
60+
[client-readme]: client/README.md
61+
[database-readme]: database/README.md
62+
[docker]: https://www.docker.com/products/docker-desktop
63+
[plaid]: https://plaid.com
64+
[plaid-docs]: https://plaid.com/docs/
65+
[plaid-help]: https://support.plaid.com/hc/en-us
66+
[plaid-keys]: https://dashboard.plaid.com/account/keys
67+
[plaid-quickstart]: https://plaid.com/docs/quickstart/
68+
[plaid-signup]: https://dashboard.plaid.com/signup
69+
[plaid-support-ticket]: https://dashboard.plaid.com/support/new
70+
[server-readme]: server/README.md
71+
[troubleshooting]: docs/troubleshooting.md

client/.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# node
2+
node_modules
3+
npm-debug.log
4+
5+
# docker
6+
Dockerfile*
7+
docker-compose*
8+
.dockerignore
9+
10+
# other
11+
.DS_Store
12+
.env
13+
.eslintrc*
14+
.gitignore
15+
.prettierrc*
16+
README.md

client/.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "react-app",
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"prettier/prettier": "error"
6+
}
7+
}

client/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

0 commit comments

Comments
 (0)