← Back to Project Granada
Granada

Development Journal

Notes from building a walled library

v1.0.0 Release

Notebook Enhancements

  • Export functionality: select individual notes with checkboxes and export as separate Markdown files for Obsidian import
  • Sidebar toggle fix: corrected positioning so notes collapse toggle sits outside AI sidebar (dynamic positioning based on AI chat state)
  • New note button fix: updated API to allow creating notes with empty content

Search Improvements

  • Search options: added radio buttons for search precision (some words, all words, consecutive words) and checkboxes for search options
  • Backend query building: updated search.py with _build_fts_query() method to handle new search parameters

Distribution & Packaging

  • PyInstaller configuration: updated config.py with frozen-app-aware path resolution (get_base_dir(), get_resource_dir())
  • Updated granada.spec: added hidden imports, included bundled books directory, set application icon
  • Built Windows executable: 45 MB uncompressed, 18.5 MB zipped

Bundled Content

  • Sample books: downloaded and bundled Quran and Riyadh al-Salihin from OpenITI
  • Auto-import: added import_bundled_books() function to import books on first run

Branding & Icons

  • Created granada.ico: multi-size icon (16, 32, 48, 256px) from PNG source
  • Favicon: added favicon route and links in base.html

Git & GitHub

  • Fixed .gitignore: cleaned up corrupted file, excluded build artifacts, data folder, large PNG
  • Committed to GitHub: 37 files to jbradf0rd/projectgranada
  • Created GitHub Release: v1.0.0 with Granada-v1.0.0-win64.zip (18.5 MB)

Initial setup

Repository created. Flask application structure established with SQLite FTS5 for Arabic full-text search. PyArabic handles diacritics normalization.

  • Basic search functionality working
  • OpenITI book download integration in progress
  • RTL layout implemented

Research and planning

Project Granada started as a question: Why does accessing Islamic knowledge require an internet connection?

Research was conducted into current technologies for offline Arabic full-text search. Options evaluated included SQLite FTS5, Tantivy, Meilisearch, and Elasticsearch. SQLite FTS5 was selected for its embedded simplicity, zero external dependencies, and native support for boolean queries. Tantivy noted as a future option if scaling beyond hundreds of books becomes necessary.

PyArabic identified as the primary library for Arabic text normalization: diacritics stripping, alif normalization, and tatweel removal. OpenITI corpus selected as the text source, providing access to over 2 billion words of premodern Arabic text.

Flask chosen over FastAPI for server-rendered HTML. htmx and Alpine.js selected for frontend interactivity without a build step. PyInstaller targeted for Windows executable distribution.