Gaji (κ°μ§, Korean for "branch") is a revolutionary platform that brings "What If?" storytelling to life. Inspired by Marvel's What If...? and powered by AI, Gaji enables readers to explore alternative timelines where beloved characters face different circumstances, make different choices, or exist in entirely different settings.
Unlike traditional book discussion platforms, Gaji doesn't just let you talk about booksβit lets you fork reality itself and explore infinite story possibilities.
π Classic Story
ββ π What if Hermione was sorted into Slytherin?
β ββ π¬ Conversation: How did it affect her friendships?
β ββ π¬ Conversation: What about her rivalry with Harry?
β
ββ π What if Gatsby never met Daisy?
β ββ π¬ Conversation: Would he still pursue wealth?
β ββ π Meta-fork: What if he became a tech entrepreneur?
β
ββ π What if Pride & Prejudice happened in 2024 Seoul?
ββ π¬ Conversation: How does Darcy's pride translate to K-drama?
-
π Scenario Forking: Create "What If" scenarios with three types:
- Character Changes: "What if Hermione was in Slytherin?"
- Event Alterations: "What if Gatsby never met Daisy?"
- Setting Modifications: "What if Pride & Prejudice was set in 2024 Seoul?"
-
π¬ AI Character Conversations: Talk to characters adapted to alternate timelines
-
π³ Tree Visualization: Explore how scenarios branch into infinite variations
-
π₯ Social Discovery: Share viral timelines and fork others' creative scenarios
-
π Community-Driven: Like, follow, and collaborate on story explorations
Gaji uses a microservices architecture (Pattern B: API Gateway) with clear separation of concerns:
graph TD
A[Vue.js Frontend<br/>Single API Client] -->|HTTPS /api/*| B[Spring Boot API Gateway<br/>Port 8080]
B -->|/api/ai/* Proxy| C[FastAPI AI Backend<br/>Port 8000 Internal]
B -->|JPA CRUD| D[PostgreSQL 15.x<br/>Metadata Only]
C -->|Semantic Search| E[VectorDB ChromaDB/Pinecone<br/>Content + Embeddings]
C -->|AI Generation| F[Gemini 2.5 Flash<br/>Text + Embeddings]
style A fill:#42b883,stroke:#333,stroke-width:2px
style B fill:#FFD54F,stroke:#333,stroke-width:3px
style C fill:#3572A5,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
style D fill:#336791,stroke:#333,stroke-width:2px
style E fill:#FF6347,stroke:#333,stroke-width:2px
style F fill:#4285F4,stroke:#333,stroke-width:2px
Architecture Pattern: Pattern B (API Gateway) β
- Frontend β Spring Boot ONLY (single entry point)
- Spring Boot β FastAPI (internal proxy, not externally exposed)
- Enhanced Security: FastAPI/Gemini API keys protected from external access
- Cost Savings: $700/year saved on SSL/domains
- Performance: +50ms overhead is negligible (1%) on 5000ms AI operations
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Vue 3, PrimeVue, PandaCSS, Pinia | Modern SPA with component-based UI |
| API Gateway | Java 17+, Spring Boot 3.x (Port 8080) | Single entry point, AI proxy, business logic |
| AI Backend | Python 3.11+, FastAPI (Port 8000) | Internal only, RAG, VectorDB, Gemini API |
| Metadata DB | PostgreSQL 15.x (13 tables) | Users, novels, scenarios, conversations |
| Content DB | ChromaDB/Pinecone (5 collections) | Passages, characters, locations, events, themes |
| AI/ML | Gemini 2.5 Flash, Gemini Embedding | Text generation (768-dim embeddings) |
Key Architecture Decisions:
- β Pattern B (API Gateway): Security, simplicity, centralized logging
- β Hybrid Database: PostgreSQL (ACID) + VectorDB (semantic search 10x faster)
- β SSE Streaming: Real-time AI responses, 93% fewer network requests
- β Multirepo Structure: Independent repositories for each service
π Documentation:
- architecture.md - Complete architecture guide (System Architecture Document)
- IMPLEMENTATION_ROADMAP.md - Next steps & timeline
- BACKEND_OPTIMIZATION.md - 7 performance strategies
- DATABASE_STRATEGY.md - Hybrid database design | AI/ML | Gemini 2.5 Flash, Gemini Embedding | Text generation (768-dim embeddings) | | Deployment | Railway (backend), Vercel (frontend) | Cloud infrastructure |
Gaji uses a Hybrid Database Architecture (PostgreSQL + VectorDB):
- Metadata: Users, novels, scenarios, conversations, messages
- Social: Follows, likes, memos, forks
- Features: ACID transactions, complex JOINs, B-Tree indexing
- Content: Novel passages (chunked 200-500 words)
- AI Analysis: Characters, locations, events, themes
- Search: Semantic search via 768-dim embeddings (Gemini)
- Performance: 10x faster than pgvector on semantic queries
Why Hybrid?
- PostgreSQL: Best for relational metadata queries
- VectorDB: Best for semantic "find brave scenes" searches
- Combined: Best of both worlds
See DATABASE_STRATEGY.md for detailed comparison.
- Select Base Story: Choose from popular books (Harry Potter, Pride & Prejudice, etc.)
- Choose Scenario Type:
- Character Change: Modify a character's properties (house, personality, etc.)
- Event Alteration: Change what happens at a key moment
- Setting Modification: Shift time period or location
- Configure Parameters: Fill in structured templates (no freeform text chaos)
- Validate: AI checks for logical coherence
- Publish: Share with the community
- Browse by Book: See all "What If" scenarios for your favorite stories
- Trending Timelines: Discover viral scenarios gaining rapid forks
- Fork & Remix: Create meta-scenarios by branching existing timelines
- Tree Visualization: Navigate the multiverse with D3.js-powered graphs
Example Prompt (Auto-generated):
You are Hermione Granger in an alternate timeline where you were
sorted into Slytherin instead of Gryffindor. You befriended Draco
Malfoy in your first year, developed cunning ambition under Snape's
mentorship, and experienced the complete Harry Potter series from
Slytherin's perspective. Discuss your alternate journey with readers.
User: "How did being in Slytherin change your relationship with Harry?"
AI Hermione: "It was complicated. We were rivals at firstβhe saw me as a traitor to 'good' wizards. But in our third year, during the Sirius Black incident, we realized we were fighting the same battle from different houses..."
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Java: Google Java Style Guide
- Python: Black + flake8
- TypeScript/Vue: ESLint + Prettier
This project is licensed under the MIT License - see LICENSE file for details.
- Inspiration: Marvel's What If...?, Archive of Our Own (AO3)
- AI Models: Local LLM (Llama, Mistral, or similar open-source models), LangChain ecosystem
- UI Components: PrimeVue, PandaCSS
- Community: BookTok creators, fanfiction writers, literature professors
Meet the team behind Gaji:
| Member | GitHub | Role |
|---|---|---|
| λ―Όμμ¬ | @yeomin4242 | Core Developer |
| ꡬμμ | @swkooo | Core Developer |
We're a passionate team of developers building the future of interactive storytelling! π
- architecture.md - System architecture & ADRs
- IMPLEMENTATION_ROADMAP.md - Next steps & timeline
- CLAUDE.md - AI development guide
- DEVELOPMENT_SETUP.md - Local environment setup
- BACKEND_OPTIMIZATION.md - Performance strategies
- DATABASE_STRATEGY.md - Hybrid DB design
- PRD.md - Product requirements
- ERD.md - Database schema
- API_DOCUMENTATION.md - API reference
- TESTING_STRATEGY.md - Testing guidelines
- UI_UX_SPECIFICATIONS.md - Design specs
- SECURITY.md - Security best practices
- Documentation: /docs
- Issues: GitHub Issues
- Email: Contact via GitHub