Skip to content

TFlexSoom/fake-bank

Repository files navigation

Fake Bank

A Express Web Application Built to show an example of a secure server for a possible banking outlet. Not meant for actual production deployment, only for educational purposes only

Video Demos

Code Tour Web Demo

.env file

DATABASE_URL="postgres://user:password@127.0.0.1:5432/public"
POSTGRES_USERNAME="user"
POSTGRES_PASSWORD="password"
POSTGRES_DB="public"
POSTGRES_PORT="5432"
AUTH_SECRET="xxxxxx" # Generated symetric jwk from jose that is base 64 encoded after stringification
CSRF_SECRET="xxxxxx" # Generated Bytes that are base 64 encoded. 

How To Use

I do go over this in the web demo video but here is a text version as well.

  1. Clone the repository and open your favorite terminal
  2. Create a .env file like the template above
  3. docker compose up -d To start the postgres database (you may need to install docker).
  4. npm i
  5. npx prisma migrate dev
  6. npx prisma generate
  7. npm start

About the Application

This app is mostly for fun but it does feature the ability to get loans which increase the cents in given accounts. I mainly had a lot of creative fun with the backend. I created my own CSRF protection and my own rate limiting using the postgres datasource and prisma. This code represents a minimalist implementation of a secure express web app with no static files.

How To Test

npm i -D && npm test

Contact

  • tflexsoom[at]tflexsoom-dev[dot]online