[]: # Language: markdown []: # Path: README.md
The application provides a rudimentary online banking template. It is a full stack application that primarily utilises Node.js and it employs the MVC pattern.
The application has a front end that is built using Javascript and Bootstrap and a back end that is built using Node.js.
The back end database uses MySQL.
The back end also provides a REST API that is used serverside end as well as a REST API that can be accessed directly from the Front End. Both of these APIs require Authentication.
'npm i' to install the necessary dependencies.
Create a file named .env with the following contents:
DB_NAME=bank_db
DB_USER=root
DB_PASSWORD=yourpassword
DB_HOST=yourDbHostIp
PORT=DBPort
run schema.sql at a mySQL prompt to create the database and tables.
source ./db/schema.sql
run 'npn run seed' to seed the database with some data.
source ./db/seeds.sql
The application supports the follwing funcitonalities:
1. Create a new user
2. Login an existing user
1. Create a new account
2. View all accounts and balances
3. View an account and its associated transactions
1. Create a new transaction
curl --request POST \
--url http://localhost:3001/api/user/logout/ \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8
curl --request POST \
--url http://localhost:3001/api/user/login/ \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
--data '{
"email" : "[email protected]",
"password" : "password123456"
}'
curl --request POST \
--url http://localhost:3001/api/user/ \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
--data '{
"username" : "test7",
"email" : "[email protected]",
"password" : "password123456"
}'
curl --request POST \
--url http://localhost:3001/api/account/ \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
--data '{
"account_name" : "savings_account",
"interest_rate" : 0.5,
"balance" : 15000
}'
curl --request GET \
--url http://localhost:3001/api/account/6 \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8
curl --request GET \
--url http://localhost:3001/api/account/6 \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8
curl --request GET \
--url http://localhost:3001/api/transaction/ \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
--data '{
"account_id": 34
}'
curl --request POST \
--url http://localhost:3001/api/transaction/ \
--header 'Content-Type: application/json' \
--cookie connect.sid=s%253ArSlAvio9CwZvRZtFePi0QDUbS0-QQ9X8.kv9oK0dAJ6%252BEhgRbnFq0suJdSwDBfLA%252BhZUBC7od4%252B8 \
--data '{
"amount": 20.00,
"account_from_id": "6",
"account_to_id":2,
"user_id":1
}'
This project is licenced under MIT
More of my work can be found here
TODO: Add other team members Github links
The applicaiton needs:
* More robust authentication on endpoints. The current application allows any
authenticated user to access any transactions. This is not secure.
* Tests adding