alterego
- Stars
- 6
- Language
- TypeScript
- Updated
AlterEgo AI - Superhero Personality Generator
"With great power comes great responsibility... and awesome superhero alter egos!"
AlterEgo AI is an interactive web application that transforms your personality into a unique superhero alter ego using Google's Gemini AI. Take our comic-book themed personality quiz and discover what superhero you would be in the multiverse!
Features
- Personality Quiz: Answer comic-book themed questions to reveal your inner superhero
- AI-Powered Generation: Uses Google's Gemini AI to create custom superhero profiles
- Comic Book UI: Authentic comic panel styling with animations
- Dynamic Results: Unique hero names, powers, weaknesses, and origin stories
- Responsive Design: Works on desktop and mobile devices
- Screenshot Ready: Capture and share your superhero profile
Tech Stack
- Frontend: React 19 with TypeScript
- Build Tool: Vite
- AI Integration: Google Gemini AI (@google/genai)
- Animations: Framer Motion
- Charts: Recharts
- Styling: Tailwind CSS (comic-book themed)
- Image Export: html2canvas
Prerequisites
- Node.js (v16 or higher)
- npm or yarn
- Google Gemini API key
Installation
-
Clone the repository
git clone https://github.com/yourusername/alterego-ai.git cd alterego-ai -
Install dependencies
npm install -
Set up environment variables
Create a
.envfile in the root directory:API_KEY=your_google_gemini_api_key_hereNote: Get your API key from Google AI Studio
-
Start the development server
npm run dev -
Open your browser
Navigate to
http://localhost:5173to see your superhero generator in action!
Usage
- Landing Page: Click "Begin Your Hero's Journey" to start
- Personality Quiz: Answer 8+ comic-themed questions about your preferences and personality
- AI Generation: Watch as Gemini AI creates your unique superhero profile
- Hero Reveal: Discover your hero name, powers, weaknesses, and origin story
- Share: Take a screenshot of your alter ego and share with friends!
Project Structure
alterego-ai/
├── public/
├── src/
│ ├── components/
│ │ └── ComicUI.tsx # Comic book styled UI components
│ ├── services/
│ │ └── geminiService.ts # Google Gemini AI integration
│ ├── App.tsx # Main application component
│ ├── constants.ts # Quiz questions and constants
│ ├── types.ts # TypeScript type definitions
│ └── index.tsx # Application entry point
├── package.json
├── vite.config.ts
└── README.md
API Configuration
The app uses Google's Gemini 3.0 Flash model for generating superhero profiles. Make sure your API key has access to the Gemini API.
Environment Variables
API_KEY: Your Google Gemini API key
Customization
Quiz Questions
Edit constants.ts to add or modify personality quiz questions:
export const QUIZ_QUESTIONS: Question[] = [
{
id: 1,
text: "Your custom question here?",
options: [
"Option A",
"Option B",
"Option C",
"Option D"
],
},
// ... more questions
];
Styling
The app uses Tailwind CSS with custom comic-book themed classes. Modify the styles in component files or add custom CSS classes.
Deployment
Build for Production
npm run build
Preview Production Build
npm run preview
Deploy to Platforms
The built files in dist/ can be deployed to:
- Vercel
- Netlify
- GitHub Pages
- Any static hosting service
Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Use TypeScript for all new code
- Follow React best practices
- Test your changes thoroughly
- Update documentation as needed
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Google Gemini AI for powering the superhero generation
- Stan Lee for inspiring the comic book narrative style
- Framer Motion for smooth animations
- Tailwind CSS for styling flexibility
Troubleshooting
Common Issues
API Key Error: Make sure your .env file contains a valid Google Gemini API key.
Build Errors: Ensure you're using Node.js v16+ and all dependencies are installed.
Animation Issues: Check that Framer Motion is properly imported.
Support
If you encounter issues:
- Check the browser console for errors
- Verify your API key is correct
- Ensure all dependencies are installed
- Open an issue on GitHub
Made with love and a dash of comic book magic!# alterego