8000 GitHub - sagarjain03/And_then ยท GitHub
[go: up one dir, main page]

Skip to content
sagarjain03Public

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AndThen Logo

โœจ AndThen AI Powered Interactive Storytelling โœจ

Where Your Personality Shapes Your Adventure

Features โ€ข Demo โ€ข Tech Stack โ€ข Getting Started โ€ข Project Structure โ€ข API Reference

Next.js React TypeScript Tailwind CSS MongoDB Google Gemini


๐ŸŽฏ Overview

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.

๐ŸŒŸ What Makes AndThen Unique?

  • 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

โœจ Features

๐Ÿง  Personality Assessment

  • 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

๐Ÿ“š AI Story Generation

  • 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

๐ŸŽฎ Interactive Gameplay

  • 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

๐Ÿ‘ฅ Multiplayer Mode

  • Create or join story rooms with friends
  • Collaborative storytelling with turn-based choices
  • Real-time synchronization across players

๐Ÿ† Gamification

  • 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

๐ŸŽจ Visual Experience

  • Genre-specific book themes with unique borders and backgrounds
  • Dark/Light mode support
  • Responsive book layout - Portrait and landscape optimization
  • Smooth Framer Motion animations

๐Ÿš€ Demo

User Journey Flow

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]
Loading

๐Ÿ› ๏ธ Tech Stack

Frontend

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

Backend & AI

Technology Purpose
Vercel AI SDK Streaming AI responses
Google Gemini Story generation & personality analysis
MongoDB + Mongoose User authentication & data storage
JWT + bcrypt Secure authentication

Tools & Quality

Technology Purpose
ESLint Code linting
Vitest Unit testing
next-themes Dark mode support

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18.x or higher
  • npm or yarn or pnpm
  • MongoDB instance (local or Atlas)
  • Google AI API Key for Gemini

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/and-then.git
    cd and-then
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env file 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
  4. Run the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:3000

Production Build

npm run build
npm start

๐Ÿ“ก API Reference

Authentication

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

Personality

Method Endpoint Description
POST /api/personality/save Save test results
GET /api/personality Get user's personality profile

Stories

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

Gamification

Method Endpoint Description
GET /api/gamification Get user stats (XP, level, badges)
POST /api/gamification Update user stats

๐ŸŽจ Customization

Adding New Story Genres

  1. Add genre to STORY_GENRES in lib/story-data.ts:

    {
      id: "horror",
      name: "Horror",
      description: "Spine-chilling tales of terror",
      icon: "๐Ÿ‘ป",
      prompt: "Create a terrifying horror story opening..."
    }
  2. Add visual theme in lib/book-themes.ts:

    horror: {
      id: "horror",
      name: "Haunted Tome",
      styles: { /* ... */ }
    }
  3. Add theme assets to public/themes/horror/

Customizing Personality Traits

  1. Modify PERSONALITY_TRAITS in lib/personality-data.ts
  2. Update PERSONALITY_QUESTIONS with new trait mappings
  3. Adjust scoring in calculatePersonalityScores()

Styling

The app uses Tailwind CSS v4 with custom design tokens. Modify app/globals.css for global theme adjustments.


๐Ÿ—บ๏ธ Roadmap

  • 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

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

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!!

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0