How devmike117/devmiketools works
1. Top-level shape
- This is a Vite + React 18 + TypeScript single-page app with a small serverless API layer under api/.
- The core product is a toolbox site: each page is a standalone tool, but most of the heavy work happens in the browser, not on a central backend.
2. Frontend shell and navigation
- src/main.tsx boots the app, src/App.tsx defines the top-level routes/layout, and src/pages/* contains the individual tool and content pages.
- The app includes marketing/content routes like Home, FAQ, Privacy, Terms, Contact, alongside tool routes like Compress, Convert, Editor, OcrTool, RemoveBg, Resize, UrlShortener, etc.
3. Tool architecture
- The main feature boundary is src/modules/*: each file encapsulates one domain capability such as image compression, conversion, OCR, background removal, password generation, email/phone validation, PDF conversion, directory tree generation, and IP geolocation.
- Pages in src/pages/* act mostly as orchestration layers that connect UI controls to these modules, then render results and download actions.
4. Shared UI layer
- src/components/* holds reusable building blocks used across tools: uploaders, previews, downloads, modals, navigation, sidebars, banners, history panels, and tool headers.
- This shared layer is important to the diagram because it separates tool-specific logic from reusable presentation and interaction patterns.
5. Client-side processing pipeline
- The default data flow is: user uploads or enters input → page component → module logic → processed output → preview/download UI.
- Supporting utilities in src/utils/* handle browser-side concerns like file-to-base64 conversion, zip downloads, canvas helpers, image validation, and Mermaid rendering.
6. Local-first privacy model
- The README explicitly states that most tools are processed locally in the browser, with no file uploads to a central app server.
- This means the architecture is largely client-only for document/image/media processing, with downloads generated locally through browser APIs.
7. State, auth, and user experience
- src/context/UserContext.tsx and src/utils/auth.ts provide app-wide user/session state.
- src/config/firebase.ts wires in Firebase Auth for optional Google sign-in, while hooks like usePremium, useGuestLimits, useHistory, and useCountVisit manage user status, guest restrictions, local history, and usage tracking.
8. Guest/premium and history boundaries
- The app has a soft monetization/limitation layer: guest users are constrained through GuestLimitBanner, GuestLimitDebug, and the useGuestLimits hook.
- HistoryPanel plus useHistory provide local activity history so users can return to recent tools/actions without server-side storage.
9. Serverless API layer
- The api/ directory suggests deployment as Vercel serverless functions rather than a traditional backend.
- Key endpoints include proxy.ts and unshorten.js, plus counter.js for visit counting; middleware under api/middleware/* adds validation, rate limiting, and centralized error handling, and api/security/check-ip.js indicates request/IP checks.
10. When the app leaves the browser
- Network/server interaction seems limited to a few specific concerns: authentication, visit counting, URL expansion/proxying, and possibly security checks.
- The diagram should show the frontend as the primary system, with serverless APIs as a narrow supporting edge for tasks that cannot or should not be done purely client-side.
11. Assets, styling, and composition
- Static images live under public/img/*, including tool icons and UI art, while global styling is split across src/index.css, src/App.css, and tool/editor-specific CSS files.
- Tailwind is configured in the repo, but the architecture remains component-driven with page-level composition.
12. External integrations and constraints
- The only clearly material external service is Firebase for auth.
- Everything else is oriented around browser-native capabilities such as Canvas, file handling, downloads, and likely WebAssembly-backed processing for performance-sensitive tools.
13. How to diagram it
- A good architecture diagram would show:
- Browser SPA at the center
- Page components orchestrating UI
- Shared components and tool modules beneath them
- Local browser APIs for file/canvas/download processing
- Firebase Auth as an external identity provider
- Vercel serverless functions as a small support layer for proxying, URL unshortening, counting, and request protection
Main entry points: pages Tool pages · components Shared UI · hooks App hooks · api Serverless API
Components 22
Browser SPA
Vite + React app that runs the tool experiences in the browser.
- App boot · Starts the React application.
src/main.tsx - Router shell · Top-level layout and routing for pages and tool routes.
src/App.tsx - Tool pages · Standalone pages that connect UI controls to tool modules and results.
src/pages - Content pages · Home and informational pages like FAQ, privacy, terms, contact, and installation guidance.
src/pages/Home.tsx
UI Layer
Shared components and app shell used across pages.
- Shared UI · Reusable presentation and interaction components across tools.
src/components - Tool chrome · Headers, navigation, sidebars, upload, preview, download, and modal patterns.
src/components/ToolHeader.tsx - Guest gates · Banners and debug surfaces that communicate guest restrictions.
src/components/GuestLimitBanner.tsx - History panel · Shows local recent actions and tool history.
src/components/HistoryPanel.tsx
Tool Logic
Domain modules and helper utilities that perform local processing.
- Tool modules · Browser-side processing modules for each major tool capability.
src/modules - Image tools · Compression, resize, background removal, OCR, thumbnails, HEIC and related image flows.
src/modules/imageProcessing.ts - Doc/media tools · Conversion, PDF, media, and document transformations that run locally.
src/modules/convert.ts - Text/lookup tools · Password generation, validation, directory trees, IP lookup, and scraping helpers.
src/modules/passwordGenerator.ts - Browser helpers · Canvas, downloads, file encoding, zip creation, image validation, and Mermaid rendering.
src/utils
State & Auth
User session, premium gating, history, and usage tracking.
- App hooks · Shared hooks for premium state, guest limits, history, images, and visit counts.
src/hooks - User context · App-wide user and session state provider.
src/context/UserContext.tsx - Auth utils · Utilities for auth/session handling.
src/utils/auth.ts
Serverless API
Narrow backend surface for proxying, counting, and request protection.
- Serverless API · Small Vercel-style function layer for non-browser tasks.
api - Proxy/expand · Proxies requests and unshortens URLs when browser-only handling is not enough.
api/proxy.ts - Visit counter · Tracks visits or usage counts.
api/counter.js - Security checks · Validation, rate limiting, error handling, and IP checks for API requests.
api/security/check-ip.js
External Services
Third-party services used by the app.
- Firebase auth · Optional Google sign-in and authentication wiring.
src/config/firebase.ts - Browser APIs · Canvas, file handling, downloads, and other local-first browser capabilities.
Connections 20
- App boot → Router shell: mounts · Bootstraps the top-level app shell.
- Router shell → Tool pages: routes to · Routes users to standalone tool and content pages.
- Router shell → Shared UI: composes · Uses shared navigation and layout components.
- Tool pages → Tool chrome: uses · Pages wrap tool UIs with shared controls and chrome.
- Tool pages → Tool modules: orchestrates · Pages pass input into processing modules and render output.
- Tool modules → Browser helpers: depends on · Modules rely on browser helpers for files, canvases, downloads, and rendering.
- Tool modules → Browser APIs: runs in · Primary processing happens locally in the browser.
- Shared UI → Guest gates: includes · Shared UI includes guest restriction surfaces.
- Shared UI → History panel: includes · Shared UI includes local history views.
- App hooks → User context: reads · Hooks consume app-wide user state.
- App hooks → Auth utils: uses · Hooks and state logic use auth helpers.
- Auth utils → Firebase auth: connects · Auth utilities connect to Firebase authentication.
- App hooks → Shared UI: drives · Hooks feed guest banners, premium state, and visit/history UI.
- Serverless API → Proxy/expand: exposes · Serverless layer includes request proxying and URL expansion.
- Serverless API → Visit counter: exposes · Serverless layer includes visit counting.
- Serverless API → Security checks: protects · Middleware and security checks guard API requests.
- Tool pages → App hooks: consults · Pages consult hooks for history, guest limits, and usage state.
- Tool pages → User context: consumes · Pages use user/session context for gated experiences.
- Tool pages → Serverless API: calls · A few tool flows reach the serverless boundary for network-only tasks.
- Shared UI → Browser APIs: renders through · Upload, preview, download, and canvas-driven components depend on browser APIs.