WalletOne is a robust Java-based virtual credit card management system designed for efficient handling of card information, user data, and related operations, all in the command-line interface (CLI). For a detailed description and overview of WalletOne's main functionalities, see this blog post: Introducing WalletOne: An Interactive Java Backend App Featuring a Virtual Credit Card Management System.
- Add and remove credit cards with unique card numbers
- Manage multiple users per card
- Search functionality by zip code and user name
- Display detailed card information
- Constant-time card lookup using hash-based data structures
- Efficient user management with multi-key indexing
- Constant-time Card Lookup: Utilizes HashMap for O(1) card retrieval by card number
- Multi-key Indexing: Implements separate HashMaps for zip code and name-based user lookups
- Memory-efficient User Storage: Uses a shared User object across different indexes
- HashMap-based Card Storage:
The
CardManager
class uses aHashMap<String, Card>
(cardHashMap) for O(1) card retrieval by card number. - Scalable Architecture: Designed to handle a large number of cards and users efficiently
- Ensure you have Java Development Kit (JDK) 8 or higher installed on your system.
- Clone the repository:
git clone https://github.com/chriseborowski/walletone.git
- Navigate to the project directory:
cd walletone
- Compile the Java files:
javac -d bin src/walletone/*.java
- Run the main application:
java -cp bin walletone.Main
- Follow the on-screen prompts to interact with the system.
Card
: Represents a credit card with associated usersUser
: Represents a card user with name and zip codeCardManager
: Core class managing all card operations and user lookupsMain
: Entry point of the application (not provided in the context, but assumed to exist)
addNewCard
: Adds a new card to the systemremoveCard
: Removes a card and updates all related data structuresaddUserToCard
: Adds a new user to an existing cardsearchByZip
: Retrieves users by zip codesearchByName
: Retrieves users by nameshowAllCards
: Displays information for all cards in the system
- Card lookup: O(1) time complexity
- User lookup by zip code or name: O(1) average case, O(n) worst case where n is the number of users with the same zip code or name
- Adding/Removing cards: O(1) time complexity
- Adding users to a card: O(1) amortized time complexity
- Implement data persistence (database integration)
- Add user authentication and authorization
- Develop a graphical user interface (GUI)
- Implement card transaction tracking and analysis
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.