{"id":31260007,"url":"https://github.com/nullhawk/book-analysis-lld","last_synced_at":"2025-09-23T08:47:19.979Z","repository":{"id":310708756,"uuid":"1040915196","full_name":"nullHawk/book-analysis-lld","owner":"nullHawk","description":"LLD assigment","archived":false,"fork":false,"pushed_at":"2025-08-19T18:21:52.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T20:25:44.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullHawk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T17:39:22.000Z","updated_at":"2025-08-19T18:21:56.000Z","dependencies_parsed_at":"2025-08-19T20:26:13.291Z","dependency_job_id":"ed2cf76a-eda6-4458-96be-6bc732c96c53","html_url":"https://github.com/nullHawk/book-analysis-lld","commit_stats":null,"previous_names":["nullhawk/book-analysis-lld"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nullHawk/book-analysis-lld","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fbook-analysis-lld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fbook-analysis-lld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fbook-analysis-lld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fbook-analysis-lld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullHawk","download_url":"https://codeload.github.com/nullHawk/book-analysis-lld/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fbook-analysis-lld/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276545729,"owners_count":25661361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-23T08:47:18.528Z","updated_at":"2025-09-23T08:47:19.967Z","avatar_url":"https://github.com/nullHawk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amazon Bestseller Book Analysis\n\nA Java application that demonstrates **Low-Level Designs** and **optimal data structures** for efficient retrieval of book data from Amazon's Top 50 bestselling books dataset (2009-2019).\n\n## Screenshots\n![ezgif-54cac3f0db53cf](https://github.com/user-attachments/assets/622cdb8d-829b-46c1-b056-5a938131bf28)\n\n## Project Architecture\n\nThe project follows a clean, layered architecture with proper separation of concerns:\n\n```\nsrc/com/nullhawk/books/\n├── controllers/          # Application flow control\n│   └── ApplicationController.java\n├── model/               # Data entities\n│   └── Book.java\n├── services/            # Business logic and data access\n│   ├── BookService.java\n│   ├── InMemoryLoader.java\n│   └── GUIDataService.java\n├── views/               # User interface components\n│   ├── BookAnalysisView.java\n│   └── LauncherView.java\n├── utils/               # Utility classes\n│   └── ApplicationUtils.java\n├── Main.java            # Application entry point\n├── BookAnalysisDemo.java # Console demonstration\n└── DataStructureTest.java # Performance verification\n```\n\n## Features\n\n- **O(1) Time Complexity** for author and rating lookups using HashMap indexing\n- **Professional Java Swing GUI** with intuitive interface\n- **Console Interface** for automation and scripting\n- **Performance Testing** with real-time metrics\n- **Clean Architecture** following SOLID principles\n- **Robust CSV Parsing** with quoted field support\n\n## Required Tasks Implementation\n\n✅ **Get total number of books by a given author** - O(1) HashMap lookup  \n✅ **Print names of all unique authors** - O(1) HashSet retrieval  \n✅ **Get names of all books by author** - O(1) HashMap lookup + Stream mapping  \n✅ **Get books with specific rating** - O(1) HashMap lookup  \n✅ **Get book names and prices by author** - O(1) HashMap lookup + Stream collection  \n\n## Prerequisites\n\n- **Java 8 or higher**\n- **PowerShell** (Windows) or **Bash** (Linux/Mac)\n\n## Quick Start\n\n### Option 1: Run with Scripts (Recommended)\n\n#### Windows (PowerShell)\n```powershell\n# Run the application\n.\\run.ps1\n\n# Build distributable JAR\n.\\build-jar.ps1\n```\n\n#### Linux/Mac (Bash)\n```bash\n# Make scripts executable\nchmod +x run.sh build-jar.sh\n\n# Run the application\n./run.sh\n\n# Build distributable JAR\n./build-jar.sh\n```\n\n### Option 2: Manual Compilation\n\n```bash\n# Compile the project\njavac -d build -cp src src/com/nullhawk/books/*.java src/com/nullhawk/books/model/*.java src/com/nullhawk/books/services/*.java src/com/nullhawk/books/views/*.java src/com/nullhawk/books/controllers/*.java src/com/nullhawk/books/utils/*.java\n\n# Copy resources\ncp -r resources build/\n\n# Run the application\ncd build\njava -cp . com.nullhawk.books.Main\n```\n\n## Usage\n\n### Application Launcher\nThe application starts with a launcher that allows you to choose between:\n\n1. **GUI Version** - Interactive Java Swing interface\n2. **Console Version** - Command-line interface\n\n### GUI Features\n- **Query Operations**: Author lookups, rating filters, genre analysis\n- **Advanced Queries**: Year ranges, price ranges, top-rated books\n- **Performance Testing**: Real-time O(1) vs O(n) comparisons\n- **Dataset Information**: Comprehensive data statistics\n\n### Console Features\n- **Interactive Demos**: All required tasks with examples\n- **Performance Verification**: Data structure efficiency tests\n- **Batch Operations**: Multiple queries in sequence\n\n## Performance Characteristics\n\n| Operation | Time Complexity | Data Structure |\n|-----------|-----------------|----------------|\n| Author lookup | **O(1)** | HashMap |\n| Rating lookup | **O(1)** | HashMap |\n| Unique authors | **O(1)** | HashSet |\n| Genre filtering | **O(n)** | Stream + ArrayList |\n| Year range filtering | **O(n)** | Stream + ArrayList |\n| Top-rated books | **O(n log n)** | Stream + Sorting |\n\n## Design Patterns\n\n- **Service Layer Pattern**: Business logic separation\n- **Repository Pattern**: Data access abstraction\n- **Builder Pattern**: Immutable object creation\n- **MVC Architecture**: Model-View-Controller separation\n- **Observer Pattern**: Asynchronous data loading\n\n## Project Structure\n\n```\nbooks/\n├── resources/\n│   └── data.csv                 # Amazon bestseller dataset\n├── src/\n│   └── com/nullhawk/books/\n│       ├── controllers/          # Application flow control\n│       ├── model/               # Data entities\n│       ├── services/            # Business logic \u0026 data access\n│       ├── views/               # User interface components\n│       ├── utils/               # Utility classes\n│       └── Main.java            # Entry point\n├── build/                       # Compiled classes\n├── dist/                        # Distribution packages\n├── run.sh                       # Bash run script\n├── run.ps1                      # PowerShell run script\n├── build-jar.sh                 # Bash JAR build script\n├── build-jar.ps1                # PowerShell JAR build script\n└── README.md                    # This file\n```\n\n## Build Scripts\n\n### Run Scripts\n- **`run.sh`** / **`run.ps1`**: Compile and run the application\n- **`build-jar.sh`** / **`build-jar.ps1`**: Create distributable JAR\n\n### Script Features\n- **Automatic compilation** with dependency management\n- **Resource copying** to build directory\n- **Error handling** with colored output\n- **Cross-platform** support (Windows/Linux/Mac)\n\n## Performance Results\n\nThe application demonstrates significant performance improvements:\n\n- **Author lookups**: 277x faster than linear search\n- **Rating lookups**: O(1) average case performance\n- **Memory efficiency**: Optimal data structure usage\n- **Scalability**: Linear indexing time, constant lookup time\n\n## Testing\n\n### Built-in Performance Tests\n- **HashMap vs Linear Search** comparison\n- **Real-time performance metrics**\n- **Time complexity verification**\n- **Memory usage analysis**\n\n### Manual Testing\n- **GUI Interface**: Interactive query testing\n- **Console Interface**: Batch operation testing\n- **Edge Cases**: Invalid inputs, boundary conditions\n\n## Future Enhancements\n\n1. **Database Integration**: Replace in-memory storage\n2. **Caching Layer**: Redis implementation\n3. **API Endpoints**: RESTful web services\n4. **Real-time Updates**: Event-driven architecture\n5. **Analytics Dashboard**: Data visualization\n6. **Enhanced GUI**: Charts, graphs, advanced filtering\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullhawk%2Fbook-analysis-lld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullhawk%2Fbook-analysis-lld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullhawk%2Fbook-analysis-lld/lists"}