Giter Club home page Giter Club logo

financial-app's Introduction

About ๐Ÿ’ฌ

The purpose of this repository is to serve as a template or demo for a generic financials application, that allows for visualization of and interaction with bank accounts (cards and payments may be supported in the future).

Structure ๐Ÿข

  • ๐Ÿฆ bank-integration-service is a Python Flask/AlchemySQL web server that interacts with bank PSD2 APIs. It requires at least registered apps in said banks' sandbox environments. Currently only connected to the Swedish SEB bank.
  • ๐Ÿšข infrastructure contains a Docker based means of spinning up the back-end for project, including a PostgreSQL database.
  • ๐Ÿ“ƒ financial-information-service is a NestJS/Prisma back-end, towards which a front-end app would make calls for fetching information. This back-end in turn relies on the bank-integration-service for interfacing with the actual bank PSD2 apis. The purpose of this back-end service is only to manage the users of your app and their information. Uses pnpm as the package manager.
  • user-facing-application is a Svelte app for registering, logging in, connecting to a bank and visualising one's financial data. Uses npm as its package manager.

infrastructure overview screenshot infrastructure overview screenshot

Running ๐Ÿ”Œ

If for the first time, you have to do some prep in infrastructure:

  1. Prep the docker-compoes yml file with your SEB client id & secret.
  2. Start only database by running docker compose up database.
  3. Run the database setup script ./scripts/setup_database.sh, then docker compose down database.
  4. In a separate terminal window/tab, run docker compose up database bank-integration-service, which will populate it's database (financial) with the required tables and spin the service up.
  5. Run docker compose up database financial-information-service, which will do the same, but for the service that handles users & all features that they have access to.
  6. docker compose down

After the first time. In infrastructure:

  1. docker compose up

In user-facing-application:

  1. npm install to install dependencies.
  2. npm run dev to start the application in development mode.

Interacting / Demoing

  1. Navigate to the Svelte app's /register endpoint.
  2. Put in the SEB test person's national identification number 199311219639 & write a test password, e.g test_password.
  3. After registering, navigate to the /login page and provide the number & password as input.
  4. Navigate to /connect.
  5. Have Postman prepared, as you will be using SEB's mock BankID signature to authorize the back-end. The URL for this at the time of me writing this is https://api-sandbox.sebgroup.com/open/sb/auth/mock/v1/login. You will shortly hit it with the following payload.
{
    "personal_identity_number": "199311219639",
    "start_token": "START_TOKEN"
}
  1. Open your browser's developer tools and navigate to the network tab. Click on "start" and watch for the init_auth request reply. From it, you will copy the bank_id_autostart_token value and use it in the request above to mock a BankID auth :). You have 30 or so seconds to do so.
  2. Navigate to /overview, wait for ~20 seconds and refresh the page, then click "load overview". In the future there will be a loader UI element and the loading will happen automatically, but there's barebones HTML and CSS at the moment.
  3. Done, you should see some simple tables with the SEB demo accounts data.

Right now the support for refreshing an access token to SEB exists, but it's not being taken advantage of. The current testing flow is to wipe the db before running the flow end-to-end. In the future using the refresh token should be supported, so you can just fetch financial information without needing to authorize the back-end.

TO-DO ๐Ÿ‘ทโ€โ™‚๏ธ

  • In bank-integration-service
    • Add logger / error monitoring
    • Add error handling - timeouts, connectivity, bad requests
    • Tests with pytest
  • In financial-information-service
    • Add logger / error monitoring
    • Switch login to use internal user id instead of national identification number (for security purposes).
    • Extend the models to support common fields such as created_at upon row insertion and update_at upon row updates. E.g -> https://x-team.com/blog/automatic-timestamps-with-postgresql/
    • Rate limiting and customer error messages to avoid software fingerprinting
    • Tests with Jest.
  • In user-facing-application:
    • Update the front-end application to be more eye-pleasing. The current condition is just a proof-of-concept.
    • Dockerize the front-end application.

financial-app's People

Contributors

asparuhkostov avatar

Stargazers

Cioclea Doru Octavian avatar Shubham Zanwar avatar Kim Persson avatar

Watchers

 avatar  avatar

Forkers

dorucioclea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.