How karakanb/devo works
Project Type & Purpose
• Devo is a browser extension (for both Google Chrome and Mozilla Firefox) that serves as a custom new-tab page by aggregating content from several platforms (GitHub Trending, Hacker News, Product Hunt, Designer News, DEV Community, Lobsters, and TabNews).
• Its key functionality is to fetch and display external web content while locally caching the data for 30 minutes to reduce API calls and improve performance.
• The front-end is built using Vue.js. The extension uses Vue single-file components (with .vue extensions), custom layouts, and a state management layer (store.js) for handling application state and caching.
Analysis of the File Structure
• Top-Level Files & Configurations:
• Files like package.json, babel.config.js, vue.config.js, .gitignore, and .editorconfig indicate standard JavaScript (Vue) project configurations and build settings.
• The presence of Netlify configuration (netlify.toml) and several GitHub workflows (in .github/workflows) suggest CI/CD integration and automated testing/analysis.
• Public Directory:
• index.html, which is likely the root HTML file for the extension’s new tab UI.
• src Directory:
• Contains App.vue – the main application component.
• The components directory is structured with subdirectories for each supported platform (GitHub, Hacker News, ProductHunt, etc.) where each platform’s UI components (typically named Body.vue and Row.vue) are defined.
• layouts directory offers multiple layout options (e.g., SingleColumn, TwoColumns, ThreeColumns) that the UI can use in order to render the news cards or platform components flexibly.
• settings.js and store.js imply that platform configurations and state management (possibly including caching logic) are handled in these files.
• The bodies.js file is a central point for managing and exporting the different platform body components.
• Scripts Directory:
• Contains deployment and build-related scripts (e.g., deploy-chrome.sh, prepare-zip.sh, update-manifest.sh), which are useful for building and packaging the extension.
• Browser Environment:
• “Client Browser” where the extension operates. This includes two primary runtime contexts:
▸ The New Tab UI (rendered from public/index.html and bootstrapped by src/main.js).
▸ The Background Script (public/background.js) which may handle background tasks such as managing cache timing.
• UI Layer (Front-end) Components:
• Main Application Component (App.vue): This is the central Vue component that ties the UI together.
• Layouts: Illustrate the different layout components (from src/layouts) such as SingleColumn, TwoColumns, etc. They determine how content (cards) is arranged.
• News/Platform Cards: Represent each platform’s group of components. For example, separate sub-modules for GitHub, Hacker News, Product Hunt, Designer News, DEV Community, Lobsters, and TabNews. Each group includes a Body component and a Row component.
• Shared Components: Elements like Card.vue, PlatformCard.vue, LayoutSelect.vue, ToggleSwitch.vue, and Loading.vue that provide shared visuals or UI interactions.
• Data & State Management Layer:
• Settings (settings.js): Represent configuration details for each platform.
• Bodies Aggregator (bodies.js): Acts as a registry for platform-specific display components.
• External Services:
• Caching Mechanism: Show that the extension caches data for 30 minutes at the client side, possibly by representing local storage (or in-memory caching) in conjunction with store.js.
• Build & Deployment:
• Deployment Scripts: Represent the processes involved by the scripts (e.g., deploy-chrome.sh for packaging the extension, update-manifest.sh for managing manifest versioning).
• CI/CD Pipelines: Highlight the GitHub workflows (and Netlify deployment) showing that code quality and deployment automation are integral parts of the development lifecycle.
Architectural Patterns & Design Principles
• Component-Based Architecture: Emphasize that the UI is composed of multiple, reusable Vue components organized by functionality.
• Separation of Concerns: Illustrate how the UI, state management (store), and configuration (settings) are separated. This further extends to separating content from presentation (using layout components).
• Extensibility: Note that adding new platforms is straightforward by following standardized component patterns (adding a body component, updating the bodies.js registry, modifying settings.js, and store.js)—this design promotes good maintainability and scalability.