How gustavscirulis/snapgrid works
Main Components
• Electron Main Process: Located in the “electron” directory (files such as main.js, preload.cjs, secureStorage.cjs) handle window management, IPC communications, and integration with Node.js capabilities.
• Renderer Process: The front-end is built in the “src” folder. The entry point is main.tsx, with pages (e.g., Index.tsx, NotFound.tsx), various reusable React components (inside src/components and src/components/ui), and hooks/services (in src/hooks and src/services).
• Build & Configuration Tools: Vite (vite.config.ts), TypeScript (various tsconfig files), Tailwind CSS configurations (tailwind.config.ts), and Electron Builder (electron-builder.json) are used in bundling and building processes.
• External Services and APIs: The app interfaces with the OpenAI Vision API (indicated in src/services/aiAnalysisService.ts) to power AI detection, and a separate analytics and update service handle usage tracking and app updates.
• Local Storage: According to the README, SnapGrid stores images, metadata, and a “trash” folder on disk in user-specific directories (e.g., ~/Documents/SnapGrid on macOS).
Architectural Patterns and Design Principles
• Modularity of the ui/components (with reusable UI segments) and the clean separation of concerns among services (AI analysis, analytics, updates).
• That the build process (using Vite and Electron Builder) encapsulates the entire project, preparing it for cross-platform deployment.