This project is an advanced ATM Management System written in C for Zone01 Athens. It allows users to register, log in, create accounts, perform transactions (deposits/withdrawals), and transfer account ownership securely.
- Relational Database Integration: Migrated from legacy text file storage to
SQLite3for robust,O(1)data persistence and querying. - Instant Notifications: Real-time inter-process communication using
SIGUSR1to notify users instantly when an account is transferred to them. - Robust Input Validation: Do-while validation loops protecting all
scanfinputs from buffer overflows or infinite loops on invalid input types. - Encrypted Credentials: Passwords are encrypted (Caesar Cipher) before being written to the database.
- Advanced Interest Calculations: Precise date parsing and unlock-date calculations for Fixed accounts.
The ATM system supports different types of accounts, each with its own rules for interest and transactions:
- Saving Account (
saving): Allows free deposits and withdrawals. Accrues 7% interest per year (distributed monthly on the day of deposit). - Fixed Account 1 Year (
fixed01): No deposits or withdrawals allowed. Locks funds for 1 year and yields 4% total interest. - Fixed Account 2 Years (
fixed02): No deposits or withdrawals allowed. Locks funds for 2 years and yields 10% total interest (5% per year). - Fixed Account 3 Years (
fixed03): No deposits or withdrawals allowed. Locks funds for 3 years and yields 24% total interest (8% per year).
Make sure you have sqlite3 and standard C compilation tools (like gcc and make) installed. If you are on Linux/Ubuntu, you can install the database library via sudo apt install libsqlite3-dev.
We use a Makefile to handle compilation. Simply run:
make./atmThe system automatically generates its database (bank.db) inside the data/ directory when it runs. To verify that users, encrypted passwords, and accounts are stored correctly, you can open the database directly from your terminal.
- Ensure you are in the project's root directory.
- Open the database using the SQLite CLI:
sqlite3 ./data/bank.db
- Useful SQLite Commands:
- See all tables:
.tables
- View all registered users (notice the encrypted passwords!):
SELECT * FROM users;
- View all bank accounts:
SELECT * FROM records;
- Turn on headers and column mode for better readability:
.mode column .header on SELECT * FROM records;
- Exit SQLite:
.quit
- See all tables:
- Developed by: Elena Chanou