Logseq Project Structure

The privacy-first, open-source knowledge base. A sophisticated ClojureScript application that runs on Web, Desktop (Electron), and Mobile (Capacitor).

Updated 2025-12-30

#logseq #clojurescript #electron #capacitor #local-first #graph-database
PNGPDF

Project Directory

logseq/
src/
Source code
main/
frontend/
Core UI logic (Cljs)
electron/
Desktop main process
electron/
Electron entry point
deps/
Internal libraries (Polylith-style)
db/
Database logic
graph-parser/
Markdown/Org parser
ui/
Shared UI components
resources/
Static assets & templates
android/
Android native project
ios/
iOS native project
shadow-cljs.edn
Build config
deps.edn
Clojure dependencies
package.json
JS dependencies

Repository Info

  • Repository-logseq/logseq
  • Stars-30k+
  • License-AGPL-3.0
  • Last Analyzed-December 2025

Tech Stack

  • Language-ClojureScript
  • Desktop-Electron
  • Mobile-Capacitor (iOS/Android)
  • Database-DataScript (In-memory Graph)
  • Build Tool-Shadow-cljs
  • Styling-Tailwind CSS

Architecture Notes

Logseq is built primarily in ClojureScript. It uses a structure inspired by the Polylith architecture (seen in the deps/ folder) to manage internal libraries. The core logic is platform-agnostic, running in the browser, Electron (Node.js), and Capacitor (WebView).

Key Directories

  • src/main/frontend/-The bulk of the application code. Contains the React components (via Reagent), state management, and plugin system.
  • deps/-Contains isolated modules like graph-parser (handling Markdown/Org-mode parsing) and db (wrapping the graph database interactions).
  • src/electron/-Electron-specific code for file system access and native menus.

Why This Structure?

Logseq is a premier example of a 'Local-First' application. It shows how to build a complex, data-heavy app that runs completely client-side while still offering native capabilities across all major platforms.

Share this template

Related Templates

© 2025 FolderStructure.dev