ambot nalang gyud ani nga project sakto pa ba ni among desisyon
Gemini-generated README ahead
A terminal-based Point of Sale (POS) and inventory management system written in C, featuring role-based access control, real-time inventory tracking, and transaction history management.
This application provides a complete solution for small to medium retail operations, offering separate interfaces for administrators and cashiers. The system uses CSV files as a lightweight database solution and provides an intuitive keyboard-driven interface with ANSI color support.
-
Account Management
- Enroll new user and admin accounts
- Modify account credentials (username, password, display name)
- Change account status (admin/user)
- Remove accounts (except the default admin)
-
Inventory Management
- Add new items with unique identifiers
- Update item names, stock levels, and prices
- Remove items from inventory
- Real-time stock tracking
-
Store Operations
- Toggle store status (open/closed)
- View comprehensive transaction histories across all cashiers
- Monitor sales and inventory in real-time
-
Point of Sale
- Quick item scanning with search functionality
- Real-time stock availability checking
- Multiple item selection with quantity management
- Transaction total calculation
-
Transaction History
- View personal transaction history
- Search transactions by item name or identifier
- Sorted by date (newest first)
-
Authentication System
- Secure login with username/password
- Role-based access control (Admin/User)
- Password masking with toggle visibility
-
Store Status Control
- Cashiers can only access the system when store is open
- Admins have unrestricted access
- C Compiler: GCC (MinGW for Windows)
- Operating System: Windows (uses Windows-specific libraries)
- Libraries:
stdio.h,stdlib.h,string.hconio.h(for keyboard input)windows.h(for Sleep function)time.h(for timestamps)
git clone <repository-url>
cd <project-directory>Use the provided compilation command:
gcc main.c Tools\Tools.c Tools\Database.c Pages\AdminPage\AdminPage.c Pages\AdminPage\Subpages\EnrollAccountPage.c Pages\AdminPage\Subpages\AddItemPage.c Pages\AdminPage\Subpages\ItemOperationsPage.c Pages\AdminPage\Subpages\AccountOperationsPage.c Pages\AdminPage\Subpages\TransactionHistoriesPage.c Pages\AdminPage\Subpages\StoreStatusPage.c Pages\UserPage\UserPage.c Pages\UserPage\Subpages\ScanPage.c Pages\UserPage\Subpages\ShowHistoryPage.c -o mainOr simply:
gcc main.c Tools/*.c Pages/AdminPage/*.c Pages/AdminPage/Subpages/*.c Pages/UserPage/*.c Pages/UserPage/Subpages/*.c -o main./main-
Login with Default Admin Account
- Username:
admin - Password:
admin
- Username:
-
Initial Configuration
- Add items to inventory
- Create user accounts for cashiers
- Set store status to "open" for cashier access
- Arrow Keys (
ββββ): Navigate menus and fields - Tab: Move to next field/option
- Enter: Confirm selection or submit
- Escape: Go back or logout
- Backspace: Delete character or reduce quantity
- =: Toggle password visibility (on password fields)
- Home/End: Jump to first/last item in lists
- Delete: Remove selected item (in Scan Page)
- 0-9: Input numbers for quantities and prices
- A-Z: Input text for names and searches
-
Adding Items
- Navigate to "Add Item"
- Enter item name, identifier, initial stock, and price
- Press Enter to confirm
-
Managing Inventory
- Use "Item Operations Page" to modify items
- Search by name or identifier
- Select operation (rename, change stock, change price, remove)
-
User Management
- Use "Add Account" to create new users
- Use "Account Operations Page" to modify or remove accounts
-
Monitoring Sales
- "Transaction Histories" shows all sales across cashiers
- Search by cashier name, item, or date
-
Making a Sale
- Navigate to "Scan Page"
- Search for items by name or identifier
- Press number keys (0-9) to set quantity
- Press Enter to complete transaction
-
Viewing History
- Navigate to "View Transactions"
- Search your transaction history
- View sorted by date
.
βββ main.c # Entry point, login system
βββ Tools/
β βββ Tools.h/c # Utility functions (ANSI colors, keyboard input, etc.)
β βββ Database.h/c # Database operations (CSV management)
β βββ FieldType.h # Field type definitions
βββ Pages/
β βββ AdminPage/
β β βββ AdminPage.h/c # Admin main menu
β β βββ Subpages/
β β βββ EnrollAccountPage.c # Account creation
β β βββ AddItemPage.c # Item creation
β β βββ ItemOperationsPage.c # Item management
β β βββ AccountOperationsPage.c # Account management
β β βββ TransactionHistoriesPage.c # Sales reports
β β βββ StoreStatusPage.c # Store open/close toggle
β βββ UserPage/
β βββ UserPage.h/c # Cashier main menu
β βββ Subpages/
β βββ ScanPage.c # POS interface
β βββ ShowHistoryPage.c # Transaction history
βββ Databases/ # Auto-created CSV databases
βββ accounts.csv # User accounts
βββ items.csv # Inventory items
βββ isOpen.csv # Store status
βββ transactions/ # Individual cashier transaction logs
βββ <identifier>.csv
username|password|displayName|status|identifier
status: "admin" or "user"identifier: 32-character unique ID
Item Name|Item Identifier|Item Remaining Stocks|Item Price
- All fields required, pipe-delimited
Item Name|Item Identifier|Stocks Sold|DateTime
- One file per cashier
- DateTime format: "Month DD, YYYY"
true
or
false
Administrator Account:
- Username:
admin - Password:
admin - Identifier:
ehyxccqfugqXgM6Q7QXKPChO3iPffF8o
Important: This account cannot be deleted through the UI.
- Real-time filtering: Search results update as you type
- Multi-field search: Search across names, identifiers, and dates
- Case-insensitive: Searches ignore case differences
- Auto-stock deduction: Stock levels automatically decrease on sale
- Timestamp tracking: All transactions are timestamped
- Sorted history: Transactions sorted by date (newest first)
- Per-cashier logs: Each cashier has their own transaction file
- Duplicate prevention: Item identifiers must be unique
- Stock validation: Cannot sell more than available stock
- Price management: Prices stored as integers (in cents or smallest currency unit)
- Windows-only (uses
conio.handwindows.h) - CSV-based storage (not suitable for very large datasets)
- No data encryption
- No backup/restore functionality
- Terminal-based UI (no graphical interface)
- Single-user at a time (no concurrent access)
Error: conio.h not found
- Ensure you're using MinGW on Windows
- Linux/Mac users need to replace
conio.hfunctions with alternative input methods
Error: windows.h not found
- This is a Windows-specific application
- To port to Linux/Mac, replace
Sleep()withusleep()ornanosleep()
Databases not created
- The application automatically creates the
Databasesfolder on first run - Ensure you have write permissions in the application directory
Store always closed for cashiers
- Admin must set store status to "open" in Store Status Page
- Check
Databases/isOpen.csvcontains "true"
Items not appearing in search
- Verify items exist in
Databases/items.csv - Check file format matches schema (pipe-delimited)
externkeyword usage- Modularization techniques
- Unions and structs
- File tokenizing with
strtok() - Pointer arithmetic and dereferencing
- Arrow notation for struct access
- File operations (
fopen(),fclose(),fprintf()) - String formatting with
snprintf() - Random number generation with
srand() - Directory creation with
_mkdir() size_ttype usage- Variable-width printf formatting (
%*s) - String duplication with
strdup() - Static keyword for local scope
- Variadic functions with
stdarg.h gotostatement usage
This appears to be an educational project. If you'd like to enhance it:
-
Code improvements
- Add data validation
- Implement error handling
- Add data backup/export features
- Cross-platform compatibility
-
Feature additions
- Receipt printing
- Barcode scanner support
- Sales reports and analytics
- Multi-currency support
- Database encryption
-
UI enhancements
- Color customization
- Better navigation indicators
- Help screens
- Keyboard shortcuts reference
This project appears to be an educational/learning project. Please check with the original authors for licensing information.
Based on the README note in Bisaya (Cebuano):
"ambot nalang gyud ani nga project sakto pa ba ni among desisyon" (Translation: "I don't know about this project anymore, was our decision right?")
This appears to be a student project. The dedication to learning C programming is evident in the comprehensive implementation!
- Project uses ANSI escape codes for terminal colors
- CSV format for lightweight data persistence
- Inspired by real-world POS systems
Note: This is a terminal-based application designed for educational purposes and small-scale retail operations. For production use, consider implementing proper database systems, security measures, and concurrent access controls.