Skip to content

3. FOLDER FUNCTIONS AND CONTRIBUTIONS

Collins Dada edited this page Jun 10, 2025 · 1 revision

MindMirror


Root-Level

Folder/File Purpose
README.md High-level overview with project description, install guide, and demo video.
netlify.toml Defines how Netlify builds and deploys the app.
.env.example Sample environment variables for APIs (Tavus, ElevenLabs, RevenueCat, etc.).
bolt.json Configuration for Bolt.new platform integration.
LICENSE Project licensing file (MIT, Apache, etc.).

.github/workflows/

File Purpose
ci.yml GitHub Actions for running CI, lint checks, and deploying to Netlify.

Contribution: Ensures automated deployment and smooth DevOps lifecycle.


public/

File Purpose
favicon.ico Browser icon.
manifest.json Defines app metadata for PWA/mobile integration.
robots.txt SEO config for search engines.

Contribution: Supports mobile-first experience and SEO discoverability.


src/


src/app/

File Purpose
layout.js Wraps the app with navigation, auth guards, and global layouts.
page.js Main entry-point page — renders homepage content or dashboard redirect.

Contribution: UX/Navigation flow foundation, contributes to daily logic, layout, and auth.


src/pages/

Page Use Case
index.jsx Welcome/landing page — demo call-to-action, mission pitch.
dashboard.jsx Central hub: video feed, streak tracker, journaling, and voice interactions.
journal.jsx Daily journaling interface + gratitude prompts.
mood-checkin.jsx Mood tracker UI to capture emotional state daily.
settings.jsx Profile management, language selection, avatar/voice preference setup.
paywall.jsx RevenueCat integration screen for subscriptions and billing.

Contribution: Core to daily mental hygiene loop, subscription flow, and user engagement.


src/components/

Component Use Case
VideoTherapist.jsx Displays Tavus-generated AI video that speaks directly to the user.
VoiceResponder.jsx ElevenLabs-powered dynamic voice responses based on user mood/journal.
MoodTracker.jsx UI component to track mood (emoji scale, slider, etc).
JournalCard.jsx Displays saved journal entries; supports reflection browsing.
StreakCounter.jsx Visually shows streak progress and motivates consistency.
PaywallModal.jsx Modal paywall with RevenueCat plans, discounts, upgrade call-to-actions.
Navbar.jsx / Footer.jsx UI navigation and app branding components.

Contribution: Enhances video/voice UX and gamification through streaks and visuals.


src/hooks/

Hook Use Case
useUserMemory.js Remembers user preferences, mood history, journal entries (in local storage or DB).
useVoicePlayback.js Controls ElevenLabs voice responses and timing per session.

Contribution: Powers user memory logic + adaptive personalization.


src/lib/

Lib Use Case
tavus.js Custom wrapper for Tavus API — handles video creation, fetching, and caching.
elevenlabs.js API wrapper for generating & playing voice files with ElevenLabs.
revenuecat.js Manages subscriptions, receipts, entitlements using RevenueCat SDK/API.
algorand.js (Optional) Manages Algorand blockchain smart contract for verifiable user data/payment.
supabaseClient.js Connects to Supabase DB — stores journals, mood, and streaks securely.

Contribution: Handles all backend integrations and BOLT challenge SDKs.


src/context/

Context Use Case
AuthContext.js Handles user login, state, and auth-based routing logic.

Contribution: Powers secure, private sessions and conditional UI behavior.


src/data/

File Use Case
dummyUsers.json Seed/test data for development.
languages.json List of supported locales for multilingual expansion.

Contribution: Supports language diversity and fast prototyping.


src/utils/

Utility Use Case
encryptData.js Encrypts journal and mood logs to ensure user privacy.
trackStreaks.js Calculates daily streak consistency for motivation feedback.
formatDate.js Formats timestamps across UI and logs.

Contribution: Powers security-first logic + gamification feedback loop.


mobile/ (Optional if using React Native via Expo)

File/Folder Purpose
App.js Main entry-point for mobile app.
screens/ Equivalent of pages/ for mobile.
components/ Reusable mobile UI components.
revenuecat/PaywallConfig.js Config for RevenueCat plans and native paywall setup.

Contribution: Supports cross-platform accessibility — mobile reach & subscriptions.


functions/ (Backend API logic via Netlify Functions)

Function Use Case
create-video.js Calls Tavus API to create new therapist video using user metadata.
synthesize-voice.js Sends journal/mood data to ElevenLabs for personalized voice generation.
get-user-data.js Retrieves encrypted user history (journals, moods, preferences).
track-mood.js Writes new mood entry to DB and updates streak.

Contribution: Powers video/voice agent logic, adaptive intelligence, and daily mental tracking.


scripts/

Script Purpose
deploy.js Automates Netlify deployment or domain verification.
seed.js Inserts sample user mood/journal entries for quick testing.

Contribution: Accelerates development velocity and continuous deployment.


tests/

Test File Purpose
moodTracker.test.js Unit tests mood input/output logic.
videoTherapist.test.js Ensures Tavus video loads and renders correctly.
journalLogic.test.js Validates journaling data flow and streak increment logic.

Contribution: Ensures robust performance, logic validation, and judge confidence.


docs/

Doc Use Case
architecture.md Explains overall system design, flows, and stack decisions.
api-reference.md Endpoint-by-endpoint guide to Tavus, ElevenLabs, Supabase, etc.
pitch-deck.pdf Ready-to-submit PDF for final BOLT pitch video + features overview.

Contribution: Delivers pitch-level clarity and technical transparency to sponsors & judges.


✅ Summary

This structure isn’t just clean—it’s laser-focused on BOLT’s challenge categories:

  • Conversational AI VideoVideoTherapist.jsx, create-video.js
  • Voice AI ChallengeVoiceResponder.jsx, synthesize-voice.js
  • Monetizationpaywall.jsx, revenuecat.js
  • Deploy Challengenetlify.toml, ci.yml, deploy.js
  • Custom Domain → Netlify + Entri DNS
  • Blockchain (Optional)algorand.js