Giter VIP home page Giter VIP logo

securebankapp's Introduction

secureBankApp

Follow these steps to setup the code:

  1. Maven clean and Install the project
  2. Download the create_sample.sql file from CSE 545 GDrive folder. Create sample database and run the statements in the file
  3. Change the mysql username and password in application.properties to the one you use
  4. Run SecureBankAppApplication.java
  5. Go to localhost:8081/index.html to see the login page

API Requests URL: http://localhost:8081/api/login JSON Body: { "username":"bhargavi", "password":"b12345" }

http://localhost:8081/api/logout { "id":1 }

http://localhost:8081/api/balance { "accountNo":1, "amount":-10.2 }

DB Schema

CREATE TABLE sample.user ( user_id int(11) NOT NULL AUTO_INCREMENT, auth_role_id int(11) NOT NULL, username varchar(255) NOT NULL, password varchar(255) NOT NULL, name varchar(255) NOT NULL, dob date NOT NULL, contact varchar(12) NOT NULL unique , email_id varchar(255) NOT NULL unique , address varchar(255) NOT NULL, created timestamp DEFAULT CURRENT_TIMESTAMP(), PRIMARY KEY (user_id), CONSTRAINT FK_user_role FOREIGN KEY (auth_role_id) REFERENCES auth_role (auth_role_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO sample.user (user_id, auth_role_id,username,password,name,dob, contact, email_id, address, created) VALUES (1, 1, 'bhargavi', 'b12345', 'Bhargavi Hopper', NOW(),'4802863456', '[email protected]', 'Agave', NOW());

CREATE TABLE sample.auth_role ( auth_role_id int(11) NOT NULL AUTO_INCREMENT, role_name varchar(255) DEFAULT NULL, role_desc varchar(255) DEFAULT NULL, PRIMARY KEY (auth_role_id) ); INSERT INTO sample.auth_role VALUES (1,'ADMIN','Administrator'); INSERT INTO sample.auth_role VALUES (2,'TIER1','Tier 1 Employee'); INSERT INTO sample.auth_role VALUES (3,'TIER2','Tier 2 Employee'); INSERT INTO sample.auth_role VALUES (4,'USER','Bank User'); INSERT INTO sample.auth_role VALUES (5,'MERCHANT','Merchant customers');

CREATE TABLE sample.auth_user ( auth_user_id int(11) NOT NULL AUTO_INCREMENT, user_id int(11) NOT NULL, status varchar(255) NOT NULL, otp int(11), expiry timestamp NOT NULL, PRIMARY KEY (auth_user_id), CONSTRAINT FK_auth_user_user FOREIGN KEY (user_id) REFERENCES user (user_id) );

CREATE TABLE sample.account ( account_no int(11) NOT NULL AUTO_INCREMENT, user_id int(11) NOT NULL, balance decimal(10,2) NOT NULL, account_type int(2) NOT NULL, interest decimal(5,2), created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP(), updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP(), PRIMARY KEY (account_no), CONSTRAINT FK_ACCOUNT_USER FOREIGN KEY (user_id) REFERENCES user(user_id) );

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.