Skip to content

Latest commit

Β 

History

392 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ KnowFlux

KnowFlux is a self-published fiction & poetry platform β€” a literary hub with a bold, Nintendo-inspired visual identity. Two serialized books (Exploded and The Pinnacle of Reality), an ever-growing poetry archive, and an interactive character database called the Omni-Dex.

🌐 Live site: knowflux.ink


✨ Features

πŸ“– Books

  • Two serialized books: Exploded and The Pinnacle of Reality
  • Pages served dynamically β€” content lives in books.json, rendered by reader.html

πŸ–‹οΈ Poetry

  • Curated poetry archive with sections (Haikus, Tanka, Free Verse, etc.)
  • Each poem is a self-contained static HTML page

πŸƒ Omni-Dex

  • Interactive character/universe database with:
    • Universe & type filtering (tabs + pills)
    • Animated stat bars
    • Modal detail view with stats sidebar and keyboard navigation (←/β†’/Esc)

πŸ“š Reading Experience

  • Customizable display: text size, font family (Normal / Garamond / Lora), line width
  • Dark mode & Focus mode
  • Bookmarks β€” "Continue reading" links adapt to where you left off
  • Word count + estimated reading time per page
  • Scroll progress bar, keyboard navigation (← / β†’), chapter-completion toast
  • Drop caps on chapter-open pages

πŸ” Search

  • Instant client-side search powered by Algolia
  • Index built from sitemap.xml via Backend/algolia-build-index.py

πŸ› οΈ Admin Panel

  • Password-protected content generator at /admin
  • Add book pages or poems without touching the filesystem:
    • Book pages β†’ parsed with [dream], [thought], [underline] markers and written to books.json
    • Poems β†’ generate a static HTML page + update the poetry grid
  • Automatically updates sitemap.xml and auto-commits & pushes to GitHub

πŸ—οΈ Architecture

KnowFlux is a serverless-style Jamstack site with a thin Python dev/ops layer.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           Browser                                β”‚
β”‚  index Β· reader Β· poetry Β· contents Β· omni-dex Β· search Β· admin  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ static HTML + CSS + JS                   β”‚ form posts / fetch
               β–Ό                                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Static Assets       β”‚                 β”‚   Backend (Python stdlib)β”‚
β”‚  HTML / CSS / JS / JSON  β”‚                 β”‚  server.py β€” dev server  β”‚
β”‚  books.json Β· poetry.htmlβ”‚                 β”‚  + admin content API     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚                                          β”‚
               β–Ό                                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        External Services                         β”‚
β”‚  Algolia (search) Β· Kit (newsletter) Β· GitHub (deployment)       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology
Frontend Zero frameworks β€” pure HTML5, CSS3, Vanilla JS
CSS Modular system under css/ (main.css imports the rest)
JS ES5-style modules bundled into js/bundle.js via Backend/build.py
Backend Python standard library only (http.server, socketserver, json, re)
Search Algolia (algoliasearch via npm)
Newsletter Kit (ConvertKit)
Deployment Render (auto-deploy + auto-commit GitHub pipeline)

πŸš€ Getting Started

Prerequisites

  • Python 3.12+
  • Node/npm (only for Algolia index building)

1. Build the JS bundle

python Backend/build.py

This concatenates all modules in js/ into js/bundle.js and script.js.

2. Start the dev server

python Backend/server.py

Serves on http://localhost:5001 (override with PORT).

The server also powers the admin panel. To unlock it, set ADMIN_PASSWORD in a .env file:

ADMIN_PASSWORD=your_password_here
GITHUB_TOKEN=your_token_here   # optional: enables auto-commit on publish

3. Regenerate books.json / sitemap (if needed)

python Backend/generate_books_json.py   # rebuild poetry section, preserve book pages
python Backend/algolia-build-index.py   # rebuild Algolia search records from sitemap

πŸ—‚οΈ Project Structure

KnowFlux/
β”œβ”€β”€ index.html                 # Home page
β”œβ”€β”€ reader.html                # Dynamic book reader (loads pages from books.json)
β”œβ”€β”€ aboutbook.html             # Book overview
β”œβ”€β”€ contents.html              # Chapter contents (tabbed by book)
β”œβ”€β”€ poetry.html                # Poetry grid (index of all poems)
β”œβ”€β”€ omni-dex.html              # Interactive character database
β”œβ”€β”€ search.html                # Algolia-powered search
β”œβ”€β”€ feedback.html              # Reader feedback
β”œβ”€β”€ admin.html                 # Password-protected content generator
β”œβ”€β”€ comingsoon.html            # "Next chapter" splash page
β”œβ”€β”€ books.json                 # πŸ“– THE content source β€” all book pages live here
β”œβ”€β”€ sitemap.xml                # Auto-generated on publish
β”œβ”€β”€ algolia_records.json       # Search index records (generated)
β”œβ”€β”€ css/                       # Modular CSS (main.css aggregates everything)
β”‚   β”œβ”€β”€ main.css
β”‚   β”œβ”€β”€ base.css
β”‚   β”œβ”€β”€ layout.css
β”‚   β”œβ”€β”€ navigation.css
β”‚   β”œβ”€β”€ reading.css
β”‚   β”œβ”€β”€ poetry.css
β”‚   β”œβ”€β”€ omni-dex.css
β”‚   β”œβ”€β”€ darkmode.css
β”‚   └── ...
β”œβ”€β”€ js/                        # ES5 JS modules
β”‚   β”œβ”€β”€ bundle.js              # Built output (run Backend/build.py)
β”‚   β”œβ”€β”€ reader.js              # Dynamic book page loading
β”‚   β”œβ”€β”€ navigation.js          # Menu, mobile overlay, promo cycling
β”‚   β”œβ”€β”€ reading.js             # Reading experience controller
β”‚   β”œβ”€β”€ contents.js            # Contents tabs + bookmark-aware links
β”‚   β”œβ”€β”€ random.js              # "Random poem/book" buttons
β”‚   β”œβ”€β”€ footer.js              # Copyright year (CST) + footer reveal
β”‚   └── omni-dex.js            # Omni-Dex data, filters, modal
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ server.py              # Dev server + admin content API
β”‚   β”œβ”€β”€ build.py               # JS bundler
β”‚   β”œβ”€β”€ generate_books_json.py # Regenerate books.json from HTML
β”‚   β”œβ”€β”€ algolia-build-index.py # Build Algolia search records
β”‚   └── config.py              # Shared ROOT_DIR constant
β”œβ”€β”€ Images/                    # Static images
β”œβ”€β”€ Poetry/                    # Generated poem HTML files
└── package.json               # npm (only algoliasearch)

✍️ Publishing Workflow

  1. Log into /admin, enter the password.
  2. Pick a tab β€” Pinnacle, Exploded, or Poetry.
  3. Fill in the form:
    • Book pages: page number, chapter title, content (with [dream] / [thought] / [underline] markers)
    • Poems: title, section (or new section), stanzas separated by blank lines
  4. Hit Generate β€” the server:
    • Writes to books.json (or creates a poem HTML file / updates poetry.html)
    • Regenerates sitemap.xml
    • Auto-commits and pushes to GitHub (if GITHUB_TOKEN is set)
  5. Render deploys automatically. πŸŽ‰

Content Markers (book pages)

Marker Renders as
[dream]...[/dream] Styled italic memory card
[thought]...[/thought] Blue italic inline thought
[underline] Orange horizontal divider

πŸ”§ Configuration

Variable Purpose
PORT Server port (default 5001)
ADMIN_PASSWORD Admin panel password (from .env)
GITHUB_TOKEN Enables auto-commit/push on content publish
GIT_REPO_URL Override repo URL for auto-commit (defaults to origin)

Algolia keys live in script.js/search.html β€” swap them for your own fork.


πŸ§ͺ Testing

The project currently has no automated tests β€” a great next step! Key areas that would benefit:

  • Backend/server.py content-block parser (parse_content_blocks, render_content_blocks)
  • Backend/build.py bundling
  • Backend/algolia-build-index.py record generation
  • js/ modules (reader data loading, bookmark logic, Omni-Dex filtering)

πŸ“„ License

Β© 2026 KnowFlux β€” Keep Blooming, Keep Flying