An AI-powered visual novel generator that creates immersive stories with stunning illustrations using Google Gemini 3 Pro Preview.
- AI Story Generation: Create complete visual novel stories from simple prompts
- AI Image Generation: Generate beautiful anime/manga-style illustrations for each scene
- Interactive Reader: Navigate through your story with an immersive reading experience
- Customizable: Choose the number of scenes (3-10) for your story
- Responsive Design: Works beautifully on both desktop and mobile devices
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: Node.js + Express + TypeScript
- AI: Google Gemini 3 Pro Preview (gemini-3-pro-image-preview)
- Node.js 18 or higher
- npm or yarn
- Google Gemini API key (Get one here)
-
Clone or navigate to the project directory
cd visualnovelgenerator -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:cp .env.example .env
Edit
.envand add your Google Gemini API key:GEMINI_API_KEY=your_actual_api_key_here PORT=3001 VITE_API_URL=http://localhost:3001
Run both the client and server in development mode:
npm run devThis will start:
- Client on http://localhost:5173
- Server on http://localhost:3001
Client only:
npm run dev:clientServer only:
npm run dev:servernpm run build-
Enter a Story Prompt
- Describe your visual novel idea (e.g., "A detective solving a mystery in a cyberpunk city")
- Minimum 10 characters, maximum 1000 characters
-
Choose Scene Count
- Select between 3-10 scenes using the slider
-
Generate
- Click "Generate Visual Novel" and wait 2-5 minutes
- The AI will create your story and generate images for each scene
-
Read Your Visual Novel
- Navigate through scenes using the arrow buttons or keyboard (← →)
- Enjoy the immersive reading experience with text and images
-
Create Another Story
- Click "Create New Story" to start over
visualnovelgenerator/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── hooks/ # React hooks
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ └── package.json
│
├── server/ # Express backend
│ ├── src/
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic (Gemini API)
│ │ └── types/ # TypeScript types
│ └── package.json
│
├── .env # Environment variables (not tracked)
├── .env.example # Environment template
└── package.json # Root workspace config
Generate a visual novel story with images.
Request:
{
"prompt": "Your story idea",
"sceneCount": 5
}Response:
{
"success": true,
"story": {
"title": "Generated Title",
"scenes": [
{
"sceneNumber": 1,
"text": "Scene description...",
"imageData": "base64_encoded_image",
"mimeType": "image/png"
}
]
}
}- Make sure your
.envfile exists in the root directory - Verify your API key is correct and active
- Check the server console for error messages
- Some scenes might fail to generate images due to API rate limits
- The story will still be created with text
- Try generating fewer scenes or wait a moment before retrying
- Ensure port 3001 is not already in use
- Check that all dependencies are installed (
npm install) - Verify your Node.js version is 18 or higher
- Ensure the server is running
- Check that
VITE_API_URLin.envmatches your server URL - Verify CORS is enabled on the server
- Generation time: 2-5 minutes depending on scene count
- Images are generated at 2K resolution (16:9 aspect ratio)
- Each scene's image is typically 500KB-2MB in size
MIT
Powered by Google Gemini AI