Skip to content

QT-Banking-System-Server is the server-side implementation of a banking system, developed using the Qt 6/C++ framework. The server handles client requests, performs database operations using PostgreSQL with Supabase hosting, and ensures secure and efficient communication between clients and the database.

License

Notifications You must be signed in to change notification settings

7osssam/QT-Banking-System-Server

Repository files navigation

QT-Banking-System-Server

Overview

QT-Banking-System-Server is the server-side implementation of a banking system, developed using the Qt 6/C++ framework. The server handles client requests, performs database operations using PostgreSQL with Supabase hosting, and ensures secure and efficient communication between clients and the database.

The server application is designed to be multi-threaded, enabling concurrent handling of multiple clients and requests. It includes features such as request handling, database operations, logging, and secure communication to provide a robust and reliable banking system.

Note

This project is part of a Banking System (TCP Client-Server) project, which includes the following repositories:

Features

  • Request Handling: Manages various client requests such as user management, transaction processing, and data retrieval.
  • Database Operations: Performs CRUD operations on user accounts and transaction records.
    • By using the Database Module, the server can connect to the database, execute queries, and handle results in a multi-threaded environment using Qt's QThreadStorage for thread-local storage.
  • Logging: Logs server activities and client requests for monitoring and debugging purposes in a multi-threaded fashion.
    • For more details, see the LogByThread library used in the project.
  • Secure Communication: Implements security measures to ensure secure communication with clients and database.
    • For example, hashing and encryption techniques are used to protect sensitive data.
  • Concurrency server: The server can handle multiple clients concurrently using Qt's QTcpServer and QTcpSocket classes.
    • The server can process multiple requests simultaneously using a thread pool.

Technologies Used

  • C++/Qt 6: Core language and framework for building the server application.
    • Qt Components: Core, Network and Sql modules.
  • PostgreSQL with Supabase: Database management system for handling data operations.
  • JSON: Data format for communication between client and server.
  • CMake: Build system for managing the build process.
  • GoogleTest: Framework for unit testing the application.
  • GitHub Actions: Continuous integration for automated testing and documentation generation.
  • Doxygen: Tool for generating documentation from source code.

Setup and Installation

Prerequisites

  • Qt 6.7.1 or later
  • CMake
  • MinGW or another compatible compiler
  • PostgreSQL database
  • Supabase account and configuration

Building the Project

  1. Clone the repository:
git clone https://github.com/7osssam/QT-Banking-System-Server.git
cd QT-Banking-System-Server
  1. Install dependencies:
make dependency
  1. Clean the project (optional):
make clean
  1. Build the project using the Makefile:
make build-debug

Running the Server

To run the server application, execute the following command:

make run

Request Handling

The server handles various requests through the RequestManager and specific request classes located in the requestModule/Requests directory. Each request class inherits from the base Request class and implements the necessary logic for processing the request, including validation, database operations, and response generation.

for more details, see the Requests Documentation.

  • This sequence diagram illustrates the process of handling a client request by the server: Request Handling Sequence Diagram

More detailed diagrams for each module can be found in the Modules Sequence Diagrams or docs/diagrams/ directory.

Database Operations

Database operations are managed through the dbModule (or DB namespace), which includes classes for connecting to the database, executing queries, and handling results in a multi-threaded environment using Qt's QThreadStorage for thread-local storage. This module is built as a separate library to ensure modularity and reusability across the server application.

  • This sequence diagram illustrates the process of the initialization of the database connection:

Database Connection Sequence Diagram

  • This sequence diagram illustrates the process of executing a query and handling the result:

Database Query Sequence Diagram

More detailed diagrams for each module can be found in the Modules Sequence Diagrams or docs/diagrams/ directory.

Testing

Unit tests are written using GoogleTest. To build and run the tests, execute the following command:

make test

Documentation

Comprehensive documentation is available, detailing the purpose, design, and usage of each class and function within the project. The documentation is generated using Doxygen and can be viewed by opening the docs/html/index.html file in a web browser or by visiting the GitHub Page site.

Continuous Integration

The project uses GitHub Actions for continuous integration. The build and test status can be monitored through the following badges:

Documentation Pages Build Deployment Ubuntu CI Test
Documentation pages-build-deployment Ubuntu CI Test

Contribution

Contributions are welcome! Please open an issue or submit a pull request for any changes or enhancements.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Happy coding!

About

QT-Banking-System-Server is the server-side implementation of a banking system, developed using the Qt 6/C++ framework. The server handles client requests, performs database operations using PostgreSQL with Supabase hosting, and ensures secure and efficient communication between clients and the database.

Resources

License

Stars

Watchers

Forks