๐ป Echoes After Dark
"Every machine remembers something."
An interactive haunted storytelling and fictional computer terminal investigation experience powered 100% locally by open-weight AI (Gemma 3:1b via Ollama).
Created for the Hacktoberfest 2026 "Ghost in the Machine" Open-Source AI Challenge.
๐ Table of Contents
- Project Overview
- Why Open-Weight AI & Local Innovation Matter
- Key Features
- Architecture & Technology Stack
- System Requirements
- Quick Start & Installation
- API Endpoint Documentation
- Privacy, Security & Safeguards
- Automated Testing Suite
- Known Hardware Characteristics & Limitations
- Contributing to Hacktoberfest 2026
- License
๐ Project Overview
Echoes After Dark is a browser-based supernatural creative writing suite that transforms your computer into a haunted machine. Rather than relying on cloud subscriptions or remote APIs that harvest your prompts, Echoes After Dark runs entirely on your own laptop using Gemma 3:1bโGoogle DeepMind's state-of-the-art open-weight lightweight language model.
Users can:
- Summon original supernatural, psychological, or sci-fi horror tales with customizable parameters and typewriter pacing.
- Step inside ECHO-OS, a simulated 1994 decommissioned laboratory mainframe, to decrypt magnetic tape sectors and converse with a digital ghost subroutine.
- Light a Memory Lantern, a respectful, warm commemorative storytelling mode inspired by Dรญa de los Muertos to celebrate cherished memories of loved ones.
- Curate a private library stored exclusively in browser
localStorage, with instant plain-text (.txt) and.jsonbackup exports.
๐ก Why Open-Weight AI & Local Innovation Matter
Most commercial AI storytelling platforms lock users into expensive cloud subscriptions, send creative writings to external servers for telemetry and advertising, and restrict how users can customize prompts.
Echoes After Dark takes a fundamentally different stance:
-
Zero Cloud Dependence: The model runs locally via Ollama on
localhost:11434. After the initial model download, you can disconnect your Wi-Fi and generate stories offline in a secluded cabin in the woods. - Uncompromised Privacy: Your stories, character names, and personal family memories never leave your machine.
-
Inspectable & Hackable: All system prompts are accessible in the UI (
/api/prompts) and can be modified directly inserver.js. -
Model Agnostic: Easily swap
gemma3:1bwithgemma4:latest,qwen2.5-coder:3b,mistral, orllama3.2:1bby changing a single environment variable (OLLAMA_MODEL).
๐ฎ Key Features
Mode I: Haunted Night (AI Story Generator)
-
Granular Atmospheric Controls:
- Settings: Abandoned Hospital, Haunted House, Whispering Forest, Old Computer Lab, Forgotten Village, or custom setting input.
- Protagonist: Name and background of who enters the unknown.
- Length: Short (~200 words), Medium (~400 words), or Long (~700 words).
- Fear Level: Mysterious (subtle, eerie psychological), Creepy (uncanny, rising dread), or Terrifying (high tension, intense climax).
- Subgenres: Supernatural Mystery, Psychological Horror, Folklore-Inspired Fiction, Sci-Fi Horror.
- Ending: Unexpected Twist, Unresolved Mystery, or Hopeful Escape.
- Dynamic Typewriter Engine: Organic character-by-character reveal with mechanical sound effects and instant skip control.
-
Quick Action Bar: Copy to clipboard, export as
.txt, save to local archive, or regenerate. - Offline Demonstration Mode: Pre-loaded example stories allow users to test the reading experience even if Ollama is temporarily stopped.
Mode II: Haunted Terminal (ECHO-OS 1994)
- Authentic Vintage CRT Simulation: Curved screen borders, phosphor green glow, CRT scanlines, and audio feedback.
-
Safe Command Sandbox:
-
scan: Scans corrupted magnetic tape sectors to uncover hidden artifacts. -
status: Displays simulated Motorola 68040 CPU readings, corrupted parity RAM, and infrasound frequency. -
logs: Decrypts 1994 laboratory logs detailing Dr. Evelyn Vance's cognitive cybernetics experiments. -
read <log_id>: Reads decrypted log files. -
clues: Lists gathered evidence artifacts. -
investigate <id>: Instructs Subroutine 7 to generate a localized anomaly description. -
whisper <query>: Directly questions the trapped 1994 digital consciousness using Ollama. -
story: Synthesizes an interactive mystery climax weaving together all discovered clues. -
purge: Attempts emergency security deionization. -
clear&exit: Utility controls.
-
- Strict Execution Safety: Safe emulation only. The terminal never executes real operating system commands, inspects host files, or spawns shell processes.
Mode III: Memory Lantern (Dรญa de los Muertos Remembrance)
- Respectful Commemoration: Inspired by the tradition of Dรญa de los Muertos (Day of the Dead), this mode celebrates life and honors legacy.
-
Cultural Safeguard Guidelines:
- Never claims to channel, contact, or speak on behalf of deceased people.
- Completely separated from horror aesthetics: warm cempasรบchil marigold orange, golden candlelight flames, and terracotta tones.
- Interactive Live Scribe: Enter cherished memories, meaningful places, favorite scents, and enduring wisdom. Gemma 3:1b weaves a gentle, poetic tribute.
- Full Editorial Control: The generated tribute is rendered inside an editable parchment editor, allowing you to personalize every line before saving.
Mode IV: Private Local Story Archive
-
Client-Side Persistence: Saved entries are written to browser
localStorage. - Search & Filter: Real-time search across titles, characters, and text, with one-click filters for Haunted Night vs. Memory Lantern entries.
- Reader Modal: Full-screen distraction-free reader with metadata inspection.
-
Export Capabilities:
- Single story download as
.txtformatted keepsake. - Complete archive backup export as JSON (
.json). - Safe archive purge with confirmation dialog.
- Single story download as
๐ ๏ธ Architecture & Technology Stack
Echos After Dark/
โโโ server.js # Node.js & Express server with Ollama integration
โโโ package.json # Minimal dependencies (Express only)
โโโ .env.example # Configurable environment variables
โโโ README.md # Hacktoberfest 2026 documentation
โโโ LICENSE # MIT Open-Source License
โโโ tests/
โ โโโ api.test.js # Automated end-to-end API test suite
โโโ public/
โโโ index.html # Semantic HTML5 SPA layout
โโโ css/
โ โโโ main.css # Midnight design system, variables, modals, fog
โ โโโ story.css # Story generator controls & typewriter display
โ โโโ terminal.css # Retro CRT monitor, phosphor green glow & dossier
โ โโโ lantern.css # Dรญa de los Muertos warm theme & candle animations
โ โโโ archive.css # LocalStorage card grid, search bar & filters
โโโ js/
โโโ ambient.js # Web Audio API synthesizer & canvas mist particles
โโโ archive.js # LocalStorage CRUD, export & reader modal
โโโ story.js # Generator form logic, typewriter engine & samples
โโโ terminal.js # Safe CRT emulator, clue tracker & command history
โโโ lantern.js # Remembrance tribute generator & live editor
โโโ app.js # Navigation controller & Ollama health monitor
Technology Highlights:
-
Backend: Node.js v18+ & Express.js. Native
fetchwith zero heavy SDKs. -
Local AI Provider: Ollama REST API (
/api/chatand/api/tags). -
Default AI Model:
gemma3:1b(806 MB, Google DeepMind). - Frontend: Vanilla HTML5, Vanilla CSS3 (Custom Properties, Flexbox/Grid, Glassmorphism), Vanilla JavaScript (ES2022). No bloated frameworks.
- Audio Synthesis: Pure HTML5 Web Audio API (real-time generated binaural drone, tape crackle, CRT chirps, and typewriter clicksโno external sound files required).
-
Atmosphere: Canvas 2D spectral mist particle engine with
prefers-reduced-motioncompliance.
๐ป System Requirements
Designed specifically to run smoothly on everyday consumer laptops:
- Operating System: Windows 10/11, macOS, or Linux.
- RAM: 8 GB RAM minimum (Gemma 3:1b requires only ~1.2 GB of available memory).
- Disk Space: ~1 GB free space for the model weights and dependencies.
- Node.js: v18.0.0 or higher (Node v20+ recommended).
- Ollama: v0.1.30 or higher.
๐ Quick Start & Installation
Step 1: Install Ollama & Download Gemma 3:1b
- Download and install Ollama from https://ollama.com/download.
- Open your terminal (PowerShell or Bash) and pull the model:
ollama pull gemma3:1b
- Verify that the model is ready:
ollama list
You should see gemma3:1b listed with a size of ~806 MB.
- Ensure Ollama is running:
ollama serve
(On Windows, Ollama usually runs automatically in the system tray).
Step 2: Install App Dependencies & Launch
- Clone the repository and navigate into the folder:
git clone https://github.com/guunda/Echoos-After-Dark.git
cd Echoos-After-Dark
- Install dependencies:
npm install
- Start the application:
npm start
- Open your browser and navigate to:
http://127.0.0.1:3000
The AI status badge in the top right will display a glowing green dot: gemma3:1b (Online).
๐ก API Endpoint Documentation
| Method | Endpoint | Description | Sample Request / Response |
|---|---|---|---|
GET |
/api/health |
Pings Ollama and verifies model availability. | { "status": "ok", "ollamaConnected": true, "configuredModel": "gemma3:1b", "modelAvailable": true } |
GET |
/api/prompts |
Open-weight transparency endpoint returning current system instructions. | { "model": "gemma3:1b", "prompts": { "hauntedStory": "...", ... } } |
POST |
/api/generate-story |
Generates an original ghost story using Gemma 3. | Body: { "setting": "old computer lab", "character": "Maya", "length": "short", "fearLevel": "creepy", "storyType": "science-fiction horror", "ending": "unexpected twist" }
|
POST |
/api/terminal |
Processes simulated ECHO-OS terminal commands and Subroutine 7 dialogue. | Body: { "command": "scan", "currentClues": [], "stage": 0 }
|
POST |
/api/memory-lantern |
Crafts a commemorative Dรญa de los Muertos remembrance tribute. | Body: { "name": "Abuela Rosa", "memories": "warm chocolate and laughter", "places": "autumn patio", "lessons": "kindness" }
|
๐ Privacy, Security & Safeguards
-
Bound to Localhost: The server defaults to
127.0.0.1to prevent unauthorized external network access. -
Zero Real Command Execution: The haunted terminal strictly rejects operating system commands (
dir,del,rm,cat, etc.) and runs a hardened virtual state machine. - In-Memory Concurrency Limiter: Automatically manages request concurrency to avoid exhausting memory on 8 GB RAM laptops.
-
Local Persistence Only: Stories, notes, and tributes are stored strictly inside your browser's private
localStorage. - Injection Defenses: Creative inputs are sanitized, length-limited, and framed strictly as creative storytelling variables to prevent prompt manipulation.
๐งช Automated Testing Suite
Echoes After Dark includes a built-in automated test suite verifying every endpoint against real Ollama inference:
Run tests with:
npm test
Expected output:
๐งช Starting Echoes After Dark API Test Suite at http://127.0.0.1:3000...
โข Testing GET /api/health... (Ollama: Connected, Model: gemma3:1b, Available: true) โ
PASSED
โข Testing GET /api/prompts... โ
PASSED
โข Testing POST /api/terminal (help command)... โ
PASSED
โข Testing POST /api/terminal (scan command adds clue)... โ
PASSED
โข Testing POST /api/terminal (AI whisper command)... โ
PASSED
โข Testing POST /api/generate-story (gemma3:1b)... โ
PASSED
โข Testing POST /api/memory-lantern (remembrance tribute)... โ
PASSED
=============================================
Results: 7 passed, 0 failed.
=============================================
โ ๏ธ Known Hardware Characteristics & Limitations
- CPU vs GPU Inference: When running Ollama on standard laptop CPUs without a dedicated GPU, generating a 200-word story typically takes 30โ50 seconds. This is normal for local on-device inference.
-
Browser LocalStorage: LocalStorage is isolated to your specific browser profile. If you clear browser website data or switch browsers, export your stories using the
Export All (.json)button first.
๐ค Contributing to Hacktoberfest 2026
We welcome contributions from open-source developers, writers, and AI enthusiasts!
- Fork the repository at https://github.com/guunda/Echoos-After-Dark.
- Create your feature branch (
git checkout -b feature/spectral-audio). - Commit your changes (
git commit -m 'Add new CRT phosphor color modes'). - Push to the branch (
git push origin feature/spectral-audio). - Open a Pull Request tagged with
hacktoberfest.
๐ License
This project is open-source under the terms of the MIT License.
Model weights for Gemma 3 are subject to the Gemma Terms of Use.
Top comments (0)