Skip to content

LotusSerene/scrollwise-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ScrollWise AI

ScrollWise AI is an open-source AI-powered writing assistant that helps authors create, manage, and analyze their stories. It provides comprehensive worldbuilding tools, character development features, and AI-assisted content generation.

Note: This project is under active development. Some features may be experimental or subject to change.

🌟 Features

Story Management

  • Create and organize multiple writing projects
  • Chapter management and organization
  • Import existing documents (PDF, DOCX)
  • Real-time content editing and saving

AI-Powered Tools

  • Character development assistance
  • Worldbuilding generation
  • Plot consistency checking
  • Relationship analysis between characters
  • Knowledge base generation from your content

Codex System

  • Maintain a detailed story bible
  • Track characters, locations, items, and lore
  • Automatic codex entry generation from your writing
  • Relationship mapping between story elements

Cross-Platform Support

  • Primary support for Windows
  • Cross-platform compatibility for other operating systems in development

Some Previews

Project Management

1

Codex Entries

2

Codex Generation

3

Login

4

πŸš€ Getting Started

Prerequisites

  • Flutter SDK >=3.1.3
  • Python 3.8+
  • No external database required (uses local SQLite by default)
  • No API keys required for basic functionality

Installation

  1. Clone the repository:
git clone https://github.com/LotusSerene/scrollwise-ai.git
cd scrollwise-ai
  1. Install backend dependencies:
cd backend
pip install -r requirements.txt
  1. Install frontend dependencies:
cd frontend
flutter pub get
  1. Configure environment variables:

    Copy the example environment files and customize as needed:

    # Backend configuration
    cd backend
    copy .env.example .env
    
    # Frontend configuration
    cd ../frontend
    copy .env.example .env

    Backend Environment (backend/.env):

    • ALLOWED_ORIGINS: CORS origins (automatically set by ServerManager)
    • LOG_DIR: Log directory path (automatically set by ServerManager)
    • YOUR_SITE_URL: Optional site URL for analytics
    • YOUR_SITE_NAME: Optional site name for analytics

    Frontend Environment (frontend/.env):

    Note: The application works entirely offline with local storage. No external API keys or cloud services are required for core functionality.

  2. Run the application:

# Start backend server
cd backend
python server.py

# Start frontend (in a new terminal)
cd frontend
flutter run

πŸ› οΈ Technology Stack

Frontend

  • Flutter/Dart - Cross-platform UI framework
  • Provider - State management solution
  • Material Design - Modern UI components
  • HTTP - API communication with backend
  • Path Provider - File system access
  • Logging - Application logging and debugging

Backend

  • FastAPI - Modern web framework for building APIs
  • SQLAlchemy - Database ORM with async support
  • LangChain - AI/LLM integration framework
  • Qdrant - Local vector database for semantic search
  • Pydantic - Data validation and serialization
  • SQLite - Local database storage (no setup required)
  • Python-dotenv - Environment variable management

πŸ—οΈ Architecture

System Overview

ScrollWise AI follows a client-server architecture:

  • Flutter Frontend: Cross-platform UI handling user interactions
  • FastAPI Backend: RESTful API server managing business logic
  • Local SQLite: Primary data storage for projects, chapters, and metadata
  • Local Qdrant: Vector database for semantic search and AI-powered features
  • File System: Local storage for logs, cache, and temporary files

Data Flow

  1. User interacts with Flutter UI components
  2. UI triggers actions through Provider-based state management
  3. HTTP requests sent to FastAPI backend
  4. Backend processes requests using SQLAlchemy and LangChain
  5. Results stored in local SQLite and Qdrant databases
  6. Responses returned to frontend for UI updates

Directory Structure

GeminiFrontend/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ .env.example          # Backend environment template
β”‚   β”œβ”€β”€ requirements.txt      # Python dependencies
β”‚   β”œβ”€β”€ server.py            # FastAPI application entry point
β”‚   β”œβ”€β”€ database.py          # Database models and operations
β”‚   β”œβ”€β”€ agent_manager.py     # AI agent management
β”‚   β”œβ”€β”€ api_key_manager.py   # API key handling (if needed)
β”‚   β”œβ”€β”€ vector_store.py      # Qdrant vector operations
β”‚   └── models.py           # Pydantic data models
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ .env.example         # Frontend environment template
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ components/      # Feature-specific UI logic
β”‚   β”‚   β”œβ”€β”€ models/         # Data models
β”‚   β”‚   β”œβ”€β”€ providers/      # State management
β”‚   β”‚   β”œβ”€β”€ screens/        # Full-page views
β”‚   β”‚   β”œβ”€β”€ utils/          # Utilities and configuration
β”‚   β”‚   β”œβ”€β”€ widgets/        # Reusable UI components
β”‚   β”‚   └── main.dart       # Application entry point
β”‚   └── pubspec.yaml        # Flutter dependencies
└── README.md               # This file

🀝 Contributing

We welcome contributions! You can contribute to the project by creating a pull request.

Development Setup

  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

Development Guidelines

  • Follow Flutter/Dart coding conventions
  • Use Provider pattern for state management
  • Implement proper error handling and logging
  • Write clear commit messages
  • Test on Windows platform primarily

πŸ“ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.

This means:

  • βœ… You can use the software freely
  • βœ… You can modify the software
  • βœ… You can distribute the software
  • βœ… You can use it commercially
  • ❗ You must disclose source code when you distribute or serve the software
  • ❗ You must state changes you make to the code
  • ❗ You must license derivative works under AGPL-3.0

🌐 Links

πŸ’ Support the Project

ScrollWise AI is and will always be free and open source. If you'd like to support the project:

  • ⭐ Star the repository
  • πŸ› Report bugs and contribute fixes
  • πŸ“– Improve documentation
  • 🎨 Contribute new features

πŸ”§ Troubleshooting

Common Issues

Backend won't start:

  • Ensure Python 3.8+ is installed
  • Install dependencies: pip install -r requirements.txt
  • Check that port 8080 is available

Frontend can't connect to backend:

  • Verify backend is running on correct port
  • Check API_URL in frontend/.env file
  • Ensure CORS settings allow frontend origin

Database errors:

  • Delete local database files to reset: *.db, *.sqlite
  • Restart both backend and frontend

Missing dependencies:

  • Run flutter doctor to check Flutter installation
  • Run pip list to verify Python packages

Logging

  • Backend logs: logs/server.log
  • Frontend logs: Available in console during development
  • Vector store data: qdrant_db/ directory

πŸ“Š Project Status

ScrollWise AI is under active development. Current focus areas:

  • βœ… Core writing and project management features
  • βœ… Local-first architecture with no external dependencies
  • βœ… AI-powered content analysis and generation
  • πŸ”„ Cross-platform compatibility improvements
  • πŸ”„ Enhanced UI/UX polish
  • πŸ”„ Advanced AI features and integrations