This app was built quickly / haphazardly across a year time-span. The goal was two-fold: Learn React/Redux, and build a useful tool that I actually needed.
As I built and learned, I usually refactored things, but inevitably other pieces would fall through the cracks. Furthermore, this app was never built to be run on another machine, by another developer, so I've hacked together a way to "seed" some data into the app, but in an ideal world this probably be handled by a container of some sort, or a more robust seeding script.
This app has a ton of shortcomings—I am under no delusion here. I can offer pretty much a few hours worth of commentary on how I would've done things differently or improved certain parts of the app.
- Redux is probably overkill for your first react app. React Context would be far easier to run with.
- Starting with Electron and migrating to a webapp is a weird / bad product life-cycle.
- Use Typescript sooner—your later-self will thank you.
- Start with future developers in mind. Make a system that can be replicated anywhere, easily.
- Starting to learn React is fun! Starting to learn MaterialUI simultaneously—is decidedly NOT fun. (I was in the process of replacing as many MUI components as I could with the more-lightweight, simpler-to-use: Rebass. I never finished that endeavor.)
- ...?
- Profit
- (Actually, no profit made, but much knowledge gained)
Now then.. Let's begin!
You'll need a few things:
-
Local instance of MongoDB running on port
27017
. This instance should allow a database called "bank_analyzer" to be created without any auth. However, if it does require auth, therestor.sh
script should be easily modified to include auth in themongorestore
command.- If you're running on MacOS it's fairly straightforward to install using
brew install mongodb/brew/mongodb-community
. You may need to tap it first like so:brew tap mongodb/brew
- If you're running on MacOS it's fairly straightforward to install using
-
Run the
./restore.sh
script to seed the small bank_analyzer database table. In a more-perfect world, it would just allow you to actually sign in, via Plaid, and test with your actual bank records. ¯\_(ツ)_/¯ -
cp .env.example .env
- Access
localhost:8081
and you should be prompted for a login. Utilize theUSERNAME
andPASSWORD
fields in your .env file.
- USERNAME — Username for the default local user
- PASSWORD — Password for the default local user
- PLAID_CLIENT_ID — Client ID to access Plaid dummy data
- PLAID_SECRET — Secret to access Plaid dummy data
- BANK_ANALYZER_TOKEN_SECRET — Used to sign/verify JWTs for auth
- USER_HASH — Used to determine if the decrypted cookie was valid
- DB_URI — Defaults to
mongodb://127.0.0.1:27017
which is the default, local MongoDB host/port config - DB_NAME — The database name for the project
** NOTE: These env vars are all configured correctly out of the box for demo purposes and don't need to be configured **
-
Screen goes blank
- Unfortunately, this app hasn't seen the light of day in over a year. I was in the middle of some major changes to the navigation system and the data-loading system and refreshing the page is the best bet here.
-
No data shows up
- Have you run the
restore.sh
script to load the database data?
- Have you run the
-
What do I use to login?
- Use the USERNAME and PASSWORD vars set up in your
.env
file
- Use the USERNAME and PASSWORD vars set up in your
-
I can't get the filters to work?
- Yes, those were in the middle of getting an amazing makeover when this project was dropped. For demoing purposes, it was easier just to disable them.
-
My mind is blown
- Unfortunately, this happens to many who view this code. I haven't found a reliable solution yet.