Fresh Cards - Tech Notes

How does Fresh Cards store its card and lesson data? How are exported deck files formatted? This page will explain how. I'll also go into a little bit of detail of future features planned.

Why make this info open?

I want to have the file format information open so that if people wish to export their data or use it for other purposes, they can. Please be aware that Fresh Cards uses a journal system to store data about changes to the database data, so it is not recommended that you write tools to directly manipulate the data.

If you wish to write tools, I highly recommend creating something to generate Fresh Pack files. I'm planning on writing some tools myself to make it possible to convert Anki decks more easily.

Card and lesson storage

Card and lesson info are stored in the app's Documents folder. (On iOS, it's stored in the data folder, which is the parent folder of the Documents folder.) The info about all decks is stored in one SQLite database and each deck gets a separate folder, with its own SQLite database and folders for storing resources and sync data.

More details coming soon.

Import/Export - Fresh Pack file format

When you export a deck, a .freshpack file is created. This file is actually just a zip archive. You can use the built-in macOS Archive Utility to unarchive the file. Simply control-click on the .freshpack file and select Open With/Archive Utility. This will unarchive it to a new folder.

Within the folder is a cards.sqlite file and a resources folder. The cards.sqlite file is simply a SQLite database. I recommend using DB Browser for SQLite to view it. There are two tables in the database, a cards table, which is all the cards that were exported. The identifier field is a unique identifier used to look up the card. The resources table contains an entry for each resource that is referenced by a card. Resources are images and audio files.

The resources folder contains all of the image and audio resources. The filename corresponds to the resource entry in the database.

More notes on the DB schema coming soon.

Journal sync format

Fresh Cards uses a journal system for syncing data across devices. What this means is that whenever you do anything to cards or lessons in the app, it gets recorded as an action in a journal for that specific device. For instance, when you finish a lesson, each card's lesson score is stored as a journal entry. This entry is used to make changes to the data storage for the deck.

What future features are you planning?

I have a few things in store for future updates. This is a mostly ordered list of features I'm thinking about or working on. The features at the top will be implemented next.