Skip to main content
Hello Local Framework - A local-first framework with a notes app demonstration

Welcome to Hello Local Framework

Hello Local Framework is a local-first framework that prioritizes user ownership, privacy, and resilience in application design. This approach represents a fundamental shift from the cloud-first mentality that has dominated software development in recent years.

What is Local-First?

Local-first software is a design philosophy that ensures applications work primarily with data stored on the user's device, rather than relying on constant server connectivity. This approach offers several key advantages:

  • Data Ownership: Users maintain complete control over their data, which resides primarily on their own devices.
  • Privacy by Design: Since data is stored locally, users don't need to trust third parties with their information.
  • Offline Functionality: Applications continue to work seamlessly without an internet connection.
  • Performance: Local data access is typically faster than network requests, resulting in more responsive applications.
  • Longevity: Applications aren't dependent on remote services that might shut down or change their terms.

Unlike traditional cloud applications where data primarily lives on remote servers, or offline-capable apps that merely cache data temporarily, Hello Local Framework treats the local device as the primary source of truth, with cloud synchronization as an optional enhancement rather than a requirement.

The Problem with Cloud-First

While cloud-first applications offer convenience through automatic synchronization and access from multiple devices, they come with significant drawbacks:

  • Dependency: Applications stop working when servers are down or internet connectivity is lost.
  • Privacy Concerns: User data is stored on third-party servers, often analyzed for various purposes.
  • Lack of Control: Users have limited say over how their data is managed, backed up, or migrated.
  • Service Discontinuation: If a service shuts down, users may lose access to their data and functionality.

Hello Local Framework addresses these issues by inverting the traditional model, making the local device the primary data store while still offering the benefits of cloud synchronization when desired.

Architectural Approach

Hello Local Framework implements a hybrid architecture that combines the benefits of local-first design with optional cloud synchronization. This section explains the key components and how they interact.

User Device Web Browser UI Layer Data Layer Sync Layer IndexedDB Cloud Services JohnsenAI Sync Service End-to-End Encryption Encrypted Storage Container Environment Direct Connection Optional Connection

Core Components

  1. UI Layer: The presentation layer that users interact with, built using HTML, CSS, and JavaScript. It includes:
    • Note editor and viewer
    • Settings interface
    • Sync configuration
  2. Data Layer: Responsible for managing data locally on the device.
    • IndexedDB: A browser-based database that allows for persistent storage of structured data, accessed via the localForage library.
    • Data models for notes and application settings
    • CRUD operations (Create, Read, Update, Delete) for notes
  3. Sync Layer: Handles optional synchronization with cloud services.
    • End-to-End Encryption: Uses the Web Crypto API to encrypt data before it leaves the device, ensuring that only the user with the correct password can decrypt it.
    • Conflict resolution strategies for handling changes from multiple devices
    • Provider-specific adapters for different sync services

Server-Side Components

  1. JohnsenAI Sync Service: A lightweight ASP.NET Core Web API that serves as a secure storage backend.
    • RESTful API endpoints for storing and retrieving encrypted data
    • No knowledge of the data content (zero-knowledge design)
    • Future support for user accounts and authentication
  2. Encrypted Storage: The server-side storage system that holds the encrypted data.
    • Currently implemented as a simple file-based storage
    • Designed to be replaceable with more robust database solutions

Data Flow

The Hello Local Framework architecture follows these key data flows:

  1. Local Operations: When a user creates or edits a note, the data is immediately saved to IndexedDB on their device. This ensures that the application works offline and provides immediate feedback.
  2. Sync to Cloud (Push): If cloud sync is enabled, the following steps occur:
    1. The user's notes are retrieved from IndexedDB
    2. The data is encrypted using the user's password (which never leaves the device)
    3. The encrypted data is sent to the JohnsenAI Sync Service
    4. The server stores the encrypted data without being able to read its contents
  3. Sync from Cloud (Pull): When retrieving data from the cloud:
    1. The encrypted data is fetched from the JohnsenAI Sync Service
    2. The data is decrypted on the device using the user's password
    3. The decrypted notes are merged with the local database, resolving any conflicts

This architecture ensures that data remains accessible even without internet connectivity, while still providing the convenience of multi-device access when desired.

Implementation Status

The Hello Local Framework project is under active development, with various components at different stages of implementation. This section provides an overview of what's currently working, what's partially implemented, and what's still in the planning stages.

Fully Implemented
Partially Implemented
Stubbed/Planned

Fully Implemented Features

  • Local Data Storage: Complete implementation of IndexedDB storage via localForage, including CRUD operations for notes.
  • User Interface: Modern, responsive UI with dark mode support and tab-based navigation.
  • Note Editor: Functional note creation, editing, and deletion with automatic saving.
  • Offline Functionality: Full application functionality without internet connection.
  • End-to-End Encryption: Implementation of the Web Crypto API (AES-GCM with PBKDF2) for secure data encryption.
  • Basic Sync Service: ASP.NET Core backend with endpoints for storing and retrieving encrypted data.
  • Data Export/Import: Ability to export notes as JSON files and import them back.

Partially Implemented Features

  • Cloud Synchronization: Basic implementation of JohnsenAI Sync provider, but lacking robust conflict resolution.
  • Multiple Provider Support: UI elements for Dropbox and Google Drive are present, but the functionality is not yet implemented.
  • User Authentication: Basic structure exists in the backend, but not fully integrated with the frontend.
  • Progressive Web App: Basic PWA configuration is in place, but offline caching and installation experience need refinement.

Planned/Stubbed Features

  • Conflict Resolution: More sophisticated merge strategies for handling conflicting changes from multiple devices.
  • Rich Text Editing: Support for formatting, images, and other rich content in notes.
  • Collaboration: Ability to share notes with other users while maintaining end-to-end encryption.
  • Version History: Tracking changes to notes over time and allowing users to revert to previous versions.
  • Search and Tagging: Advanced search capabilities and organizational features like tags and folders.
  • Notifications: Reminders and notifications for time-sensitive notes.

Future Development Recommendations

Based on the current state of the project, here are some recommended next steps for development:

  1. Robust Conflict Resolution: Implement a more sophisticated conflict resolution system, possibly using Conflict-free Replicated Data Types (CRDTs) or a similar approach to handle concurrent edits from multiple devices.
  2. Complete Provider Integrations: Finish the implementation of Dropbox and Google Drive sync providers to give users more options for cloud storage.
  3. Enhanced PWA Experience: Improve the Progressive Web App aspects, including better offline caching, push notifications, and a smoother installation experience.
  4. User Authentication: Complete the user authentication system to allow for more secure and personalized sync experiences.
  5. Rich Text Editor: Replace the plain text editor with a rich text alternative that supports formatting, images, and other media.
  6. Database Optimization: Move from file-based storage to a proper database system on the server side for better scalability and performance.
  7. Mobile Apps: Consider developing native mobile applications using frameworks like React Native or Flutter to provide an even better experience on mobile devices.

These recommendations are prioritized based on their impact on the core value proposition of Hello Local Framework as a local-first notes application with secure cloud synchronization.

Back to Research