A mockup for basic bank functionality which includes
If you ever forget about the functionality of this then simply type menu
to list all available commands
Register a new account using following command
register
You will be taken through the process of registering a new account via prompts
Include your username in the command when you want to login
login foo
It will then ask your password, and don't worry the password is masked in the prompt
logout
The opposite of login, I guess
Deposit to your account via command below
deposit [amount]
If you have any outstanding debt then the money will be automatically transfered to creditor(s) with FIFO order
Transfer your money to another account using command below
transfer [destination username] [amount]
You can transfer more than what you have in your account but it will be listed as debt
To exit the app gracefully type
exit
Below are some technical information about this repo
- Written in Typescript
- sqlite3, chosen because of simplicity and portability
- eslint for linter
- bcrypt for hashing password
- typeorm
- readline-sync for prompting user
- jest and sinon for testing
- colors 🌈
type make
in root folder to install all dependencies, transpile to js, and run the app
yarn test --coverage
Above command will run the test and show the coverage report
Since this is a typescript repo, then we need to transpile it to js before we run and it could be an annoying thing to do it again and again every time the codes changed. To lessen that annoyment, you can run below command in another terminal session
yarn watch
That will spawn a watcher that will automatically transpile the codes everytime a file is changed. However this will not run eslint
Standardize your codes and transpile it to js into dist/ folder which then we can run
yarn build
yarn start
This will execute transpiled codes in dist folder with dist/index.js as entry point