# ajacin/daves-log architecture

> Architecture diagram of the GitHub repository ajacin/daves-log, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ajacin/daves-log
- Repository: https://github.com/ajacin/daves-log

## Overview

1. **Overall shape**
   - This is a **Create React App single-page application** with a fairly modular front end and a thin backend edge layer.
   - The main runtime is the browser; the app is deployed as static assets from the `build/` output, with Netlify handling hosting and redirects.

2. **Primary architecture boundary**
   - The frontend talks to **Appwrite** through `src/lib/appwrite.js` and the context providers under `src/lib/context/`.
   - That Appwrite boundary appears to be the system’s core backend integration for **authentication, user state, and persisted domain data**.

3. **Domain subsystems**
   - The app is organized around several feature areas exposed as pages:
     - **Tasks** (`src/pages/Tasks.jsx`)
     - **Activities** (`src/pages/Activities.jsx`, `ViewActivities.jsx`, `ActivityLog.jsx`)
     - **Ideas** (`src/pages/Ideas.jsx`)
     - **Automations** (`src/pages/Automations.jsx`)
     - **Invitees** (`src/pages/Invitees.jsx`)
     - **Settings** (`src/pages/Settings.jsx`)
   - This suggests a productivity/workflow application with multiple record types rather than a single-purpose UI.

4. **State management model**
   - Domain state is centralized in React context providers in `src/lib/context/`.
   - Separate providers exist for **tasks, activities, activity log, automations, ideas, invitees, settings, and user state**.
   - The likely data flow is: page/component → context hook/provider → Appwrite or local persistence → updated UI state.

5. **Authentication and access control**
   - Authentication-related UI lives in `src/pages/Login.jsx`, `Register.jsx`, and likely `Home.jsx` / `Landing.jsx`.
   - Access control is enforced in the component layer via `PermissionGuard`, `ProtectedLayout`, and `PermissionErrorModal`.
   - This indicates route-level protection and role/permission checks are part of the frontend architecture, not just backend rules.

6. **Task creation and natural-language input**
   - A notable feature is **smart task entry**:
     - `BulkTaskInput`, `SimpleBulkInput`, `QuickAddTask`, `SmartDateTextarea`, `EnhancedTaskParser`, `DateSuggestionDropdown`
     - shared parsing logic in `src/lib/utils/dateParser.js`
   - The architecture supports turning free-form text into structured tasks with dates/times, which is a distinct preprocessing layer before persistence.

7. **AI-assisted task generation**
   - There is a dedicated Netlify serverless function at `netlify/functions/ai-task-gen.js`.
   - The client-side wrapper in `src/lib/api/aiTaskGen.js` suggests the UI calls this function rather than contacting the AI provider directly.
   - This creates an explicit backend edge for AI features, isolating credentials and provider-specific logic from the browser bundle.

8. **Activity capture and logging**
   - The app includes a separate activity subsystem with components such as `ActivityForm`, `QuickAdd`, `ActivityIcon`, `ActivityTime`, `LastActivity`, and `TimeAgo`.
   - `src/lib/activityLogger.js` and the `activityLog` context indicate activity events are recorded and then surfaced in the UI.
   - This looks like a timeline/audit stream layered alongside primary task/idea data.

9. **UI composition**
   - Reusable UI is heavily componentized in `src/components/`, with clear feature-specific groupings:
     - navigation and shell: `Navbar`, `Drawer`, `FloatingActionButton`
     - feedback and confirmation: `ConfirmationModal`, `SuccessModal`, `PermissionErrorModal`
     - task helpers: `QuickAddTask`, `BulkTaskInput`, `SelectBox`
   - The app likely uses a shared layout plus page-level composition rather than page-specific monoliths.

10. **Routing and app shell**
   - `src/App.jsx`, `src/main.jsx`, and `src/index.js` form the top-level bootstrapping and route/layout composition layer.
   - `Landing`, `Home`, `Dashboard`, and the feature pages imply a route map separating public entry points from protected application areas.

11. **Client-side platform features**
   - The presence of `public/service-worker.js`, `src/serviceWorkerRegistration.js`, `public/manifest.json`, and `public/robots.txt` shows PWA-oriented packaging.
   - `public/_redirects` and `netlify.toml` indicate SPA routing/redirect behavior is handled at deployment time for direct deep links.

12. **Testing and quality boundaries**
   - There is a meaningful test surface around shared components and utility logic: many `.test.jsx/.js` files, plus `jest.config.js`.
   - The most important testable boundaries appear to be **parsing, time/date rendering, modal flows, and key navigation components**.

13. **Operations and maintenance**
   - `.github/workflows/keep-appwrite-alive.yml` suggests an operational concern to keep the Appwrite backend active or warmed.
   - That reinforces the architecture’s dependency on an external backend service that may have idle/sleep behavior.

14. **What an architecture diagram should emphasize**
   - Draw the system as a **React SPA** at the center.
   - Show three main outbound integrations:
     - **Appwrite** for auth and persistent domain data
     - **Netlify Function** for AI task generation
     - **Static hosting/PWA assets** via Netlify and browser service worker
   - Inside the SPA, separate the **feature pages**, **shared UI components**, and **context/state layer** as distinct tiers, with the smart parsing utilities sitting between user input and persisted records.

Main entry points: [`src/App.jsx`](https://github.com/ajacin/daves-log/blob/main/src/App.jsx) (App shell), [`src/lib/context/activities.jsx`](https://github.com/ajacin/daves-log/blob/main/src/lib/context/activities.jsx) (Activity state), [`src/pages/Tasks.jsx`](https://github.com/ajacin/daves-log/blob/main/src/pages/Tasks.jsx) (Tasks), [`src/pages/Activities.jsx`](https://github.com/ajacin/daves-log/blob/main/src/pages/Activities.jsx) (Activities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser SPA"]
  node_main["Entry<br/>bootstrap<br/>[main.jsx]"]
  node_app["App shell<br/>router/layout<br/>[App.jsx]"]
  node_landing["Landing<br/>public page<br/>[Landing.jsx]"]
  node_home["Home<br/>entry page<br/>[Home.jsx]"]
  node_login["Login<br/>auth page<br/>[Login.jsx]"]
  node_register["Register<br/>auth page<br/>[Register.jsx]"]
  node_dashboard["Dashboard<br/>workspace page<br/>[Dashboard.jsx]"]
  node_tasks["Tasks<br/>feature page<br/>[Tasks.jsx]"]
  node_activities["Activities<br/>feature page<br/>[Activities.jsx]"]
  node_activitylog["Activity log<br/>feature page<br/>[ActivityLog.jsx]"]
  node_ideas["Ideas<br/>feature page<br/>[Ideas.jsx]"]
  node_automations["Automations<br/>feature page<br/>[Automations.jsx]"]
  node_invitees["Invitees<br/>feature page<br/>[Invitees.jsx]"]
  node_settings["Settings<br/>feature page<br/>[Settings.jsx]"]
end

subgraph group_shared["Shared client layer"]
  node_userctx(("User state<br/>react context<br/>[user.jsx]"))
  node_taskctx(("Task state<br/>react context<br/>[tasks.js]"))
  node_activityctx(("Activity state<br/>react context<br/>[activities.jsx]"))
  node_parser{{"Date parser<br/>[dateParser.js]"}}
  node_taskinput["Task input<br/>ui component<br/>[BulkTaskInput.jsx]"]
  node_taskgen["AI task gen<br/>client API<br/>[aiTaskGen.js]"]
  node_activityform["Activity form<br/>ui component<br/>[ActivityForm.jsx]"]
  node_authguard["Access guard<br/>route guard"]
  node_logger{{"Activity logger<br/>client service<br/>[activityLogger.js]"}}
end

subgraph group_platform["Platform & integrations"]
  node_appwrite[("Appwrite<br/>backend service")]
  node_aifn["AI function<br/>serverless function<br/>[ai-task-gen.js]"]
  node_sw["Service worker<br/>pwa asset<br/>[service-worker.js]"]
  node_redirects["Redirects<br/>deploy config"]
  node_netlify["Netlify config<br/>deploy config<br/>[netlify.toml]"]
end

node_main -->|"boots"| node_app
node_app -->|"routes"| node_landing
node_app -->|"routes"| node_home
node_app -->|"routes"| node_login
node_app -->|"routes"| node_register
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_tasks
node_app -->|"routes"| node_activities
node_app -->|"routes"| node_activitylog
node_app -->|"routes"| node_ideas
node_app -->|"routes"| node_automations
node_app -->|"routes"| node_invitees
node_app -->|"routes"| node_settings
node_app -->|"protects"| node_authguard
node_authguard -->|"reads"| node_userctx
node_taskctx -->|"syncs"| node_appwrite
node_activityctx -->|"syncs"| node_appwrite
node_taskinput -->|"parses"| node_parser
node_taskinput -->|"invokes"| node_taskgen
node_taskgen -->|"calls"| node_aifn
node_aifn -.->|"supports"| node_appwrite
node_activityform -->|"emits"| node_logger
node_logger -->|"updates"| node_activityctx
node_activities -->|"uses"| node_activityform
node_tasks -->|"uses"| node_taskinput
node_tasks -->|"uses"| node_taskctx
node_activities -->|"uses"| node_activityctx
node_activitylog -->|"uses"| node_activityctx
node_ideas -->|"syncs"| node_appwrite
node_automations -->|"syncs"| node_appwrite
node_invitees -->|"syncs"| node_appwrite
node_settings -->|"syncs"| node_appwrite
node_sw -.->|"supports"| node_app
node_redirects -.->|"supports"| node_app
node_netlify -->|"deploys"| node_aifn

click node_main "https://github.com/ajacin/daves-log/blob/main/src/main.jsx"
click node_app "https://github.com/ajacin/daves-log/blob/main/src/App.jsx"
click node_landing "https://github.com/ajacin/daves-log/blob/main/src/pages/Landing.jsx"
click node_home "https://github.com/ajacin/daves-log/blob/main/src/pages/Home.jsx"
click node_login "https://github.com/ajacin/daves-log/blob/main/src/pages/Login.jsx"
click node_register "https://github.com/ajacin/daves-log/blob/main/src/pages/Register.jsx"
click node_dashboard "https://github.com/ajacin/daves-log/blob/main/src/pages/Dashboard.jsx"
click node_tasks "https://github.com/ajacin/daves-log/blob/main/src/pages/Tasks.jsx"
click node_activities "https://github.com/ajacin/daves-log/blob/main/src/pages/Activities.jsx"
click node_activitylog "https://github.com/ajacin/daves-log/blob/main/src/pages/ActivityLog.jsx"
click node_ideas "https://github.com/ajacin/daves-log/blob/main/src/pages/Ideas.jsx"
click node_automations "https://github.com/ajacin/daves-log/blob/main/src/pages/Automations.jsx"
click node_invitees "https://github.com/ajacin/daves-log/blob/main/src/pages/Invitees.jsx"
click node_settings "https://github.com/ajacin/daves-log/blob/main/src/pages/Settings.jsx"
click node_userctx "https://github.com/ajacin/daves-log/blob/main/src/lib/context/user.jsx"
click node_taskctx "https://github.com/ajacin/daves-log/blob/main/src/lib/context/tasks.js"
click node_activityctx "https://github.com/ajacin/daves-log/blob/main/src/lib/context/activities.jsx"
click node_parser "https://github.com/ajacin/daves-log/blob/main/src/lib/utils/dateParser.js"
click node_taskinput "https://github.com/ajacin/daves-log/blob/main/src/components/BulkTaskInput.jsx"
click node_taskgen "https://github.com/ajacin/daves-log/blob/main/src/lib/api/aiTaskGen.js"
click node_activityform "https://github.com/ajacin/daves-log/blob/main/src/components/activities/ActivityForm.jsx"
click node_authguard "https://github.com/ajacin/daves-log/blob/main/src/components/ProtectedLayout.jsx"
click node_aifn "https://github.com/ajacin/daves-log/blob/main/netlify/functions/ai-task-gen.js"
click node_sw "https://github.com/ajacin/daves-log/blob/main/public/service-worker.js"
click node_redirects "https://github.com/ajacin/daves-log/tree/main/public/_redirects"
click node_netlify "https://github.com/ajacin/daves-log/blob/main/netlify.toml"
click node_logger "https://github.com/ajacin/daves-log/blob/main/src/lib/activityLogger.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_landing,node_home,node_login,node_register,node_dashboard,node_tasks,node_activities,node_activitylog,node_ideas,node_automations,node_invitees,node_settings toneBlue
class node_userctx,node_taskctx,node_activityctx,node_parser,node_taskinput,node_taskgen,node_activityform,node_authguard,node_logger toneAmber
class node_appwrite,node_aifn,node_sw,node_redirects,node_netlify toneMint
```

## Components

### Browser SPA

Client-side React application and routed feature pages.

- [Entry](https://github.com/ajacin/daves-log/blob/main/src/main.jsx): bootstrap · Browser startup and app mount point. · `src/main.jsx`
- [App shell](https://github.com/ajacin/daves-log/blob/main/src/App.jsx): router/layout · Top-level route composition and application shell. · `src/App.jsx`
- [Landing](https://github.com/ajacin/daves-log/blob/main/src/pages/Landing.jsx): public page · Public-facing entry page. · `src/pages/Landing.jsx`
- [Home](https://github.com/ajacin/daves-log/blob/main/src/pages/Home.jsx): entry page · Authenticated or returning user landing area. · `src/pages/Home.jsx`
- [Login](https://github.com/ajacin/daves-log/blob/main/src/pages/Login.jsx): auth page · User sign-in screen. · `src/pages/Login.jsx`
- [Register](https://github.com/ajacin/daves-log/blob/main/src/pages/Register.jsx): auth page · User registration screen. · `src/pages/Register.jsx`
- [Dashboard](https://github.com/ajacin/daves-log/blob/main/src/pages/Dashboard.jsx): workspace page · Primary authenticated overview page. · `src/pages/Dashboard.jsx`
- [Tasks](https://github.com/ajacin/daves-log/blob/main/src/pages/Tasks.jsx): feature page · Task management and creation surface. · `src/pages/Tasks.jsx`
- [Activities](https://github.com/ajacin/daves-log/blob/main/src/pages/Activities.jsx): feature page · Activity browsing and capture surface. · `src/pages/Activities.jsx`
- [Activity log](https://github.com/ajacin/daves-log/blob/main/src/pages/ActivityLog.jsx): feature page · Timeline or audit-style log view. · `src/pages/ActivityLog.jsx`
- [Ideas](https://github.com/ajacin/daves-log/blob/main/src/pages/Ideas.jsx): feature page · Idea capture and management surface. · `src/pages/Ideas.jsx`
- [Automations](https://github.com/ajacin/daves-log/blob/main/src/pages/Automations.jsx): feature page · Automation management surface. · `src/pages/Automations.jsx`
- [Invitees](https://github.com/ajacin/daves-log/blob/main/src/pages/Invitees.jsx): feature page · Invitee and access-related surface. · `src/pages/Invitees.jsx`
- [Settings](https://github.com/ajacin/daves-log/blob/main/src/pages/Settings.jsx): feature page · Application and user settings surface. · `src/pages/Settings.jsx`

### Shared client layer

Reusable UI, context state, parsing, and service wrappers used across pages.

- [User state](https://github.com/ajacin/daves-log/blob/main/src/lib/context/user.jsx): react context · Current user and auth-related client state. · `src/lib/context/user.jsx`
- [Task state](https://github.com/ajacin/daves-log/blob/main/src/lib/context/tasks.js): react context · Task domain state provider. · `src/lib/context/tasks.js`
- [Activity state](https://github.com/ajacin/daves-log/blob/main/src/lib/context/activities.jsx): react context · Activity domain state provider. · `src/lib/context/activities.jsx`
- [Date parser](https://github.com/ajacin/daves-log/blob/main/src/lib/utils/dateParser.js): utility · Natural-language date/time parsing logic. · `src/lib/utils/dateParser.js`
- [Task input](https://github.com/ajacin/daves-log/blob/main/src/components/BulkTaskInput.jsx): ui component · Bulk and smart task entry components. · `src/components/BulkTaskInput.jsx`
- [AI task gen](https://github.com/ajacin/daves-log/blob/main/src/lib/api/aiTaskGen.js): client API · Client wrapper for AI-backed task generation. · `src/lib/api/aiTaskGen.js`
- [Activity form](https://github.com/ajacin/daves-log/blob/main/src/components/activities/ActivityForm.jsx): ui component · Activity capture and quick-add UI. · `src/components/activities/ActivityForm.jsx`
- [Access guard](https://github.com/ajacin/daves-log/blob/main/src/components/ProtectedLayout.jsx): route guard · Protected layout and permission checks. · `src/components/ProtectedLayout.jsx`
- [Activity logger](https://github.com/ajacin/daves-log/blob/main/src/lib/activityLogger.js): client service · Records activity events for later display. · `src/lib/activityLogger.js`

### Platform & integrations

Hosting, serverless, and backend services the SPA depends on.

- **Appwrite**: backend service · Auth and persisted domain data backend.
- [AI function](https://github.com/ajacin/daves-log/blob/main/netlify/functions/ai-task-gen.js): serverless function · Netlify function for AI task generation. · `netlify/functions/ai-task-gen.js`
- [Service worker](https://github.com/ajacin/daves-log/blob/main/public/service-worker.js): pwa asset · Offline and caching support for the SPA. · `public/service-worker.js`
- [Redirects](https://github.com/ajacin/daves-log/tree/main/public/_redirects): deploy config · SPA routing and deep-link handling. · `public/_redirects`
- [Netlify config](https://github.com/ajacin/daves-log/blob/main/netlify.toml): deploy config · Hosting and deployment configuration. · `netlify.toml`

## Connections

- Entry → App shell: boots · Mounts the application shell.
- App shell → Landing: routes · Exposes the public entry page.
- App shell → Home: routes · Routes into the authenticated home area.
- App shell → Login: routes · Routes to sign-in.
- App shell → Register: routes · Routes to registration.
- App shell → Dashboard: routes · Routes to the main workspace.
- App shell → Tasks: routes · Routes to task management.
- App shell → Activities: routes · Routes to activity browsing.
- App shell → Activity log: routes · Routes to the activity log.
- App shell → Ideas: routes · Routes to ideas management.
- App shell → Automations: routes · Routes to automation management.
- App shell → Invitees: routes · Routes to invitee management.
- App shell → Settings: routes · Routes to settings.
- App shell → Access guard: protects · Wraps protected application areas with permission checks.
- Access guard → User state: reads · Uses current user and permissions state.
- Task state → Appwrite: syncs · Persists and retrieves task data.
- Activity state → Appwrite: syncs · Persists and retrieves activity data.
- Task input → Date parser: parses · Converts natural language into structured task fields.
- Task input → AI task gen: invokes · Requests AI-assisted task generation.
- AI task gen → AI function: calls · Sends AI requests through the serverless edge.
- AI function → Appwrite: supports · Operates alongside the core backend-dependent workflow.
- Activity form → Activity logger: emits · Captures activity events for the log stream.
- Activity logger → Activity state: updates · Feeds activity state into the UI.
- Activities → Activity form: uses · Provides capture and quick-add activity UI.
- Tasks → Task input: uses · Provides bulk and smart task entry.
- Tasks → Task state: uses · Reads and mutates task state.
- Activities → Activity state: uses · Reads and mutates activity state.
- Activity log → Activity state: uses · Displays recorded activity state.
- Ideas → Appwrite: syncs · Persists idea records through backend services.
- Automations → Appwrite: syncs · Persists automation records through backend services.
- Invitees → Appwrite: syncs · Persists invitee and access data.
- Settings → Appwrite: syncs · Persists user and app preferences.
- Service worker → App shell: supports · Enables PWA-style caching and offline behavior.
- Redirects → App shell: supports · Enables direct deep-link routing for the SPA.
- Netlify config → AI function: deploys · Hosts the serverless AI endpoint.
