An AI-powered interactive storytelling and social game app where users can create, play, and share dynamic story-based adventures.
- AI Story Engine: Generate unique narratives from simple prompts using OpenAI
- Branching Gameplay: Multiple choice-based paths with different endings
- Dynamic Characters: AI-generated characters with consistent personalities
- Adaptive Narratives: Stories that evolve based on player choices
- Collaborative Stories: Multiplayer sessions with friends
- Story Sharing: Save, publish, and discover community stories
- Social Feed: Like, comment, and follow other creators
- Challenge Mode: Creative constraints and daily writing prompts
- AI-Generated Visuals: Story scenes and character artwork (DALL-E integration)
- Adaptive Audio: Dynamic background music matching story tone
- Responsive Design: Optimized for desktop and mobile
- User Profiles: Track stories, achievements, and social connections
- Achievement System: Badges and milestones for engagement
- Dark/Light Theme: Modern neon-accented design with theme switching
- Next.js 14 - React framework with App Router
- TypeScript - Type safety and developer experience
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations and transitions
- ShadCN/UI - Modern component library
- Lucide Icons - Beautiful icon system
- Next.js API Routes - Serverless functions
- Prisma ORM - Type-safe database operations
- PostgreSQL - Production database (Neon/Supabase)
- NextAuth.js - Authentication with OAuth support
- OpenAI API - Story and image generation
- StabilityAI - Alternative image generation
- Cloudinary - Media storage and optimization
- Vercel - Hosting and serverless functions
- Neon/Supabase - Managed PostgreSQL database
- Node.js 18+ and npm
- PostgreSQL database (local or cloud)
- OpenAI API key
-
Clone the repository
git clone <repository-url> cd dreamforge
-
Install dependencies
npm install
-
Set up environment variables Copy
.env.localand configure:# Database DATABASE_URL="postgresql://username:password@localhost:5432/dreamforge" # NextAuth.js NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-secret-key-here" # AI Services OPENAI_API_KEY="your-openai-key" STABILITY_API_KEY="your-stability-key" # optional # Google OAuth (recommended) GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com" GOOGLE_CLIENT_SECRET="your-client-secret" # GitHub OAuth (optional) GITHUB_ID="your-github-client-id" GITHUB_SECRET="your-github-client-secret"
📝 For Google OAuth setup, see GOOGLE_OAUTH_SETUP.md for detailed instructions.
-
Set up the database
npx prisma generate npx prisma db push
-
Start development server
npm run dev
Visit http://localhost:3000 to see the application.
src/
├── app/ # Next.js 14 App Router
│ ├── api/ # API routes
│ │ ├── auth/ # NextAuth endpoints
│ │ ├── generate-story/ # Story generation
│ │ ├── continue-story/ # Story continuation
│ │ └── stories/ # Story CRUD
│ ├── create/ # Story creation page
│ ├── story/[id]/ # Story player
│ ├── explore/ # Story discovery
│ ├── dashboard/ # User stories
│ ├── profile/ # User profile
│ └── settings/ # User settings
├── components/
│ ├── ui/ # Reusable UI components
│ ├── layout/ # Layout components
│ ├── story/ # Story-specific components
│ └── theme-provider.tsx
├── lib/
│ ├── auth.ts # NextAuth configuration
│ ├── prisma.ts # Prisma client
│ ├── openai.ts # OpenAI integration
│ └── utils.ts # Utility functions
└── prisma/
└── schema.prisma # Database schema
- User provides premise, genre, style, and optional constraints
- OpenAI generates initial story with characters and first scene
- Story saved to database with branching structure
- Players make choices, triggering continuation generation
- AI maintains consistency using conversation context
- Users: Authentication and profile data
- Stories: Story metadata and JSON content structure
- Sessions: Multiplayer game sessions
- Social Features: Likes, comments, follows
- NextAuth.js with multiple providers (OAuth + credentials)
- JWT sessions for performance
- Protected routes and API endpoints
- Connect GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy automatically on git push
- Neon: Serverless PostgreSQL
- Supabase: Full backend with auth and storage
- Configure connection string in environment variables
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpx prisma studio- Database GUInpx prisma generate- Generate Prisma client
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Basic story creation and playing
- AI story generation
- User authentication
- Story sharing and discovery
- Responsive UI with dark/light themes
- Multiplayer collaborative stories
- Real-time chat in story sessions
- Advanced AI image generation
- Audio generation and integration
- Mobile app development
- Story marketplace with monetization
- Advanced analytics for creators
- Community challenges and competitions
- Integration with external platforms
- Advanced AI features (voice, video)
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@dreamforge.ai or join our Discord community.
Built with ❤️ using Next.js, OpenAI, and modern web technologies.