-
Notifications
You must be signed in to change notification settings - Fork 117
Getting started
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.
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.
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.
Simply run the project in RSAKeyGenerator/RSAGenerator directory.
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:
Password | |
---|---|
[email protected] | Test123$ |
To be able to use the administrative functions of BankSystem, you have to create an administrator account by following these steps:
- Make an account in the application (or use the default account above).
- Connect to the SQL database using a tool such as SSMS or DataGrip.
- From the AspNetRoles table, note the ID of the Administrator role.
- From the AspNetUsers table, note the ID of your newly created user account.
- Create a new row in the AspNetUserRoles table and insert the user and role ID.
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.
To configure the CentralApi, please follow the steps below:
- Run the CentralApi so that the database gets created.
- Connect to the database and open the Banks table.
- 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 |
- 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 - / )
- Repeat steps 3 and 4 for every bank you want to add
- 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
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.
The app uses ReCaptcha to protect the registration form against bots.
Please follow the steps below to configure ReCaptcha:
- Register a reCAPTCHA v2 Checkbox site.
Alternatively, you can use the testing ReCaptcha keys from this page, which do not, however, offer any protection.
- 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"
}
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:
- Register a SendGrid account.
- Create an API key.
- 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.