We all have memories, life experiences that make us who we are. Some people keep journals, some go to therapy, I write a program to put them into a database.
The concept of Memory is that our life experiences can be summarized into a few simple categories:
What story or memory do you have that can’t be recalled with some combination of these? And if you had even a cursory account of these that a person could list over the course of just a few hours, don’t you think you’d know them fairly well?
These categories have all sorts of interesting relationships. What Thing doesn’t have its significance wrapped up in associations with a Person, Place or Event? How many of the important Events in our lives don’t include other People, Places or Things? All these things are deeply interrelated, which makes for an interesting data model and a fun application to build, use and browse.
The initial concept is a command line application, since I love using the command line and it’s quick to write an application for that interface. The CLI may be used for adding, editing and browsing the database. For wider publishing, tooling to generate an interactive website from the data will also be provided.
These types and attributes will make up the data layer of the application:
Common Fields on Person, Event, Place and Thing
The Type enum, or class references depending on the language, is used to assign categories to one or more types. For example, “friend” is a useful category for Person, but not Event. Categories can only be associated with their specified Types, or any Type if there are no Types specified.
The Date type is actually a string and can represent one of three levels of specificity:
The reason for this is that an event can span several months or years, and the month and/or day it began and/or ended may or may not be important. Events in Memory can be anything from a multi-year saga to a single interaction.
Start and End on Events allows for a span of time, but an event might be a single day. For this reason, the End date is optional, but the Start date is required.
Photos can be added to the database as references and are stored on the file system. The application will provide reporting to help identify entities that do not yet have a photo associated with them.
Categories are primary classifications and are limited to one per entity. This forces a relatively simple and consistent structure, and keeps the Categories from getting too specific. That’s what Tags are for. Tags can be anything, and any entity can have multiple tags. This distinction allows the application to distinguish between primary and secondary classifications.
In case you’re wondering, I consider pets People, not Things. The fact that Gerald Funklestiltskin is a mouse and not a person is a matter for Category or Tag classification.
Notes are a sort of staging area to quickly jot down ideas and memories that haven’t been fully considered for classification. When tags are displayed in a browsing mode, those only associated with Notes will not be included.
The database is made up of simple markdown files with YAML metadata stored in a git repository.
The UI target is Linux command line, at least initially.
The user experience offers both a stand-alone (single shot) or interactive command line. Not all commands will be available in both modes. $EDITOR or a system-specific default will be used for editing Description and any other long text values. When creating or editing an entity, the user will be prompted for each field and can navigate between the fields using Tab (forward) and Shift-Tab (backward).
Command output will be followed by Browse options, allowing for easy navigation to related items in the database and listing of entries by combinations of type, category and tag. A random item can be pulled up from any prompt to encourage exploration.
memory- enter interactive mode - provides contextual navigation, help, and eliminates need to type “memory” before each command.
memory help- displays a help message for single-shot mode
memory add [Type] "[Name]"- opens $EDITOR for description
memory search [Type=<Type>] [Category=<Category>] [Tags=<Tag[,Tag]>] keywords- lists found items based on filters provided
memory edit [Type] "[Name]"- opens $EDITOR for description
memory delete [Type] "[Name]"- deletes the named entry
memory view [Type] "[Name]"- displays a named entry
memory random- displays a random entry
memory is started with no arguments, it enters interactive mode.
A prompt will display a menu of choices and accept commands.
[a]dd-> Add wizard
[s]earch-> Search tool
[b]rowse-> Browse menu
[r]andom-> Random item w/ Entry detail menu
[h]elp-> Help menu
Add wizard (all wizards support tab, shift+tab to navigate steps):
Entry detail menu:
[m]ain- returns to Main menu
Edit wizard - entered via detail view