Skip to content

NextGenXplorer/Dr_Detective_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•ต๏ธ Dr. Detective - Expo Mobile App

A beautiful, animated Expo React Native app for the Dr. Detective API (Akinator game). Features a detective character with dynamic expressions and smooth animations.

By NextgenX - Mobile Edition

๐Ÿš€ Built with Expo SDK 54 (Latest)

โœจ Features

  • ๐ŸŽญ Animated Detective Character with 7 different expressions
  • ๐ŸŒˆ Gorgeous UI with gradients and smooth transitions
  • ๐ŸŽฏ Dynamic Expressions that change based on game progress
  • ๐Ÿ“ฑ Fully Responsive mobile experience
  • ๐ŸŒ Multi-Language Support (16 languages)
  • ๐ŸŽจ Multiple Themes (Characters, Animals, Objects)
  • โšก Smooth Animations using React Native Reanimated
  • ๐Ÿ”„ Real-time Progress Tracking
  • ๐ŸŽ‰ Victory Animations with character reveals

๐Ÿ“ฑ Screenshots

Home Screen

  • Detective character with "thinking" expression
  • Language selector with flags
  • Theme selector with emojis
  • Animated start button

Game Screen

  • Dynamic detective expressions:
    • ๐Ÿค” Thinking (0-40% progress)
    • ๐Ÿ‘€ Curious (40-60% progress)
    • โœจ Excited (60-80% progress)
    • ๐Ÿ˜Ž Confident (80-100% progress)
    • ๐Ÿ˜• Confused (after 20 questions)
    • ๐ŸŽ‰ Victory (when guessed)
    • ๐Ÿ˜ฒ Shocked (when guess rejected)

Victory Screen

  • Character image with details
  • Accept/Reject buttons
  • Play again functionality

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 16+ installed
  • Expo CLI installed globally
  • Expo Go app on your mobile device
  • Dr_DetectiveAPI deployed to Vercel (or running locally)

Installation

  1. Navigate to project directory:
cd DrDetectiveExpo
  1. Install dependencies:
npm install
  1. Configure API URL (Optional - already set):

The API URL is configured in .env:

API_BASE_URL=https://dr-detective-api-ddgt.vercel.app/api

To change it, edit .env file and restart with npm start --clear

See ENV_SETUP.md for detailed configuration options.

  1. Start the app:
npm start
  1. Run on your device:
  • Scan the QR code with Expo Go app (Android)
  • Scan with Camera app (iOS)

๐Ÿ”ง API Configuration

Deploying to Vercel

  1. Navigate to your API directory:
cd ../Dr_DetectiveAPI
  1. Install Vercel CLI (if not already installed):
npm install -g vercel
  1. Deploy:
vercel
  1. Copy the deployment URL and update it in the Expo app:
// services/DrDetectiveAPI.js
const API_BASE_URL = 'https://your-deployment-url.vercel.app/api';

Local Testing

  1. Start the Flask API:
cd ../Dr_DetectiveAPI
python api.py
  1. Find your computer's IP:
# Linux/Mac
hostname -I | awk '{print $1}'

# Or check network settings
ip addr show | grep "inet "
  1. Update API URL in Expo app:
const API_BASE_URL = 'http://YOUR_IP:5000/api';
// Example: 'http://192.168.1.100:5000/api'

๐Ÿ“‚ Project Structure

DrDetectiveExpo/
โ”œโ”€โ”€ App.js                      # Main app with navigation
โ”œโ”€โ”€ package.json                # Dependencies
โ”œโ”€โ”€ app.json                    # Expo configuration
โ”œโ”€โ”€ babel.config.js             # Babel configuration
โ”‚
โ”œโ”€โ”€ services/
โ”‚   โ””โ”€โ”€ DrDetectiveAPI.js       # API service layer
โ”‚
โ”œโ”€โ”€ components/
โ”‚   โ””โ”€โ”€ Detective.js            # Animated detective character
โ”‚
โ”œโ”€โ”€ screens/
โ”‚   โ”œโ”€โ”€ HomeScreen.js           # Start screen
โ”‚   โ””โ”€โ”€ GameScreen.js           # Game/question screen
โ”‚
โ””โ”€โ”€ assets/                     # Images and icons

๐ŸŽจ Detective Expressions

The detective character dynamically changes expressions based on the game state:

Expression Trigger Eyes Icon
Thinking Start/Low progress ๐Ÿค” ๐Ÿ”
Curious 40-60% progress ๐Ÿ‘€ โ“
Excited 60-80% progress โœจ ๐Ÿ˜ƒ
Confident 80%+ progress ๐Ÿ˜Ž ๐Ÿ’ก
Confused 20+ questions ๐Ÿ˜• โ”
Victory Correct guess ๐ŸŽ‰ ๐Ÿ†
Shocked Guess rejected ๐Ÿ˜ฒ โ€ผ๏ธ

๐ŸŽฎ How to Play

  1. Start the app and select your preferences:

    • Choose a theme (Characters, Animals, or Objects)
    • Choose a language
  2. Think of a character (or animal/object)

  3. Answer the detective's questions:

    • โœ… Yes
    • โŒ No
    • ๐Ÿคท Don't Know
    • ๐Ÿค” Probably
    • ๐Ÿ˜• Probably Not
  4. Watch the detective get more confident as progress increases

  5. When the detective makes a guess:

    • Accept if correct
    • Reject to continue playing

๐Ÿ› ๏ธ Development

Running in Development

# Start Expo development server
npm start

# Start on Android emulator
npm run android

# Start on iOS simulator (Mac only)
npm run ios

# Start in web browser
npm run web

Key Components

Detective Component (components/Detective.js):

  • Animated character with breathing effect
  • Dynamic color gradients based on expression
  • Glow animation
  • Progress indicator
  • Bounce effect on expression changes

API Service (services/DrDetectiveAPI.js):

  • Singleton API client
  • Automatic session management
  • Error handling
  • Connection testing
  • Support for all API endpoints

Home Screen (screens/HomeScreen.js):

  • Language and theme selection
  • Entrance animations
  • API connection testing
  • Error handling with user feedback

Game Screen (screens/GameScreen.js):

  • Question display with animations
  • Answer buttons with gradients
  • Progress tracking
  • Victory screen with character info
  • Back navigation

๐ŸŒ Supported Languages

  • ๐Ÿ‡ฌ๐Ÿ‡ง English (en)
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish (es)
  • ๐Ÿ‡ซ๐Ÿ‡ท French (fr)
  • ๐Ÿ‡ฉ๐Ÿ‡ช German (de)
  • ๐Ÿ‡ฎ๐Ÿ‡น Italian (it)
  • ๐Ÿ‡ฏ๐Ÿ‡ต Japanese (jp)
  • ๐Ÿ‡ฐ๐Ÿ‡ท Korean (kr)
  • ๐Ÿ‡จ๐Ÿ‡ณ Chinese (cn)
  • ๐Ÿ‡ท๐Ÿ‡บ Russian (ru)
  • ๐Ÿ‡น๐Ÿ‡ท Turkish (tr)
  • ๐Ÿ‡ต๐Ÿ‡น Portuguese (pt)
  • ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch (nl)
  • ๐Ÿ‡ต๐Ÿ‡ฑ Polish (pl)
  • ๐Ÿ‡ธ๐Ÿ‡ฆ Arabic (ar)
  • ๐Ÿ‡ฎ๐Ÿ‡ฑ Hebrew (il)
  • ๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesian (id)

๐ŸŽฏ Themes

  • ๐Ÿ‘ค Characters - Famous people, fictional characters
  • ๐Ÿพ Animals - Real and fictional animals
  • ๐Ÿ“ฆ Objects - Various objects and things

๐Ÿ› Troubleshooting

"Network request failed" error

Problem: App can't connect to API

Solutions:

  1. Check API URL in services/DrDetectiveAPI.js
  2. Ensure API is running (check with browser)
  3. Use IP address instead of localhost for physical devices
  4. Check firewall settings on your computer

"Could not start game" error

Problem: API returns error when starting game

Solutions:

  1. Check API logs for errors
  2. Verify Vercel deployment is working
  3. Test API endpoint in browser: https://your-api.vercel.app/
  4. Check network connectivity

Detective not animating

Problem: Character appears static

Solutions:

  1. Ensure react-native-reanimated is installed
  2. Check babel.config.js includes reanimated plugin
  3. Restart Expo with npm start --clear

Expo Go won't connect

Problem: QR code scan doesn't work

Solutions:

  1. Ensure phone and computer are on same WiFi
  2. Try tunnel mode: npm start --tunnel
  3. Update Expo Go app to latest version

๐Ÿ“ฆ Building for Production

Android APK

# Install EAS CLI
npm install -g eas-cli

# Configure EAS
eas build:configure

# Build APK
eas build --platform android --profile preview

iOS IPA (requires Mac + Apple Developer account)

# Build for iOS
eas build --platform ios

๐ŸŽจ Customization

Change Theme Colors

Edit gradients in screens/components:

// Example: Change background gradient
<LinearGradient
  colors={['#YOUR_COLOR_1', '#YOUR_COLOR_2', '#YOUR_COLOR_3']}
  style={styles.container}
/>

Add New Detective Expressions

Add to components/Detective.js:

case 'your_expression':
  return {
    eyes: '๐Ÿ˜Š',
    mouth: '๐ŸŽ‰',
    color1: '#FF6B6B',
    color2: '#4ECDC4'
  };

Modify Animations

Adjust timing in components:

Animated.timing(scaleAnim, {
  toValue: 1.05,
  duration: 2000,  // Change duration
  useNativeDriver: true,
})

๐Ÿ“„ License

MIT License

๐Ÿ™ Credits

๐Ÿค Contributing

Contributions welcome! Please feel free to submit a Pull Request.

๐Ÿ“ง Support

Having issues? Please check:

  1. API is running and accessible
  2. API URL is correctly configured
  3. All dependencies are installed
  4. Expo Go app is up to date

Made with โค๏ธ by NextgenX

Enjoy playing Dr. Detective! ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ”

About

By NxG

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors