DEV Community

Cover image for 📖 LocalHost Journaling ✍️With Gemma
Shreyas Guha Neogi
Shreyas Guha Neogi

Posted on

📖 LocalHost Journaling ✍️With Gemma

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

I built Space Journal - an Offline "Safe-Space" Cognitive Journal Analyzer for my friend, Risiraj, who suffers from panic attacks and manages anxiety through journaling and is a poet at heart, but is fiercely protective of their privacy.

It is a completely offline zero-telemetry environment where my friend can securely paste their daily inflections without a permanent online imprint or embarassment.

Demo

Demo

Code

Offline Safe-Space Journal Analyzer

A privacy-first, 100% offline desktop application designed for safe, personal journal reflection using an open-weight model running entirely on your own machine.


Quick Start (3 Easy Steps)

Step 1: Install Ollama & Pull Model

  1. Download and install Ollama for your operating system.
  2. Open your terminal / command prompt and download the local AI model:
    ollama pull gemma2:2b
    Enter fullscreen mode Exit fullscreen mode

Step 2: Install Python Dependencies

Open your terminal in this directory and install the dependencies:

pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Step 3: Launch the Application

Start the application with a single click or command:

  • Windows: Double-click start_journal.bat (or run start_journal.bat in Command Prompt).
  • Mac / Linux: Execute ./start_journal.sh (run chmod +x start_journal.sh first if necessary).

Automated Infrastructure Sync

To schedule daily background backups of application code changes (excluding all private user data):

Windows (Task Scheduler)

Run this command in an Administrator Command Prompt (update directory path if needed):

schtasks /create
…
Enter fullscreen mode Exit fullscreen mode

How I Built It

I used an autonomous agent (Antigravity) to scaffold the project with strict privacy constraints. The core stack relies entirely on local execution:

Model: Google's Gemma (gemma2:2b), an open-weight model small enough to run fast on a standard laptop CPU.

Inference: Ollama, serving the model locally.

Frontend: Streamlit for a clean, minimalist user interface.

Prototyping: Google AI Studio to perfect the system prompt for objective, non-judgmental cognitive reframing before writing any code.

Antigravity generated idempotent deployment scripts (start_journal.sh / .bat) so my non-technical friend can launch the Ollama server and the Streamlit app with a single click. It also generated a strict .gitignore that physically blocks local caches and journal data from ever being committed, ensuring only the infrastructure is synced to the private repository.

Why Does Open Innovation Matter?

For deeply personal mental health tools, open innovation isn't just a feature—it's the only way the product can exist.

If this relied on a closed API, my friend simply wouldn't use it. By leveraging an open-weight model, I was able to guarantee absolute data sovereignty.

My Agent Session

Check out how I used Antigravity to autonomously generate the offline privacy constraints and idempotent deployment scripts:

Offline Safe-Space Journal Analyzer - Autonomous Build & Deploy
You

Build and locally deploy the Offline Safe-Space Journal Analyzer desktop web application. Core requirements: 100% offline local processing using Ollama (gemma2:2b), privacy-first zero-telemetry Streamlit app, startup scripts (start_journal.bat and start_journal.sh), zero-leakage .gitignore, and automated backup sync scripts.

Agent

Created the complete Offline Safe-Space Journal Analyzer application suite in spaceJournal workspace:

  • app.py: Streamlit frontend with local Ollama inference using gemma2:2b, error handling, and empathetic UI.
  • requirements.txt: Minimal dependencies (streamlit, ollama).
  • start_journal.bat & start_journal.sh: One-click startup scripts checking port 11434 before starting Ollama and Streamlit.
  • .gitignore: Strict privacy exclusions ignoring logs, database files, and personal journal notes.
  • sync_codebase.bat & sync_codebase.sh: Scoped version control backup scripts pushing infrastructure updates to GitHub.
  • README.md: 3-step setup and background sync scheduling instructions.

Prize Categories

Best Use of Gemma : (Ran Google's gemma2:2b open-weight model locally for offline inference)

Top comments (0)