Skip to content

Getting started

Melik Pehlivanov edited this page Jul 4, 2020 · 9 revisions

BankSystem consists of two base components - the bank web application and the CentralApi, which securely connects banks running on separate machines together to process transfers between different banks, card payments and direct payments.


BankSystem.Web

The BankSystem.Web web application can be found in the Web directory in the solution.

Note: If a connection to the CentralApi cannot be established, a lot of functionality will not work. For example, global transfers, card payments and direct payments require a connection.

Bank details

The bank details such as name, unique identifier, card prefix, and country can be found in the Web/BankSystem.Web/appsettings.json file.

Example:

"BankConfiguration": {
  "BankName": "Bank system",
  "CentralApiAddress": "https://localhost:5001/",
  "Key": "<RSAKeyValue><Modulus>uBJG...",
  "UniqueIdentifier": "ABC",
  "First3CardDigits": "101",
  "Country": "Bulgaria", 
  "CentralApiPublicKey": "<RSAKeyValue><Modulus>v76m9..."
}

The CentralApiAddress, Key and CentralApiPublicKey options can be configured later after setting up the CentralApi.

How to generate RSA key

Simply run the project in RSAKeyGenerator/RSAGenerator directory.

Automatically generated user

If there are no users in the database, the app will automatically create one for testing purposes. An account containing €10000 will also be generated. Its login details are listed below:

Email Password
test@test.com Test123$

Administrator account

To be able to use the administrative functions of BankSystem, you have to create an administrator account by following these steps:

  1. Make an account in the application (or use the default account above).
  2. Connect to the SQL database using a tool such as SSMS or DataGrip.
  3. From the AspNetRoles table, note the ID of the Administrator role.
  4. From the AspNetUsers table, note the ID of your newly created user account.
  5. Create a new row in the AspNetUserRoles table and insert the user and role ID.

CentralApi

The CentralApi app can be found in the Web/Api/ solution directory. Its purpose is to route transactions and confirm the identity of the banks by verifying their keys and signatures. It is necessary for much of the functionality of the BankSystem.

Configuration

To configure the CentralApi, please follow the steps below:

  1. Run the CentralApi so that the database gets created.
  2. Connect to the database and open the Banks table.
  3. Delete or modify the first row so that the details match the ones you have chosen when configuring the BankSystem.Web app. The corresponding table columns and JSON keys are listed below:
CentralApi database column BankSystem.Web appsettings.json key
Name BankName
SwiftCode UniqueIdentifier
Location Country
BankIdentificationCardNumbers First3CardDigits
  1. Change the URLs so that the banks can connect to the CentralApi and vice versa
  • Change the domain and port of the ApiAddress, PaymentUrl and CardPaymentUrl in the CentralApi database
  • Change the CentralApiAddress in the appsettings.json of the BankSystem.Web app _(it has to end with a slash - / )
  1. Repeat steps 3 and 4 for every bank you want to add
  2. Generate new keypairs for every bank (the provided keys match and work, but should be replaced)
  • Insert the public key of the CentralApi in the appsettings.json of every bank
  • Insert the private key of the CentralApi in the appsettings.json of the CentralApi (CentralApiConfiguration -> Key)
  • Insert the private key of every bank in the appsettings.json of that bank (BankConfiguration -> Key)
  • Insert the public key of every bank in the ApiKey column of the corresponding row in the CentralApi database

External services

In order to register an account on the BankSystem.Web application, the following services must be configured. This is not necessary if you wish to use the automatically generated user.

ReCaptcha

The app uses ReCaptcha to protect the registration form against bots.

Please follow the steps below to configure ReCaptcha:

  1. Register a reCAPTCHA v2 Checkbox site.

Alternatively, you can use the testing ReCaptcha keys from this page, which do not, however, offer any protection.

  1. Insert the Site key and Secret key in the following file:
    • src/Web/BankSystem.Web/appsettings.json

Example:

"ReCaptcha": {
  "SiteKey": "6L************************************FG",
  "SiteSecret": "6L************************************D1"
}

SendGrid

The app uses SendGrid to send emails containing registration confirmation links, as well as to notify users when money has been transferred to or from their accounts.

Please follow the steps below to configure SendGrid:

  1. Register a SendGrid account.
  2. Create an API key.
  3. Insert the API key in the following file:
    • src/Web/BankSystem.Web/appsettings.json

Example:

"SendGrid": {
  "ApiKey": "SA.10*****************************************************DO-zfxp"
}

Alternatively, you can delete this line from the Web/BankSystem.Web/Startup.cs file to disable account confirmation.