Skip to content
acutesoftwarePublic

About

Personal Information Manager for life - API and desktop application

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

412 Commits

Folders and files

Repository files navigation

LifePIM Desktop

LifePIM Desktop is a local-first personal information manager for notes, tasks, calendar events, files, media, audio, places, contacts, money records, and related area data.

The current desktop app is a Flask web application that runs on your PC and uses a local SQLite database. The current entry point is src/app.py; on Windows the expected launcher is src/RUN_DESKTOP.BAT.

LifePIM Desktop is a standalone, single-owner tool. It does not require the mobile app, cloud sync, LifePIM.com, Caddy or any LAN service. The supported security model exposes the browser UI only on the same computer.

Current Status

This is active v3 desktop development. The web UI is usable for local browsing and editing across the main LifePIM areas, but the data/bootstrap path is still developer-oriented and machine-specific in places.

Working at a high level:

  • Local Flask app served at http://127.0.0.1:9741
  • Loopback-only Waitress with LAN/public/mobile/logger endpoints disabled by default
  • Overview dashboard with recent notes, tasks, and calendar context
  • Top-level modules for Calendar, Goals, Tasks, How, Notes, Data, Files, Media, Audio, 3D, Money, People, Places, Apps, Admin, Links, and Areas
  • SQLite-backed data access for the current desktop database
  • Notes, calendar, media, audio, files, contacts, money, links, areas, and settings routes/templates are present
  • Search across LifePIM areas, with optional note-content search
  • Media browsing and event clustering, audio playlist/player views, calendar views, notes list/view/edit screens, and admin/settings screens
  • Importer v1 framework for declarative imports into contacts/files/media and raw/mapped table loaders

Known rough edges:

  • src/init_database.py is destructive and recreates the configured database.
  • Some source paths in config/load scripts are still local-machine paths.
  • Runtime configuration is mostly still driven by src/common/config.py.
  • Incremental refresh jobs are not yet clean production sync jobs.

Screenshots

Latest v3 screenshots are in doc/:

Older layout references are also kept in doc/.

Setup

From the repository root:

python -m venv .venv
.\.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m playwright install chromium

The Chromium step is needed only for rendered web clipping and browser PDF features.

The Windows launcher expects the virtual environment at:

<repo root>\.venv\Scripts\python.exe

INSTALL.BAT is only a minimal legacy helper. Prefer requirements.txt for a repeatable environment.

Configuration

Main configuration currently lives in:

src\common\config.py

Important values include:

  • user_folder
  • DB_FILE / db_name
  • base_url
  • port_num
  • PATH_ALIASES
  • etl_folders_csv
  • area_mappings_csv

The current default app URL is:

http://127.0.0.1:9741

The current default sample database path in src/common/config.py points at:

D:\DATA_LLM\SAMPLE_DATA\lifepim_desktop_data\lifepim.db

Change the config before bootstrapping a different machine or data profile.

Privacy

LifePIM stores personal metadata such as note titles and paths, tasks, calendar events, contacts, Areas, tags, and indexed file/media details. Structured data is kept in the local SQLite database configured by DB_FILE; notes and other file-backed content remain in their configured folders, while operational logs and temporary import files are written locally on the same computer.

LifePIM Desktop does not upload or synchronize this information to LifePIM.com, or to any other external or cloud server. Features you explicitly ask to retrieve web pages, maps, geocoding, school terms or prices may contact those public services, but they do not upload your LifePIM database.

Run

Recommended Windows launcher from the repository root:

src\RUN_DESKTOP.BAT

This starts Waitress at http://127.0.0.1:9741. It rejects wildcard or LAN bind addresses and does not start Caddy.

Manual run from the repository root:

.\.venv\Scripts\python.exe src\app.py

Manual run from src:

cd src
..\.venv\Scripts\python.exe app.py

The old instruction python web_server.py is obsolete.

Database Bootstrap

Only run this when you want to rebuild the configured SQLite database from scratch:

cd src
..\.venv\Scripts\python.exe init_database.py

init_database.py deletes the configured DB_FILE if it exists, recreates the base schema, applies module schemas, runs the current test/sample loaders, and refreshes folder/area mapping data. Do not run it against a database you want to preserve.

More operational detail is in doc/deploy.md.

Network and legacy companion code

LifePIM is supported only at http://127.0.0.1:9741. Public-note, Pocket/mobile and logger API code remains for legacy compatibility but is disabled by default and is outside the reviewed security model. Do not enable those routes or place LifePIM behind a LAN reverse proxy. See doc/network.md and doc/review_security.md.

Legacy per-user file roots

The database retains older per-user fields and path support for compatibility. They are not a reviewed hostile multi-user boundary; normal deployment uses one trusted owner. Existing duncan note and area-folder settings are preserved.

New users get a default root under:

N:\duncan\LifePIM_Data\DATA\lan_users\<username>

LifePIM creates these subfolders for new users:

notes
areas
lists

Only the duncan account uses the full legacy area list and area-folder mapping by default. Other users start with an editable Home, Work, Family, and Fun area list, and new notes go into that user's notes root unless a area folder mapping is explicitly added. Media and audio remain global.

Tests

Run the unit tests from the tests folder:

cd tests
..\.venv\Scripts\python.exe run_tests.py

For a quick app import check from the repository root:

.\.venv\Scripts\python.exe -m py_compile src\app.py

Repository Layout

src\app.py                  Flask app entry point
src\RUN_DESKTOP.BAT         Windows launcher
src\common\                 shared config, data, search, settings, helpers
src\modules\                feature modules and Flask blueprints
src\templates\              shared templates
src\static\                 CSS and JavaScript
src\lifepim\importer\       importer framework
src\lifepim\targets\        importer-backed targets
data\                       CSV seed/config data
tests\                      unit tests and current sample/bootstrap loaders
doc\                        notes, deployment docs, and screenshots
scripts\                    development and migration utilities

Importer v1

Intent: keep import scripts tiny and declarative. Your script specifies what to import, from where, how to map it, and the stable key. LifePIM core handles IDs, upserts, tombstones, and logging.

Steps:

  1. Pick the target domain: contacts, files, media, or a raw table.
  2. Define a mapping: target field to source column or transform.
  3. Choose a stable key: source_uid or sha256.
  4. Pick mode: snapshot, authoritative, or merge.
  5. Dry-run first.

What gets overwritten:

  • Importer targets: fields written by the writer are overwritten on upsert. source_system, source_uid, and imported_* fields are also updated each run.
  • snapshot mode: previously imported rows for the same source_system are marked is_deleted=1.
  • authoritative plus tombstone: rows missing from the current feed are marked is_deleted=1.
  • merge mode: only provided fields are updated; no deletes or tombstones.

Be careful:

  • A wrong key can overwrite unrelated entities. Use a stable key and prefer sha256 for files.
  • snapshot and authoritative can mark many rows deleted if the feed is incomplete.
  • load_tbl is a raw insert with no de-duplication or stable IDs. Use it only for simple append-only tables.

Python usage examples:

import common.import_tools as mod_tool

# CSV -> contacts (importer-backed)
mod_tool.load_csv(
    tbl="lp_contacts",
    fname="contacts.csv",
    map={
        "source_uid": "ContactID",
        "display_name": "Name",
        "email": "Email",
        "phone": "Phone",
    },
    key="source_uid",
    mode="snapshot",
    source_system="contacts_csv",
    dry_run=True,
)

# SQLite -> audio (raw copy)
mod_tool.load_tbl(
    tbl="lp_audio",
    src_db="filelist.db",
    src_tbl="tbl_files",
    cols_to_insert=["file_name", "size"],
    select_named="select metadata_filename, metadata_file",
)

# SQLite -> files (mapped copy with transforms)
mod_tool.load_tbl_mapped(
    tbl="lp_files",
    src_db="filelist.db",
    src_tbl="tbl_files",
    map={
        "path": "path",
        "size": ("size", "to_int"),
        "mtime_utc": ("mtime", "parse_dt_utc"),
        "file_type": "type",
    },
)

About

Personal Information Manager for life - API and desktop application

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages