Nightlio: The Self-Hosted Mood Tracker That Turns SQLite Into a Product Engine

A privacy-first journaling app that keeps the stack small, the data local, and the experience surprisingly rich.

8 min read • View on GitHub • More from shirsakm

A hand drops a mood card into a compact mechanical slot on a workbench. The card splits into three paths that feed a calendar tile, an achievement badge, and a journal page beneath a small SQLite machine. It explains how one log entry can power multiple product behaviors at once.
Nightlio turns a single mood entry into a streak, a journal update, and an analytics refresh. The point is not storage alone. It is momentum.
Key Takeaways

Nightlio’s best trick is that it does not treat a mood entry as a dead record. One action can update the journal, refresh analytics, and unlock an achievement in the same pass. That is a small design choice with a big product effect: the app rewards consistency without needing a heavy backend or a noisy notification system.

A Mood Log That Behaves Like a System

Most mood trackers store entries. Nightlio compounds them. The app treats logging as the start of a loop, not the end of a form submission. That is why it feels more like a product engine than a notes page with charts.

A close-up of interlocking database blocks labeled by their roles in the system, with one lever above them firing an achievement check after a mood block slides into place. It explains how the app assembles database behavior from mixins and service-layer side effects.
Nightlio’s database is assembled from focused pieces instead of hidden inside one large ORM layer. The service layer then pulls the lever that checks achievements right after a mood is stored.

Why This Exists: A Privacy-First Answer to Subscription Fatigue

Nightlio was inspired by awesome mood-tracking apps like Daylio, but born out of frustration with aggressive subscription models, paywalls, and a lack of cross-platform access.

shirsakm, Creator and Maintainer · shirsakm/nightlio README

That motivation matters because it shapes everything else. Nightlio is not trying to be a universal life OS. It is trying to be a dependable daily ritual that respects ownership, privacy, and portability. The self-hosting story is not a bonus feature. It is the premise.

Your sensitive data is stored in a simple SQLite database file on *your* server. No third-party trackers or analytics.

shirsakm, Creator and Maintainer · shirsakm/nightlio README

The Stack Stays Small on Purpose

The stack is straightforward: React 19 on the front end, Flask on the API, SQLite for storage, Docker for packaging, and Nginx for serving. That combination is not fashionable. It is practical. It keeps the deployment legible for a single user on a home server and still leaves room for authentication, analytics, and rich journaling.

Nightlio’s architecture is a loop, not a pile of services. Identity can change between single-user and OAuth modes, but the data path stays the same.

The Clever Part: Mixins, Not a Heavy ORM

The database layer is where Nightlio gets surprisingly elegant. Instead of hiding everything behind a large ORM, the project splits schema, CRUD operations, and domain logic into mixins. Those pieces reassemble into one database interface, which keeps the code focused and the intent obvious.

class MoodDatabase(SchemaMixin, MoodMixin, AchievementMixin):
    def __init__(self, db_path: str):
        self.db_path = db_path
        self.conn = sqlite3.connect(db_path)
        self.conn.row_factory = sqlite3.Row

    def create_mood_entry(self, user_id, mood, journal_text, tags):
        entry_id = self.db.insert_mood_entry(user_id, mood, journal_text, tags)
        self.db.check_achievements(user_id)
        return entry_id

The pattern is simple, but it buys the project a lot. Schema lives in one place. Mood-specific SQL lives in another. Achievement logic stays close to the service that needs it. The result is a codebase that reads like a set of responsibilities, not a pile of abstractions.

Achievements Are Not a Skin, They Are a Side Effect

Nightlio’s gamification works because it happens immediately. When a mood entry is created, the service layer checks achievements right away. That means the app can respond to a meaningful action in the same moment it happens, which is exactly when habit-forming software earns trust.

This is also why the project feels more alive than a plain tracker. The calendar updates. The streak changes. The badge appears. None of that requires a background worker parade. It is the payoff of a tidy service layer and a database that knows how to do a little more than store rows.

Single-User First, Multi-User When You Need It

The application factory keeps the deployment story flexible. In one configuration, Nightlio behaves like a personal home-lab app with a default user. In another, environment-driven blueprints can bring in OAuth and multiple users. The same core pipeline survives both modes, which is a smart way to avoid building two products.

ModeIdentityBest forOperational shape
Single-userLocal default identityPrivate home servers and solo useSimplest setup, least friction
Multi-userOAuth-backed accountsShared installs and broader accessMore moving parts, same core loop

Where It Fits in the Self-Hosted Landscape

ProductWhat it optimizes forData ownershipMood tracking depthJournaling depthSelf-hosting
NightlioFocused mood ritualsFull ownershipHighHighYes
DaylioPolished mobile trackingClosed platformHighMediumNo
JoplinGeneral notes and syncUser-controlledLowHighYes
Standard NotesPrivate note-takingEncrypted and user-controlledLowMediumYes
MonicaPersonal CRM breadthSelf-hosted ownershipLowMediumYes

The contrast is sharp. Daylio is the benchmark, but it lives behind a proprietary wall. Joplin and Standard Notes are broader tools that can be bent toward journaling, but they are not opinionated about mood. Monica is self-hostable and useful, but much wider in scope. Nightlio wins by being narrower and more product-shaped.

What Nightlio Suggests About Modern Self-Hosted Apps

The project’s lesson is bigger than mood tracking. You do not need a giant stack to create a durable product experience. You need a clean loop, a clear incentive, and an architecture that lets one action ripple through the system without friction. Nightlio proves that local-first software can still feel polished, sticky, and alive.