An open-source, AI-powered text game with meta systems, ending, optional image generation, and optional payments. This React-based simulation game allows you to make decisions to raise a virtual baby, using AI models to generate scenarios, outcomes, and story progression.
The game is currently accessible at https://www.babysim.fun/. Please feel free to play the game as it is. There are many other possible AI-powered text and image based games that could this code base as a starting point, and I hope to see as many such games as possible.
- Multi-Provider AI Support: Switch between OpenAI and DeepSeek (provided by Volcengine) models
- Meta Systems: Enhanced gameplay mechanics
- Multiple Endings: Diverse story outcomes
- Optional Image Generation: Visual representation of key moments
- Payment Integration: Support for premium features
- Dynamic Story Generation: AI-generated scenarios and outcomes based on your choices
- Real-time Model Switching: Compare different AI models' responses during gameplay
- Token Usage Tracking: Monitor API usage and costs
-
Clone the repository
git clone <repository-url> cd baby-raising-simulator
-
Install dependencies
npm install
-
Configure API Keys Create a
.envfile in the project root with your API keys:# OpenAI API Configuration VITE_OPENAI_API_KEY=your_openai_api_key_here # DeepSeek API Configuration VITE_DEEPSEEK_API_KEY=your_deepseek_api_key_here # Volcengine API Configuration VITE_VOLCENGINE_API_KEY=your_volcengine_api_key_here
-
Start the development server
npm run dev
Volcengine is ByteDance's cloud platform providing access to DeepSeek V3 and other AI models:
- LLM Documentation: Volcengine API Reference
- LLM Endpoint:
https://ark.cn-beijing.volces.com/api/v3/chat/completions - Image Generation Documentation: Doubao Image Generation API
- Image Generation Endpoint:
https://ark.cn-beijing.volces.com/api/v3/images/generations - Model:
deepseek-v3-250324- A powerful MoE model with 671B parameters, 37B activated - Key Benefits: Cost-effective access to DeepSeek V3 with enterprise-grade infrastructure
- Documentation: OpenAI API Reference
- Endpoint:
https://api.openai.com/v1/chat/completions - Models:
gpt-4,gpt-3.5-turbo, etc.
The application supports switching between AI providers:
- In development mode, use the model switcher component in the UI
- Current provider is configurable in
src/config/api.ts
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS
- AI Integration: OpenAI-compatible APIs
- State Management: React hooks
src/
├── components/ # React components
├── config/ # API configuration
├── services/ # AI service integration
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
└── main.tsx # Application entry point
For more details about model switching, see MODEL_SWITCHING.md.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
See CHANGELOG.md for versioned release notes.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- OpenAI for GPT models
- Volcano Engine for Deepseek LLM and image generation
- Stripe for payment processing
- Supabase for database and authentication
- Vercel for deployment
This project was created using the "vibe coding" approach. Vibe coding is a development methodology that emphasizes intuition, creativity, and rapid iteration. It involves:
- Quickly prototyping ideas
- Embracing imperfection in early stages
- Iterating based on feel and user feedback
- Balancing structure with flexibility
By using vibe coding, we were able to rapidly develop this AI-powered game, incorporating various features and technologies in an organic, evolving manner.
[The rest of the ESLint configuration section remains unchanged]