Mind-Mend-App: Mind Mend AI: When a Mood Journal Becomes a Triage Engine

A privacy-first wellness app that encrypts journal entries, routes AI through Supabase Edge Functions, and turns emotional check-ins into targeted therapeutic actions.

8 min read • View on GitHub • More from CH-Akshay-pixel

A person sits at a desk with an open journal while a locked channel carries the entry toward a small server relay and then into three branching therapeutic paths. The image explains how the app turns a private mood note into a routed next step instead of a chat loop.
Mind Mend treats AI as a dispatcher. The journal entry goes in, and a targeted intervention comes out.
Key Takeaways

The app does not chat. It routes.

Most wellness apps split into two familiar buckets. They either log feelings and stop, or they chat endlessly and hope the conversation itself helps. Mind Mend takes a different bet: the AI output is not the destination. It is the handoff.

That changes the product shape. A user enters a mood and a note, the note is encrypted, the server analyzes the signal, and the result is a concrete next step. Instead of waiting for insight to emerge from conversation, the app tries to move the user directly into a targeted action.

The core loop is a triage pipeline. Input becomes protected data, protected data becomes analysis, and analysis becomes an immediate action.

Privacy is the product feature

The repo’s privacy posture is not decorative. According to the codebase design, journal entries are encrypted on the client side before they are stored, and the frontend never calls Gemini directly. That means the sensitive part of the flow is split across layers on purpose.

There is also a quieter UX decision hiding inside auth. The app uses a pseudo-anonymous identity flow that creates a virtual email behind the scenes, which lowers the friction of signing up for something deeply personal. That matters here because mental-health tools lose users the moment they start feeling bureaucratic.

The result is a rare combination: the app asks for emotional data, but it works to reduce the social cost of giving it.

The feedback loop is the real engine

The most interesting code path lives in MoodTracker.tsx. It persists the mood entry, sends analysis through a Supabase Edge Function, and then renders suggestions from the model output. The implementation is clever because it treats the AI response as structured UI input, not as prose to be displayed and forgotten.

const handleSubmit = async () => {
  const encryptedJournal = await encryptJournal(journalText);

  await supabase.from('mood_entries').insert({
    mood,
    journal: encryptedJournal,
  });

  const { data } = await supabase.functions.invoke('analyze-mood', {
    body: { mood, journal: encryptedJournal },
  });

  setSuggestions(renderSuggestionsWithGameLinks(data.suggestions));
};

That last line is the trick. The repo uses a small DSL pattern, with tokens like [GAME:breathing], to convert AI text into navigable actions. In practice, that means the model can do more than recommend. It can route the user straight into a specific therapeutic module.

A close-up of a terminal-style response on one side and a UI panel on the other. Embedded tags like [GAME:breathing] and [GAME:memory] snap into clickable buttons, showing how text becomes interface.
The app’s sharpest implementation detail is the text-to-UI bridge. AI output is parsed into actions, not just displayed as advice.

Therapeutic games turn advice into action

The Games area is where the app’s philosophy becomes visible. Breathing, memory, and pattern exercises are not side quests. They are the destination the model can point to when it decides a user needs a specific intervention rather than a broader conversation.

PatternPrimary interactionData handlingAI rolePrivacy postureNext-step clarityImmediate user payoff
Traditional mood trackerLog feelings and review chartsUsually stores raw or lightly protected entriesMinimal or noneOften secondary to analyticsLowTrend awareness
Chatbot wellness appTalk back and forthConversation-heavy and persistentGenerates dialogueDepends on vendor defaultsMediumFeels supportive in the moment
Mind Mend AILog mood, then route to a moduleEncrypts journal text before storageAnalyzes and dispatchesBuilt into the architectureHighA concrete therapeutic action

The difference is subtle but important. Mind Mend does not want the user to linger inside reflection forever. It tries to shorten the distance from insight to action.

A modern full-stack wellness blueprint

The stack is the other reason this repo is worth paying attention to. React, Vite, Supabase, shadcn-ui, React Query, and Edge Functions are a very efficient combination for a small team building sensitive consumer software.

The division of labor is clean. The frontend stays modular. Supabase handles auth, Postgres, and edge orchestration. Gemini stays behind a server-side proxy. That keeps the app fast to build without forcing the browser to become the place where secrets live.

LayerMind Mend choiceWhy it matters
FrontendReact, Vite, shadcn-uiFast iteration and a polished UI without framework overhead
State and dataReact QueryKeeps server state predictable and easy to cache
BackendSupabase plus Edge FunctionsMoves AI calls and sensitive logic off the client
StoragePostgres with RLSSupports structured data and access control
AI integrationGemini through a proxyProtects API keys and centralizes prompts

What Mind Mend trades off

Every architecture choice buys something and gives something up. Client-side encryption protects privacy, but it also limits server-side search and richer personalization over the raw journal text. That is a real cost, not a cosmetic one.

Pseudo-anonymous auth lowers friction, but it can complicate recovery and identity assurance later. And AI routing only works if the model emits well-formed tags and trustworthy suggestions, which means the product depends on disciplined prompt design and careful sanitization.

Those tradeoffs are acceptable if the priority is emotional safety. They are less acceptable if the goal is deep analytics or account portability. Mind Mend clearly chooses the former.