Skip to content

escowin/dev-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevAI: Assistant Bot

A personal AI assistant that acts as your junior developer and documentation librarian. DevAI helps you quickly reference your own documentation, configurations, and past solutions without needing an internet connection. Instead of digging through folders or searching online for things you've already solved, DevAI instantly surfaces the exact information you need from your own knowledge base, saving you time and keeping you focused on building.

🎯 Why DevAI?

Stop reinventing the wheel. Start referencing your own solutions.

DevAI transforms your scattered documentation into an intelligent assistant that remembers everything you've built. No more hunting through old projects or Googling solutions you've already implemented.

Perfect for developers who:

  • Save Time: Instantly find your own configurations, scripts, and solutions
  • Stay Focused: No context switching between projects and documentation
  • Work Offline: Access your knowledge base without internet dependency
  • Maintain Privacy: Your code and documentation never leave your machine
  • Avoid Repetition: Quickly reference past implementations for new projects
  • Scale Knowledge: Build on your own expertise across multiple projects

Ideal Use Cases:

  • Quick Reference: "How did I set up that Docker config last time?"
  • Project Setup: "What was that database migration pattern I used?"
  • Troubleshooting: "I've seen this error before - what was the solution?"
  • Knowledge Transfer: "Show me the API patterns from my previous project"
  • Learning: "Explain this complex setup I documented months ago"

🚀 Features

Core Features

  • 100% Offline & Private: Runs entirely on your local machine with Ollama LLMs
  • Documentation-Focused AI: Restricted to only use your provided documentation sources
  • Context-Aware Assistance: Leverages your project docs, APIs, and codebase for accurate help
  • Real-Time Chat: WebSocket-based communication with streaming responses
  • Modern UI: React with TypeScript and Tailwind CSS
  • Dark Mode: Complete dark theme with toggle functionality
  • Production Ready: Docker containerization and deployment scripts
  • Responsive Design: Mobile-first, accessible interface
  • Performance Optimized: Fast response times and efficient resource usage

Advanced Features

  • Conversation Persistence: Environment-based storage (IndexedDB/SQLite/PostgreSQL)
  • Message Search: Full-text search across all conversations with highlighting
  • Admin Dashboard: Real-time system monitoring and health checks
  • Export/Import: Export conversations in multiple formats (JSON/ZIP/TXT/MD)
  • User Preferences: Customizable settings with production-safe restrictions
  • Keyboard Shortcuts: Alt-key combinations for improved productivity
  • Caching System: In-memory caching with TTL and LRU eviction
  • Environment Management: Backend-controlled configuration with automatic storage switching

🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   React Frontend│    │  FastAPI Backend│    │   Ollama LLM    │
│                 │    │                 │    │                 │
│ ┌─────────────┐ │    │ ┌─────────────┐ │    │ ┌─────────────┐ │
│ │ Chat UI     │◄┼────┼►│ API Server  │ │    │ │ Local LLM   │ │
│ │ Components  │ │    │ │ WebSockets  │ │    │ │ Models      │ │
│ └─────────────┘ │    │ └─────────────┘ │    │ └─────────────┘ │
│                 │    │ ┌─────────────┐ │    │                 │
│                 │    │ │ AI Service  │◄┼────┼►│ phi3:mini    │ │
│                 │    │ │             │ │    │ │ tinyllama    │ │
│                 │    │ └─────────────┘ │    │ │ llama2       │ │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🛠️ Technology Stack

Backend

  • FastAPI - Modern Python web framework
  • Ollama - Local LLM integration
  • WebSockets - Real-time communication
  • Pydantic - Data validation
  • Python 3.8+ - Runtime environment

Frontend

  • React 18 - UI framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • Vite - Build tool
  • Axios - HTTP client

Infrastructure

  • Docker - Containerization
  • Nginx - Reverse proxy
  • Raspberry Pi - Production hosting

✨ New Features

🔄 Port Synchronization

  • Unified port management - single script for checking and syncing ports
  • Focused updates - only updates port-related variables
  • Preserves all other settings - your custom configuration stays intact
  • Smart detection - identifies port mismatches and suggests fixes

📚 Enhanced Documentation Logging

  • Detailed startup logging showing documentation loading status
  • File-by-file processing information
  • Clear error messages when documentation path is missing
  • Statistics endpoint to check documentation status
  • Visual indicators (emojis) for better log readability

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 18+
  • Docker (optional)
  • Ollama installed and running

Development Setup

  1. Clone the repository

    git clone <repository-url>
    cd dev-ai
  2. Start Ollama and pull a model

    ollama serve
    ollama pull phi3:mini  # Recommended for speed
  3. Backend Setup

    cd backend
    pip install -r requirements.txt
    # Environment file is created from .env.example if it doesn't exist
    uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
  4. Frontend Setup

    cd frontend
    npm install
    # Environment file is created with default settings if it doesn't exist
    npm run dev
  5. Port Management

    # Check port synchronization status
    node scripts/ports.js
    
    # Sync only port-related variables (preserves all other settings)
    node scripts/ports.js --sync
  6. Access the application

📁 Project Structure

dev-ai/
├── backend/                 # FastAPI backend
│   ├── app/
│   │   ├── main.py         # Application entry point
│   │   ├── services/       # Business logic services
│   │   ├── models/         # Pydantic models
│   │   └── api/           # API endpoints
│   ├── tests/             # Backend tests
│   ├── requirements.txt   # Python dependencies
│   └── .env.example      # Environment template
├── frontend/              # React frontend
│   ├── src/
│   │   ├── components/   # React components
│   │   ├── services/     # API services
│   │   ├── types/        # TypeScript types
│   │   └── utils/        # Utility functions
│   ├── public/           # Static assets
│   └── package.json      # Node dependencies
├── docker/               # Docker configurations
├── docs/                 # Documentation
└── scripts/              # Deployment scripts

🔧 Configuration

Backend Configuration (.env)

# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=phi3:mini

# Performance Settings
MAX_TOKENS=500
TEMPERATURE=0.5
ENABLE_STREAMING=true

# Security
SECRET_KEY=your-secret-key-change-in-production
ALLOWED_ORIGINS=http://localhost:3000

Frontend Configuration

export const config = {
  apiUrl: "http://localhost:8000",
  wsUrl: "ws://localhost:8000/ws",
  maxMessageLength: 1000,
  reconnectInterval: 5000
};

🚀 Deployment

Docker Deployment

# Build and run with Docker Compose
docker-compose up --build

# Production deployment
docker-compose -f docker-compose.prod.yml up -d

Raspberry Pi Deployment

See deployment guide for detailed Pi server setup instructions.

🧪 Testing

# Backend tests
cd backend
pytest tests/

# Frontend tests
cd frontend
npm test

# E2E tests
npm run test:e2e

📊 Performance

  • Response Time: < 2 seconds average
  • Streaming: Real-time response chunks
  • Memory Usage: Optimized for Pi deployment
  • Concurrent Users: Supports multiple simultaneous chats

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is open source and available under the MIT License.

🎯 Portfolio Showcase

This project demonstrates:

  • Full-stack development with modern technologies
  • AI/ML integration with local LLMs
  • Real-time applications using WebSockets
  • Production deployment on Raspberry Pi
  • Clean architecture and best practices
  • Responsive design and accessibility
  • Performance analysis and engineering judgment

📚 Documentation & Case Study

Comprehensive documentation available in the docs/ directory:

Key Achievement: Successfully deployed full-stack AI application on Raspberry Pi 4B, identified performance bottlenecks (42-second response times), and documented the complete technical analysis - demonstrating both deployment expertise and realistic engineering judgment.

Perfect for showcasing technical skills to potential employers!


Version: 1.0.0
Last Updated: October 2025

About

ersonal AI assistant that helps developers quickly reference their own documentation and past solutions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors