I had an idea to build a basic digital bank on a series of livestreams, so this repository is where all the code will live.
All the code here may not exactly be production ready. I'm building this during livestreams, so I'm doing just enough for people to get the concepts.
- You need to have Node.js and MySQL installed.
- Install project dependencies by running
npm install
. - Create a
.env
file in the root directory and add your databae details. It should have the following properties:
- DATABASE_HOST=
- DATABASE_USERNAME=
- DATABASE_PASSWORD=
- DATABASE_NAME=
- DATABASE_PORT=
- Run the migrations to create database tables by running
npm run migrate
. - You can create two users by calling the
createUser
function inapp.js
with theusername
andpassword
arguments. Something like this:
createUser('johndoe', 'doedoe').then(console.log).catch(console.log);
createUser('johnlol', 'lololo').then(console.log).catch(console.log)
This will generate records in both the users
table as well as accounts
table.
- You can go ahead to test each transaction function.
To run basic wallet functionalities, run the functions in app.js
.
To run the card functions for debit and authorization, run the functions in card.js
.
Branches are properly named and created per feature. So to see the code for a particular feature, you can switch to the corresponding branch in the UI.
You can suggest a feature by creating an issue and adding the label request
to it.