Coder Social home page Coder Social logo

bank-terminal-cli's Introduction

Bank Terminal CLI

A simple banking terminal CLI in C backed by a PostgreSQL database.

Features

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

Build Source

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:

  1. Clone the project git clone [email protected]:kwameopareasiedu/bank-terminal-cli.git
  2. Navigate to the project root cd bank-terminal-cli
  3. Create a build folder and navigate to it mkdir build && cd build
  4. Run cmake to create the makefile cmake ..
  5. Run the make file to build the executables make

Database Setup

After building the targets in the previous section, you should have 2 executables in the build folder

  • db_setup
  • bank_terminal_cli
  1. Open your database client (pgadmin, dbeaver, etc) and create a new database
  2. Back in the build folder, create a text file called conf (no extension)
  3. 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
    
  4. Run the db_setup to create the tables, function and trigger ./db_setup
  5. Verify that the following were created in the database:
    • users table
    • records table
    • fn_update_updated_at function

Running the app

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.

bank-terminal-cli's People

Contributors

kwameopareasiedu avatar

Stargazers

 avatar

Watchers

 avatar

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.