Where Your Personality Shapes Your Adventure
Features โข Demo โข Tech Stack โข Getting Started โข Project Structure โข API Reference
AndThen (also known as StoryWeave) is an innovative AI-powered storytelling platform that creates personalized, interactive narratives tailored to your unique personality. Take a scientifically-designed personality assessment, discover your character archetype, and embark on adventures where every story element is crafted specifically for you.
- Personality-Driven Narratives: Your HEXACO personality scores directly influence story themes, conflicts, and character dynamics
- Choose-Your-Own-Adventure: Make meaningful choices that shape the story's direction
- Immersive Book Themes: Genre-specific visual themes that transform your reading experience
- Multiplayer Stories: Collaborate with friends on shared storytelling adventures
- Gamification System: Earn XP, level up, and unlock badges as you explore stories
- 16-question psychometric test based on the HEXACO personality model
- Measures 6 core dimensions:
- ๐ฏ Conscientiousness - Organization and discipline
- ๐ฐ Neuroticism - Emotional sensitivity
- ๐ Extraversion - Social energy
- ๐ค Agreeableness - Cooperation and empathy
- ๐จ Openness - Creativity and curiosity
- ๐ Honesty-Humility - Sincerity and modesty
- Assigns a unique Character Archetype based on your profile
- Powered by Google Gemini AI for dynamic, context-aware narratives
- 5 Immersive Genres:
Genre Theme Description ๐ Fantasy Ancient Grimoire Epic quests, magic, and mythical worlds ๐ Sci-Fi Holographic Datapad Future worlds and space exploration ๐ Mystery Detective's Case File Puzzles, secrets, and detective work ๐ Romance Love Letter Love, relationships, and e 8000 motional journeys โฐ๏ธ Adventure Explorer's Journal Thrilling journeys and daring exploits
- Real-time story streaming with smooth animations
- 3 meaningful choices at each decision point
- Choice quality tracking (Excellent โ Bad)
- Story completion with confetti celebration
- Auto-save progress to continue anytime
- Create or join story rooms with friends
- Collaborative storytelling with turn-based choices
- Real-time synchronization across players
- XP & Leveling System - Earn experience for every action
- Achievement Badges:
- ๐ฏ Self Discovery - Complete first personality test
- ๐ Story Weaver - Create first story
- ๐ญ Decision Maker - Make 10 story choices
- ๐ Story Master - Complete 5 stories
- ๐ Genre Explorer - Try all 5 genres
- Genre-specific book themes with unique borders and backgrounds
- Dark/Light mode support
- Responsive book layout - Portrait and landscape optimization
- Smooth Framer Motion animations
graph LR
A[๐ Landing Page] --> B[๐ Sign Up/Login]
B --> C[๐ง Personality Test]
C --> D[๐ Results & Archetype]
D --> E[๐ Choose Genre]
E --> F[๐ฎ Play Story]
F --> G{Make Choice}
G --> F{Nothing Much}
G --> H[๐ Story Complete]
H --> I[๐ Dashboard]
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router |
| React 19 | UI library with latest features |
| TypeScript | Type-safe development |
| Tailwind CSS v4 | Utility-first styling |
| Framer Motion | Smooth animations |
| shadcn/ui + Radix UI | Accessible component library |
| Technology | Purpose |
|---|---|
| Vercel AI SDK | Streaming AI responses |
| Google Gemini | Story generation & personality analysis |
| MongoDB + Mongoose | User authentication & data storage |
| JWT + bcrypt | Secure authentication |
| Technology | Purpose |
|---|---|
| ESLint | Code linting |
| Vitest | Unit testing |
| next-themes | Dark mode support |
- Node.js 18.x or higher
- npm or yarn or pnpm
- MongoDB instance (local or Atlas)
- Google AI API Key for Gemini
-
Clone the repository
git clone https://github.com/yourusername/and-then.git cd and-then -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:# MongoDB Connection MONGO_URI=mongodb+srv://your-connection-string # JWT Secret JWT_SECRET=your-super-secret-jwt-key # Google AI (Gemini) GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-api-key # App URL NEXT_PUBLIC_API_URL=http://localhost:3000
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
npm run build
npm start| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/signup |
Create new user account |
POST |
/api/auth/login |
User login, returns JWT |
GET |
/api/auth/me |
Get current user data |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/personality/save |
Save test results |
GET |
/api/personality |
Get user's personality profile |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/stories/generate |
Generate AI story content (streaming) |
POST |
/api/stories/save |
Save story progress |
GET |
/api/stories/list |
Get user's saved stories |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/gamification |
Get user stats (XP, level, badges) |
POST |
/api/gamification |
Update user stats |
-
Add genre to
STORY_GENRESinlib/story-data.ts:{ id: "horror", name: "Horror", description: "Spine-chilling tales of terror", icon: "๐ป", prompt: "Create a terrifying horror story opening..." }
-
Add visual theme in
lib/book-themes.ts:horror: { id: "horror", name: "Haunted Tome", styles: { /* ... */ } }
-
Add theme assets to
public/themes/horror/
- Modify
PERSONALITY_TRAITSinlib/personality-data.ts - Update
PERSONALITY_QUESTIONSwith new trait mappings - Adjust scoring in
calculatePersonalityScores()
The app uses Tailwind CSS v4 with custom design tokens. Modify app/globals.css for global theme adjustments.
- Personality assessment with HEXACO model
- AI story generation with Google Gemini
- Interactive choose-your-own-adventure gameplay
- Genre-specific visual themes
- User authentication with MongoDB
- Gamification system (XP, badges)
- Multiplayer story rooms
- Story export (PDF, ePub)
- Google OAuth integration
- Mobile app (React Native)
- Story sharing & community features
- Voice narration with TTS
- Advanced AI model fine-tuning
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ by Sagar, Yogesh, Sneha
Start your personalized adventure today!!