{"id":21733913,"url":"https://github.com/marco3211/shopping-app","last_synced_at":"2026-04-08T11:33:34.844Z","repository":{"id":260489363,"uuid":"881445138","full_name":"marco3211/shopping-app","owner":"marco3211","description":"A modern React shopping list app with Vite, Redux Toolkit, and TailwindCSS. Features drag-and-drop reordering and intuitive UI. Infrastructure managed with Terraform and Ansible for scalable deployment.","archived":false,"fork":false,"pushed_at":"2024-11-20T16:28:11.000Z","size":227,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T12:27:09.143Z","etag":null,"topics":["ansible","aws","ec2","flowbite-react","react","redux","redux-toolkit","tailwind","terraform","vite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/marco3211.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}},"created_at":"2024-10-31T15:30:57.000Z","updated_at":"2024-11-20T16:28:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"e022f90c-5bcd-457f-8f8c-fe40b17d4adb","html_url":"https://github.com/marco3211/shopping-app","commit_stats":null,"previous_names":["marco3211/shopping-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marco3211/shopping-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco3211%2Fshopping-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco3211%2Fshopping-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco3211%2Fshopping-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco3211%2Fshopping-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marco3211","download_url":"https://codeload.github.com/marco3211/shopping-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco3211%2Fshopping-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31554094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ansible","aws","ec2","flowbite-react","react","redux","redux-toolkit","tailwind","terraform","vite"],"created_at":"2024-11-26T05:07:00.113Z","updated_at":"2026-04-08T11:33:34.821Z","avatar_url":"https://github.com/marco3211.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Application Overview\n\nThis React application is built using Vite, a tool that provides fast development and hot module replacement (HMR) capabilities. The app is designed to manage shopping lists with features like drag-and-drop reordering and persistent state management using Redux. Users can create, edit, and delete lists, with changes reflected instantly across the application.\n\nThe application's infrastructure is managed using Terraform and Ansible, allowing for automated provisioning and configuration of AWS resources. This setup ensures a scalable and reliable environment for deploying and running the application.\n\n## Key Technologies and Configurations\n\n- **Vite**: A build tool with HMR that allows developers to see changes in real-time without the need to refresh the entire page.\n- **React**: The core library for building UI components.\n- **Redux Toolkit**: Utilized for state management. Simplifies the setup and management of global state in the application, ensuring consistent state across different pages and components.\n- **React Router**: Enables client-side routing, providing a seamless single-page application (SPA) experience.\n- **TailwindCSS**: A utility-first CSS framework, configured with PostCSS to enable custom configurations and optimizations.\n- **Flowbite**: A component library built on top of TailwindCSS, providing pre-designed UI components.\n- **IndexedDB**: Used for persistent storage of lists, ensuring data is saved locally and can be retrieved even after a page refresh.\n- **PostCSS**: A tool that helps transform CSS with JavaScript plugins.\n- **ESLint**: Helps enforce standards and best practices.\n\n## Design and Implementation Decisions\n\n- **Component-Based Architecture**: The application promotes reusability of components and separation of concerns. Each component has a specific functionality, making the code easier to understand and maintain.\n- **Performance Optimization**: Vite's fast build process and HMR capabilities significantly reduce development time and improve developer experience.\n- **User Experience**: The application provides a simple UI for managing shopping lists. Features like drag-and-drop reordering, real-time validation, and error handling enhance the user experience by providing immediate guidance and feedback.\n- **Instant Updates**: Changes to lists, such as updates or deletions, are reflected instantly across the application without the need for a page refresh.\n- **UI Components**: Flowbite is used to provide pre-designed UI components, enhancing the design and functionality of the application.\n\n## Application Structure\n\nThe application is structured into several components, pages, and state management:\n\n- **Components**: Reusable UI elements that can be used across different pages. These are located in the `src/components` directory.\n  - `CreateListCard.jsx`: Component for creating a new list.\n  - `Header.jsx`: Component for the application header.\n  - `ListCard.jsx`: Component for displaying individual list items, with functionality for editing and deleting lists.\n\n- **Pages**: Main views or screens of the application, often representing a route. These are located in the `src/pages` directory.\n  - `CreateAccountPage.jsx`: Page for creating a new account.\n  - `CreateListPage.jsx`: Page for creating a new list.\n  - `EditListPage.jsx`: Page for editing an existing list.\n  - `FullListPage.jsx`: Page for viewing all items in a list.\n  - `Home.jsx`: Home page of the application, featuring drag-and-drop reordering of lists.\n  - `ListsPage.jsx`: Page for displaying all lists, reflecting the current state from Redux.\n\n- **Redux**: State management for the application. The Redux-related files are located in the `src/redux` directory.\n  - `store.js`: Configures the Redux store.\n  - `slices/`: Contains Redux slices for different parts of the state.\n  - `actions.js`: Defines action types and creators for managing lists.\n  - `reducers.js`: Handles state changes based on dispatched actions.\n\n- **Utilities**: Helper functions and utilities used across the application. These are located in the `src/utils` directory.\n  - `indexedDB.js`: Utility for handling IndexedDB operations, ensuring persistent storage of lists.\n\n## Infrastructure Setup\n\nThe infrastructure for this application is managed using Terraform and Ansible, with setup scripts provided for local environment preparation.\n\n### Setup Scripts\n\n- **Ansible Installation**: `aws-setup/utils/install-ansible.sh` installs Ansible for configuration management.\n- **AWS CLI V2 Installation**: `aws-setup/utils/install-aws-cli-v2.sh` installs AWS CLI V2 for interacting with AWS services.\n- **Terraform Installation**: `aws-setup/utils/install-terraform.sh` installs Terraform for infrastructure provisioning.\n\n### Infrastructure Provisioning\n\n- **Terraform Configuration**: `aws-setup/main.tf` defines the AWS infrastructure, including VPC, subnets, security groups, and EC2 instances.\n\n### Configuration Management\n\n- **Ansible Playbook**: `aws-setup/ansible/site.yml` configures the EC2 instances, setting up Git SSH, NVM, Node.js, and cloning the Git repository.\n\n## How to Run the Application\n\nMake sure to have `node` installed.\n\n### Installation Steps \n\nClone the Repository: \n\n```bash\ngit clone https://github.com/marco3211/shopping-app.git\n```\n\nNavigate to the directory: \n\n```bash\ncd shopping-app\n```\n\nInstall the dependencies: \n\n```bash\nnpm install \n```\n\n### Running the Application\n\nTo start the development server with HMR, run: \n\n```bash\nnpm run dev\n```\n\nTo build the application for production, run: \n\n```bash\nnpm run build\n```\n\nTo preview the production build locally, run: \n\n```bash\nnpm run preview\n```\n\nTo check the code for any linting errors with ESLint, run:\n\n```bash\nnpm run lint\n```\n\n## Swap Setup Script\n\nThe `setup_swap.sh` script is a utility to create and manage a swap file on your system. This can be useful for improving performance on systems with limited RAM.\n\n### Features\n\n- Checks if a swap file is already enabled and removes it before creating a new one.\n- Sets appropriate permissions and configures the swap file.\n- Makes the swap file permanent by adding it to `/etc/fstab`.\n- Adjusts system settings for swappiness and cache pressure to optimize performance.\n\nEnsure you have the necessary permissions to run the script, as it requires `sudo` access for certain operations.\n\n### Usage\n\nTo use the script, run the following command:\n\n```bash\n./setup_swap.sh -s \u003cswap_size\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarco3211%2Fshopping-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarco3211%2Fshopping-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarco3211%2Fshopping-app/lists"}