A simple banking terminal CLI in C backed by a PostgreSQL database.
Feature | Description |
---|---|
Register | Register a new user in the database |
Authentication | Authenticate the user using an email and password |
Check balance | Check the remaining balance in database |
Withdraw money | Withdraw money from account without overdraft |
Account details | Display account information |
Add funds | Add funds to account |
To run the project, you'll first need to build it. For that we'll need the following installed:
- CMake (version 3.22.1 or higher)
- PostgreSQL database
- PostgreSQL development libraries (
libpq-dev
)Install with
sudo apt install libpq-dev
Build the targets using the following steps:
- Clone the project
git clone [email protected]:kwameopareasiedu/bank-terminal-cli.git
- Navigate to the project root
cd bank-terminal-cli
- Create a
build
folder and navigate to itmkdir build && cd build
- Run cmake to create the makefile
cmake ..
- Run the make file to build the executables
make
After building the targets in the previous section, you should have 2 executables in the build
folder
db_setup
bank_terminal_cli
- Open your database client (pgadmin, dbeaver, etc) and create a new database
- Back in the
build
folder, create a text file calledconf
(no extension) - Paste the following in and replace with your own config:
name=NAME_OF_DATABASE user=DATABASE_USER pass=DATABASE_PASSWORD host=DATABASE_HOST port=DATABASE_PORT
- Run the
db_setup
to create the tables, function and trigger./db_setup
- Verify that the following were created in the database:
users
tablerecords
tablefn_update_updated_at
function
With our database setup, run the app using ./bank_terminal_cli
. You should see this in your console output:
Type help
to see the list of supported commands.