# Project export: EverWell

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 12.0
- Tagline: “NYT games” specifically designed for elderly, simultaneously tracking cognitive and mental health. We provide stats about potential decline, and alert for early warning signs. Learn, grow, connect.
- Devpost: https://devpost.com/software/everwell-u2ygno
- GitHub: https://github.com/anika213/calhacks
- Video: https://www.youtube.com/embed/bIqIkHwOCn0?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — anika213 (9 commits)

## Devpost submission (written by the team)

### Inspiration

We were inspired by conversations with our grandparents and other elderly individuals who often spoke about loneliness, lack of purpose, and cognitive decline as some of the hardest challenges of aging. We wanted to build a compassionate, easy-to-use solution that helps them not only track their cognitive and emotional health, but also reconnect with loved ones and peers in a meaningful way. Our Product Our app provides an interactive dashboard where elderly users can track their progress across both mental health and cognitive function using short, engaging games and reflection activities. Key Features Daily Brain & Mood Games: Exercises inspired by the Stroop Test and List Recall games to assess attention, memory, and reaction speed. Progress Tracking Dashboard: Visual summaries that show improvement trends over time. Connection Mode: A “social circle” feature that lets users share results and messages with family or friends. Multiplayer Games with LLM Facilitation: Games can be played cooperatively or competitively, with a language model acting as a mediator or host, making the experience conversational and friendly. Accessibility for the Visually Impaired: Integrated Fish Audio APIs convert tasks and feedback into speech so users with limited vision can participate equally. How We Built It We developed the app using the MERN stack: Frontend: React Native for cross-platform mobile accessibility (iOS and Android). Backend: Node.js and Express for API handling and real-time communication. Database: MongoDB for secure, scalable storage of user data and performance metrics. Audio Layer: Fish Audio API for speech-based interactions and accessibility. Chat + Multiplayer: JanitorAI API for enabling conversational game facilitation and social connection. We also incorporated a token-based authentication system (JWT) for secure user sessions and integrated LLM-driven prompts that adapt the difficulty of tasks based on performance trends. Challenges We Faced Accessibility Design: Ensuring games were equally usable by both sighted and visually impaired users required extensive experimentation with audio feedback and timing. LLM Integration: Calibrating the language model to act as a friendly “game host” without over-responding or confusing users was a significant UX challenge. Data Visualization: Representing cognitive data trends in a way that is intuitive and not overwhelming for older users took several design iterations. What We Learned We learned how technology can bridge generational gaps when designed with empathy and accessibility in mind. We also deepened our understanding of integrating audio-based AI models, handling real-time multiplayer state management, and designing for users who are often overlooked by mainstream tech. Future Vision We plan to expand the app with: Personalized difficulty calibration using reinforcement learning and adaptive learning features. Integration with wearables (e.g., Apple Watch, Fitbit) to combine physical and cognitive metrics. AI-driven health insights for early detection of cognitive decline.

## README (from the GitHub repository)

# 🧠 ElderCare Cognitive & Connection Platform

> An empathetic, accessible app designed to help elderly individuals track cognitive health, combat loneliness, and reconnect with loved ones through engaging activities and social features.

---

## 📖 Inspiration

After heartfelt conversations with our grandparents and other elderly individuals, we learned that **loneliness**, **lack of purpose**, and **cognitive decline** are among the most challenging aspects of aging. These conversations inspired us to create a compassionate, user-friendly solution that:

- Helps track cognitive and emotional health
- Facilitates meaningful connections with loved ones and peers
- Provides an engaging, accessible experience for all users

---

## ✨ Features

### 🎮 Daily Brain & Mood Games
Interactive exercises inspired by clinical assessments like the **Stroop Test** and **List Recall** games to evaluate:
- Attention span
- Memory retention
- Reaction speed
- Cognitive flexibility

### 📊 Progress Tracking Dashboard
Intuitive visual summaries that display:
- Performance trends over time
- Cognitive improvement metrics
- Mood tracking insights

### 🤝 Connection Mode
A **social circle feature** enabling users to:
- Share game results with family and friends
- Send messages and stay connected
- Build a supportive community

### 🎲 Multiplayer Games with LLM Facilitation
- Play cooperatively or competitively with friends
- AI-powered game host provides conversational, friendly guidance
- Adaptive difficulty based on player performance

### ♿ Accessibility for the Visually Impaired
- **Fish Audio API** integration for speech-based interactions
- Audio feedback for all tasks and game results
- Full accessibility for users with limited vision

---

## 🛠️ Tech Stack

**Frontend**
- React Native (cross-platform mobile: iOS & Android)

**Backend**
- Node.js
- Express.js
- JWT authentication for secure sessions

**Database**
- MongoDB (scalable, secure user data storage)

**AI & Audio**
- JanitorAI API (conversational game facilitation)
- Fish Audio API (text-to-speech for accessibility)

**Additional Tools**
- Real-time communication for multiplayer features
- Adaptive LLM prompts for personalized difficulty

---

## 🚀 Getting Started

### Prerequisites
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
- React Native development environment

### Installation

1. **Clone the repository**
```bash
git clone https://github.com/yourusername/eldercare-app.git
cd eldercare-app
```

2. **Install backend dependencies**
```bash
cd backend
npm install
```

3. **Install frontend dependencies**
```bash
cd ../frontend
npm install
```

4. **Configure environment variables**
Create a `.env` file in the backend directory:
```env
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JANITOR_AI_API_KEY=your_janitorai_key
FISH_AUDIO_API_KEY=your_fish_audio_key
PORT=8000
```

5. **Start the backend server**
```bash
cd backend
npm start
```

6. **Start the React Native app**
```bash
cd frontend
npm start
# For iOS
npm run ios
# For Android
npm run android
```

---

## 📱 Usage

1. **Create an account** or log in
2. **Complete daily brain games** to track cognitive performance
3. **Check your dashboard** for progress insights
4. **Connect with family** through the social circle feature
5. **Play multiplayer games** with friends using the LLM-facilitated game mode

---

## 🔧 Challenges We Overcame

### Accessibility Design
Ensuring games were equally usable for both sighted and visually impaired users required extensive experimentation with audio feedback timing and clarity.

### LLM Integration
Calibrating the language model to act as a friendly, helpful "game host" without overwhelming or confusing users was a significant UX challenge that required careful prompt engineering.

### Data Visualization
Creating intuitive, non-overwhelming visual representations of cognitive trends for older users took multiple design iterations and user testing.

---

## 💡 What We Learned

- How **technology can bridge generational gaps** when designed with empathy and accessibility as core principles
- Best practices for integrating **audio-based AI models** for accessibility
- Techniques for **real-time multiplayer state management**
- The importance of **designing for underserved user demographics**

## 🙏 Acknowledgments

- Our grandparents and elderly community members who shared their experiences
- Fish Audio for accessibility API support
- JanitorAI for conversational AI capabilities
- The open-source community for invaluable tools and resources


## Detected evidence (automated analysis)

Indexed codebase: 35 recognized source files, 158 KB.
- JavaScript (language) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- TypeScript (language) — detected in the code
- MongoDB (technology) — claimed on Devpost, not found in the code
- Node.js (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (42 of 42)

```
backend/.gitignore
backend/server.js
backend/test.js
backend/test.py
frontend/.gitignore
frontend/.vscode/extensions.json
frontend/.vscode/settings.json
frontend/app.json
frontend/app/_layout.tsx
frontend/app/(tabs)/_layout.tsx
frontend/app/(tabs)/cogtab.tsx
frontend/app/(tabs)/game.tsx
frontend/app/(tabs)/index.tsx
frontend/app/(tabs)/login.tsx
frontend/app/(tabs)/mhealth.tsx
frontend/app/(tabs)/tracker.tsx
frontend/app/index.tsx
frontend/app/modal.tsx
frontend/app/profile.tsx
frontend/components/external-link.tsx
frontend/components/GameFramework.tsx
frontend/components/haptic-tab.tsx
frontend/components/hello-wave.tsx
frontend/components/parallax-scroll-view.tsx
frontend/components/themed-text.tsx
frontend/components/themed-view.tsx
frontend/components/ui/collapsible.tsx
frontend/components/ui/icon-symbol.ios.tsx
frontend/components/ui/icon-symbol.tsx
frontend/components/ui/tab-bar-background.tsx
frontend/components/UserAvatar.tsx
frontend/constants/theme.ts
frontend/contexts/AuthContext.tsx
frontend/eslint.config.js
frontend/hooks/use-color-scheme.ts
frontend/hooks/use-color-scheme.web.ts
frontend/hooks/use-theme-color.ts
frontend/package.json
frontend/README.md
frontend/scripts/reset-project.js
frontend/tsconfig.json
README.md
```

### Dependencies

- frontend/package.json: @expo/vector-icons@^15.0.3, @react-native-async-storage/async-storage@^2.2.0, @react-native-picker/picker@^2.11.4, @react-navigation/bottom-tabs@^7.4.0, @react-navigation/elements@^2.6.3, @react-navigation/native@^7.1.8, @types/react@~19.1.0, @types/react-native@^0.72.8, eslint@^9.25.0, eslint-config-expo@~10.0.0, expo@~54.0.20, expo-blur@^15.0.7, expo-constants@~18.0.10, expo-font@~14.0.9, expo-haptics@~15.0.7, expo-image@~3.0.10, expo-linear-gradient@^15.0.7, expo-linking@~8.0.8, expo-router@~6.0.13, expo-splash-screen@~31.0.10, expo-status-bar@~3.0.8, expo-symbols@~1.0.7, expo-system-ui@~6.0.8, expo-web-browser@~15.0.8, react@19.1.0, react-dom@19.1.0, react-native@0.81.5, react-native-gesture-handler@~2.28.0, react-native-reanimated@~4.1.1, react-native-safe-area-context@~5.6.0, react-native-screens@~4.16.0, react-native-web@~0.21.0, react-native-worklets@0.5.1, typescript@~5.9.2

### Recent commits (newest first)

- edit readme
- edit readme
- Create README for ElderCare Cognitive & Connection Platform
- list stuff
- impairment
- mental health features
- mental health challenge
- minor changes
- changes
- accuracies
- initial version
- initial commit

## Key source files (fetched from GitHub, selected and truncated for size)

### frontend/package.json

```
{
  "name": "frontend",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "reset-project": "node ./scripts/reset-project.js",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "lint": "expo lint"
  },
  "dependencies": {
    "@expo/vector-icons": "^15.0.3",
    "@react-native-async-storage/async-storage": "^2.2.0",
    "@react-native-picker/picker": "^2.11.4",
    "@react-navigation/bottom-tabs": "^7.4.0",
    "@react-navigation/elements": "^2.6.3",
    "@react-navigation/native": "^7.1.8",
    "expo": "~54.0.20",
    "expo-blur": "^15.0.7",
    "expo-constants": "~18.0.10",
    "expo-font": "~14.0.9",
    "expo-haptics": "~15.0.7",
    "expo-image": "~3.0.10",
    "expo-linear-gradient": "^15.0.7",
    "expo-linking": "~8.0.8",
    "expo-router": "~6.0.13",
    "expo-splash-screen": "~31.0.10",
    "expo-status-bar": "~3.0.8",
    "expo-symbols": "~1.0.7",
    "expo-system-ui": "~6.0.8",
    "expo-web-browser": "~15.0.8",
    "react": "19.1.0",
    "react-dom": "19.1.0",
    "react-native": "0.81.5",
    "react-native-gesture-handler": "~2.28.0",
    "react-native-reanimated": "~4.1.1",
    "react-native-safe-area-context": "~5.6.0",
    "react-native-screens": "~4.16.0",
    "react-native-web": "~0.21.0",
    "react-native-worklets": "0.5.1"
  },
  "devDependencies": {
    "@types/react": "~19.1.0",
    "@types/react-native": "^0.72.8",
    "eslint": "^9.25.0",
    "eslint-config-expo": "~10.0.0",
    "typescript": "~5.9.2"
  },
  "private": true
}

```

### backend/server.js

```javascript
const express = require('express');
const cors = require('cors');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');

// const { RateLimiterMemory } = require('rate-limiter-flexible');
const { MongoClient, GridFSBucket, ObjectId } = require("mongodb");
require('dotenv').config();
const mongoose = require("mongoose");
const stream = require('stream');

const axios= require("axios");
const app = express();
const router = express.Router()


const uri = process.env.MONGO_URI
console.log(uri)
const client = new MongoClient(uri);
const database = client.db(process.env.DATABASE_NAME);
const usersCollection = database.collection("users");
const gamesCollection = database.collection("games");

const bodyParser = require('body-parser');
app.use(cors({
    origin: '*',
  }));
  
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

// JWT Secret (in production, use environment variable)
const JWT_SECRET = process.env.JWT_SECRET;

async function connection(){
    try {
        // Connect to the mongo cluster
        await client.connect();
        console.log("connected to MONGOdb");
       
    } catch (e) {
        console.error(e);
}
}
connection().catch(console.error);

// Authentication Middleware
const authenticateToken = (req, res, next) => {
  const authHeader = req.headers['authorization'];
  const token = authHeader && authHeader.split(' ')[1];

  if (!token) {
    return res.status(401).json({ success: false, message: 'Access token required' });
  }

  jwt.verify(token, JWT_SECRET, (err, user) => {
    if (err) return res.status(403).json({ success: false, message: 'Invalid or expired token' });
    req.user = user;
    next();
  });
};

// Authentication Routes
// Register new user

// Check if email already exists
app.get('/api/auth/check-email', async (req, res) => {
    try {
        console.log("in check email")
      const { email } = req.query;
      if (!email) {
        return res.status(400).json({ success: false, message: 'Email is required' });
      }
  
      const existingUser = await usersCollection.findOne({ email: email.toLowerCase() });
  
      if (existingUser) {
        return res.status(200).json({ success: true, exists: true });
      } else {
        return res.status(200).json({ success: true, exists: false });
      }
    } catch (error) {
      console.error('Error checking email:', error);
      res.status(500).json({ success: false, message: 'Internal server error' });
    }
  });
  
app.post('/api/auth/register', async (req, res) => {
  try {
    const { email, password, name, age, preferredLanguage } = req.body;

    // Validate required fields
    if (!email || !password || !name || !age) {
      return res.status(400).json({
        success: false,
        message: 'Missing required fields: email, password, name, and age are required'
      });
    }

    // Check if user already exists
    const existingUser = await usersCollection.findOne({ email: email.toLowerCase() });
    if (existingUser) {
      return res.status(409).json({
        success: false,
        message: 'User with this email already exists'
      });
    }

    // Hash password
    const saltRounds = 10;
    const hashedPassword = await bcrypt.hash(password, saltRounds);

    // Create user document
    const userProfile = {
      email: email.toLowerCase(),
      password: hashedPassword,
      name: name.trim(),
      age: parseInt(age),
      preferredLanguage: preferredLanguage || 'English',
      isVisuallyImpaired: isVisuallyImpaired || false,
      accuracies: [], // Initialize empty accuracies array
      mhealth_games: [], // Initialize empty mental health games array
      createdAt: new Date(),
      updatedAt: new Date()
    };

    // Insert user into database
    const result = await usersCollection.insertOne(userProfile);

    // Generate JWT token
    const token = jwt.sign(
      { userId: user._id, email: user.email },
      JWT_SECRET,
      { expiresIn: '7d' }
    );
    
    


    res.status(201).json({
      success: true,
      message: 'User registered successfully',
      token,
      user: {
        id: result.insertedId,
        email: email.toLowerCase(),
        name: name.trim(),
        age: parseInt(age),
        preferredLanguage: preferredLanguage || 'English'
      }
    });

  } catch (error) {
    console.error('Error registering user:', error);
    res.status(500).json({
      success: false,
      message: 'Internal server error'
    });
  }
});

// Login user
app.post('/api/auth/login', async (req, res) => {
  try {
    const { email, password } = req.body;

    // Validate required fields
    if (!email || !password) {
      return res.status(400).json({
        success: false,
        message: 'Email and password are required'
      });
    }

    // Find user by email
    const user = await usersCollection.findOne({ email: email.toLowerCase() });
    if (!user) {
      return res.status(401).json({
        success: false,
        message: 'Invalid email or password, did you forget to create an account?'
      });
    }

    // Check password
    const isValidPassword = await bcrypt.compare(password, user.password);
    if (!isValidPassword) {
      return res.status(401).json({
        success: false,
        message: 'Invalid email or password'
      });
    }

    // Generate JWT token
    const token = jwt.sign(
      { userId: user._id, email: user.email },
      JWT_SECRET,
      { expiresIn: '7d' }
    );

    res.status(200).json({
      success: true,
      message: 'Login successful',
      token,
      user: {
        id: user._id,
        email: user.email,
        name: user.name,
        age: user.age,
        preferredLanguage: user.preferredLanguage,
        isVisuallyImpaired: user.isVisuallyImpaired || false
      }
    });

  } catch (error) {
    console.error('Error logging in user:', error);
    res.status(500).json({
      success: false,
      message: 'Internal server err
[truncated — 12382 more characters]
```

### frontend/app/_layout.tsx

```typescript
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import 'react-native-reanimated';

import { useColorScheme } from '@/hooks/use-color-scheme';
import { AuthProvider } from '@/contexts/AuthContext';

export const unstable_settings = {
  initialRouteName: '(tabs)',
};

export default function RootLayout() {
  const colorScheme = useColorScheme();

  return (
    <AuthProvider>
      <ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
        <Stack>
          <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
          <Stack.Screen name="profile" options={{ headerShown: false }} />
          <Stack.Screen name="modal" options={{ presentation: 'modal', title: 'Modal' }} />
        </Stack>
        <StatusBar style="auto" />
      </ThemeProvider>
    </AuthProvider>
  );
}

```

### frontend/app/index.tsx

```typescript
import React, { useEffect, useRef } from 'react';
import { 
  View, 
  Text, 
  StyleSheet, 
  TouchableOpacity, 
  ScrollView, 
  Animated 
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { LinearGradient } from 'expo-linear-gradient';
import { useRouter } from 'expo-router';
import { IconSymbol } from '@/components/ui/icon-symbol';
import * as Haptics from 'expo-haptics';

export default function HomeScreen() {
  const router = useRouter();
  
  // subtle fade + scale animation
  const fadeAnim = useRef(new Animated.Value(0)).current;
  const scaleAnim = useRef(new Animated.Value(0.95)).current;

  useEffect(() => {
    Animated.parallel([
      Animated.timing(fadeAnim, {
        toValue: 1,
        duration: 1200,
        useNativeDriver: true,
      }),
      Animated.spring(scaleAnim, {
        toValue: 1,
        friction: 5,
        useNativeDriver: true,
      }),
    ]).start();
  }, []);

  const handleCheckInPress = () => {
    Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
    router.push('/(tabs)/game');
  };

  const handleChatPress = () => {
    // Haptics.selectionAsync();
    // router.push('/(tabs)/chat');
  };

  return (
    <LinearGradient
      colors={['#F4F9F4', '#E8F0E8', '#FAF8F5']}
      style={styles.gradientBackground}
    >
      <SafeAreaView style={styles.container}>
        <ScrollView 
          contentContainerStyle={styles.scrollContent} 
          showsVerticalScrollIndicator={false}
        >
          {/* Animated Greeting */}
          <Animated.View style={[styles.greetingContainer, { opacity: fadeAnim, transform: [{ scale: scaleAnim }] }]}>
            <Text style={styles.greeting}>Good Morning</Text>
          </Animated.View>

          {/* Header Section */}
          <View style={styles.header}>
            <Text style={styles.title}>EverWell</Text>
            <Text style={styles.subtitle}>
              Track your mental and cognitive wellness daily with fun, mindful exercises.
            </Text>
          </View>

          {/* Primary Action: Daily Check-In */}
          <TouchableOpacity
            style={styles.primaryButton}
            onPress={handleCheckInPress}
            activeOpacity={0.85}
          >
            <IconSymbol name="heart.fill" size={20} color="#fff" />
            <Text style={styles.primaryButtonText}>Start Daily Check-In</Text>
          </TouchableOpacity>

          {/* Secondary Action: Chat */}
          <TouchableOpacity
            style={styles.chatButton}
            onPress={handleChatPress}
            activeOpacity={0.85}
          >
            <IconSymbol name="bubble.left.and.bubble.right.fill" size={20} color="#6B8E6B" />
            <Text style={styles.chatButtonText}>Chat with Me</Text>
          </TouchableOpacity>
        </ScrollView>
      </SafeAreaView>
    </LinearGradient>
  );
}

const styles = StyleSheet.create({
  gradientBackground: {
    flex: 1,
  },
  container: {
    flex: 1,
  },
  scrollContent: {
    flexGrow: 1,
    padding: 24,
    justifyContent: 'center',
  },
  greetingContainer: {
    alignItems: 'center',
    marginBottom: 30,
  },
  greeting: {
    fontSize: 28,
    fontWeight: '600',
    color: '#5A6B5A',
    letterSpacing: 0.5,
  },
  header: {
    alignItems: 'center',
    marginBottom: 40,
  },
  title: {
    fontSize: 40,
    fontWeight: '700',
    color: '#4E5E4E',
    marginBottom: 12,
    letterSpacing: 1,
  },
  subtitle: {
    fontSize: 17,
    textAlign: 'center',
    color: '#6C7C6C',
    lineHeight: 25,
    paddingHorizontal: 15,
  },
  primaryButton: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#6B8E6B',
    paddingVertical: 14,
    paddingHorizontal: 20,
    borderRadius: 16,
    alignSelf: 'center',
    width: '70%',
    shadowColor: '#8EBB8E',
    shadowOpacity: 0.25,
    shadowRadius: 8,
    shadowOffset: { width: 0, height: 4 },
    elevation: 3,
  },
  primaryButtonText: {
    color: '#fff',
    fontSize: 17,
    fontWeight: '600',
    marginLeft: 8,
  },
  chatButton: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#F1F5F1',
    paddingVertical: 14,
    paddingHorizontal: 20,
    borderRadius: 16,
    alignSelf: 'center',
    width: '70%',
    marginTop: 20,
    borderWidth: 1,
    borderColor: '#D6E0D6',
  },
  chatButtonText: {
    color: '#6B8E6B',
    fontSize: 17,
    fontWeight: '600',
    marginLeft: 8,
  },
});

```

### frontend/app/(tabs)/_layout.tsx

```typescript
import { Tabs } from 'expo-router';
import { Platform } from 'react-native';

import { HapticTab } from '@/components/haptic-tab';
import { IconSymbol } from '@/components/ui/icon-symbol';
import TabBarBackground from '@/components/ui/tab-bar-background';
import { Colors } from '@/constants/theme';
import { useColorScheme } from '@/hooks/use-color-scheme';
import { UserAvatar } from '@/components/UserAvatar';
import { useAuth } from '@/contexts/AuthContext';

export default function TabLayout() {
  const colorScheme = useColorScheme();
  const { user } = useAuth();

  return (
    <Tabs
      screenOptions={{
        tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
        headerShown: false,
        tabBarButton: HapticTab,
        tabBarBackground: TabBarBackground,
        tabBarStyle: Platform.select({
          ios: {
            // Use a transparent background on iOS to show the blur effect
            position: 'absolute',
          },
          default: {},
        }),
      }}>
      <Tabs.Screen
        name="index"
        options={{
          title: 'Home',
          tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
        }}
      />

      <Tabs.Screen
        name="tracker"
        options={{
          title: 'Tracker',
          tabBarIcon: ({ color }) => <IconSymbol size={28} name="chart.bar" color={color} />,
        }}
      />
      <Tabs.Screen
        name="game"
        options={{
          title: 'Game',
          tabBarIcon: ({ color }) => <IconSymbol size={28} name="gamecontroller" color={color} />,
        }}
      />

<Tabs.Screen
        name="login"
        options={{
          title: user ? 'Profile' : 'Login',
          tabBarIcon: ({ color }) => user ? (
            <UserAvatar size={28} />
          ) : (
            <IconSymbol size={28} name="person.fill" color={color} />
          ),
        }}
      />
      <Tabs.Screen
        name="cogtab"
        options={{
          href: null, // Hide from tab bar
        }}
      />
      <Tabs.Screen
        name="mhealth"
        options={{
          href: null, // Hide from tab bar
        }}
      />
    </Tabs>
  );
}

```

### frontend/app/(tabs)/index.tsx

```typescript
import React, { useEffect, useRef } from 'react';
import { 
  View, 
  Text, 
  StyleSheet, 
  TouchableOpacity, 
  ScrollView, 
  Animated 
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { LinearGradient } from 'expo-linear-gradient';
import { useRouter } from 'expo-router';
import { IconSymbol } from '@/components/ui/icon-symbol';
import * as Haptics from 'expo-haptics';

export default function HomeScreen() {
  const router = useRouter();
  
  // subtle fade + scale animation
  const fadeAnim = useRef(new Animated.Value(0)).current;
  const scaleAnim = useRef(new Animated.Value(0.95)).current;

  useEffect(() => {
    Animated.parallel([
      Animated.timing(fadeAnim, {
        toValue: 1,
        duration: 1200,
        useNativeDriver: true,
      }),
      Animated.spring(scaleAnim, {
        toValue: 1,
        friction: 5,
        useNativeDriver: true,
      }),
    ]).start();
  }, []);

  const handleCheckInPress = () => {
    Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
    router.push('/(tabs)/game');
  };

  const handleSignInPress = () => {
    Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
    router.push('/(tabs)/login');
  };

  return (
    <LinearGradient
      colors={['#F4F9F4', '#E8F0E8', '#FAF8F5']}
      style={styles.gradientBackground}
    >
      <SafeAreaView style={styles.container}>
        <ScrollView 
          contentContainerStyle={styles.scrollContent} 
          showsVerticalScrollIndicator={false}
        >
          {/* Animated Greeting */}
          <Animated.View style={[styles.greetingContainer, { opacity: fadeAnim, transform: [{ scale: scaleAnim }] }]}>
            <Text style={styles.greeting}>Good Morning</Text>
          </Animated.View>

          {/* Header Section */}
          <View style={styles.header}>
            <Text style={styles.title}>EverWell</Text>
            <Text style={styles.subtitle}>
              Track your mental and cognitive wellness daily with fun, mindful exercises.
            </Text>
          </View>

          {/* Primary Action: Daily Check-In */}
          <TouchableOpacity
            style={styles.primaryButton}
            onPress={handleCheckInPress}
            activeOpacity={0.85}
          >
            <IconSymbol name="heart.fill" size={20} color="#fff" />
            <Text style={styles.primaryButtonText}>Start Daily Check-In</Text>
          </TouchableOpacity>

          {/* Secondary Action: Sign In */}
          <TouchableOpacity
            style={styles.signInButton}
            onPress={handleSignInPress}
            activeOpacity={0.85}
          >
            <IconSymbol name="person.fill" size={20} color="#6B8E6B" />
            <Text style={styles.signInButtonText}>Sign In</Text>
          </TouchableOpacity>
        </ScrollView>
      </SafeAreaView>
    </LinearGradient>
  );
}

const styles = StyleSheet.create({
  gradientBackground: {
    flex: 1,
  },
  container: {
    flex: 1,
  },
  scrollContent: {
    flexGrow: 1,
    padding: 24,
    justifyContent: 'center',
  },
  greetingContainer: {
    alignItems: 'center',
    marginBottom: 30,
  },
  greeting: {
    fontSize: 28,
    fontWeight: '600',
    color: '#5A6B5A',
    letterSpacing: 0.5,
  },
  header: {
    alignItems: 'center',
    marginBottom: 40,
  },
  title: {
    fontSize: 40,
    fontWeight: '700',
    color: '#4E5E4E',
    marginBottom: 12,
    letterSpacing: 1,
  },
  subtitle: {
    fontSize: 17,
    textAlign: 'center',
    color: '#6C7C6C',
    lineHeight: 25,
    paddingHorizontal: 15,
  },
  primaryButton: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#6B8E6B',
    paddingVertical: 14,
    paddingHorizontal: 20,
    borderRadius: 16,
    alignSelf: 'center',
    width: '70%',
    shadowColor: '#8EBB8E',
    shadowOpacity: 0.25,
    shadowRadius: 8,
    shadowOffset: { width: 0, height: 4 },
    elevation: 3,
  },
  primaryButtonText: {
    color: '#fff',
    fontSize: 17,
    fontWeight: '600',
    marginLeft: 8,
  },
  signInButton: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#F1F5F1',
    paddingVertical: 14,
    paddingHorizontal: 20,
    borderRadius: 16,
    alignSelf: 'center',
    width: '70%',
    marginTop: 20,
    borderWidth: 1,
    borderColor: '#D6E0D6',
  },
  signInButtonText: {
    color: '#6B8E6B',
    fontSize: 17,
    fontWeight: '600',
    marginLeft: 8,
  },
});

```

### frontend/eslint.config.js

```javascript
// https://docs.expo.dev/guides/using-eslint/
const { defineConfig } = require('eslint/config');
const expoConfig = require('eslint-config-expo/flat');

module.exports = defineConfig([
  expoConfig,
  {
    ignores: ['dist/*'],
  },
]);

```

### backend/test.py

```python
from openai import OpenAI 
client = OpenAI( base_url="https://janitorai.com/hackathon", api_key="calhacks2047" ) 
completion = client.chat.completions.create( model="x2", 
            messages=[ {"role": "system", "content": "You are a helpful assistant. Return answer in regular text format."}, {"role": "user", "content": "Hello!"} ] )

print(completion[0]['choices'][0]['message']['content'])
```

### backend/test.js

```javascript
// ESM (recommended). If you use CommonJS, replace the import with: 
// const OpenAI = require("openai").default;
const OpenAI = require("openai").default;

const client = new OpenAI({
  apiKey: "calhacks2047",
  baseURL: "https://janitorai.com/hackathon"
});

async function main() {
  try {
    const completion = await client.chat.completions.create({
      model: "x2", // same as your Python example
      messages: [
        { role: "system", content: "You are a helpful assistant." },
        { role: "user", content: "Hello!" }
      ]
    });

    console.log(completion.choices)
  } catch (err) {
    console.error("API error:", err);
  }
}

main();

```

### frontend/hooks/use-color-scheme.ts

```typescript
export { useColorScheme } from 'react-native';

```

[24 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]