Skip to content

vperrinfr/Bob_mini-tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– IBM Project Bob AI Assistant

This repository contains a Mini Tasks application designed to test and showcase Bob's capabilities as an AI coding assistant. Bob from IBM is your AI software development partner that understands your intent, repo, and security standards.

More details about Bob : https://www.ibm.com/products/bob

🎯 Purpose

This repo demonstrates Bob's ability to:

  • πŸ” Analyze code architecture and explain complex systems
  • πŸ› Find and fix bugs in existing codebases
  • ♻️ Refactor code following best practices
  • πŸš€ Run applications locally with proper setup
  • 🎨 Create modern UIs from scratch
  • πŸ“š Generate comprehensive documentation

πŸ“ Repository Structure

Bob_mini-tasks/
β”œβ”€β”€ Initial_Code/              # πŸ”΄ BEFORE - Buggy code to test Bob
β”‚   β”œβ”€β”€ README.md             # Documentation of all bugs
β”‚   └── backend_main.py       # Example of problematic code
β”‚
β”œβ”€β”€ Result_After_Bob/         # βœ… AFTER - Bob's refactored solution
β”‚   β”œβ”€β”€ backend/              # Production-ready FastAPI backend
β”‚   β”œβ”€β”€ frontend/             # Modern React UI
β”‚   └── README.md             # Complete documentation
β”‚
└── README.md                 # This file

πŸ§ͺ How to Test Bob

Test Scenario 1: Architecture Analysis

Prompt: "Explain the architecture of this project"

Expected: Bob should analyze and explain:

  • Backend structure (FastAPI, SQLAlchemy, async operations)
  • Frontend architecture (React, Vite)
  • Database layer and ORM patterns
  • API endpoints and routing
  • Clean architecture principles

Test Scenario 2: Bug Detection & Fixing

Prompt: "Find all bugs or bad practices in this project"

Expected: Bob should identify:

  • βœ… 20+ bugs and issues (see Initial_Code/README.md)
  • Database session leaks
  • Dangerous autocommit=True configuration
  • Missing error handling
  • CORS issues
  • Frontend API mismatches
  • And provide fixes for each

Test Scenario 3: Code Refactoring

Prompt: "Refactor the backend to follow best practices"

Expected: Bob should:

  • βœ… Convert to fully async operations
  • βœ… Implement dependency injection
  • βœ… Add Pydantic validation models
  • βœ… Fix all critical bugs
  • βœ… Add proper error handling
  • βœ… Implement clean architecture

Test Scenario 4: Local Deployment

Prompt: "Run the code locally"

Expected: Bob should:

  • βœ… Install dependencies (pip, npm)
  • βœ… Configure environment
  • βœ… Start backend server
  • βœ… Start frontend dev server
  • βœ… Verify both are running correctly

Test Scenario 5: UI Creation

Prompt: "Create a Web UI to use the app"

Expected: Bob should:

  • βœ… Build a modern React interface
  • βœ… Implement all CRUD operations
  • βœ… Add error handling and loading states
  • βœ… Create responsive, beautiful design
  • βœ… Connect to backend API

Test Scenario 6: Documentation

Prompt: "Document this project"

Expected: Bob should create:

  • βœ… Comprehensive README files
  • βœ… API documentation
  • βœ… Setup instructions
  • βœ… Architecture diagrams
  • βœ… Code comments

πŸ“Š What Bob Accomplished

πŸ” Analysis Phase

  • Identified 20+ bugs and bad practices
  • Explained architecture in detail
  • Provided comprehensive code review

πŸ› οΈ Refactoring Phase

  • Converted to fully async operations
  • Implemented dependency injection
  • Added Pydantic validation
  • Fixed all critical bugs
  • Created clean architecture

🎨 UI Development Phase

  • Built modern React frontend
  • Implemented beautiful gradient design
  • Added error handling and loading states
  • Created responsive layout

πŸš€ Deployment Phase

  • Set up backend server (FastAPI)
  • Configured frontend (Vite + React)
  • Ensured both run successfully
  • Verified API connectivity

πŸ“š Documentation Phase

  • Created comprehensive READMEs
  • Documented all changes
  • Provided setup instructions
  • Added code examples

🎯 Key Features Demonstrated

Backend Excellence

  • βœ… Async/Await - Non-blocking operations
  • βœ… Dependency Injection - Proper session management
  • βœ… Pydantic Validation - Type-safe APIs
  • βœ… Error Handling - HTTP exceptions
  • βœ… CORS Configuration - Frontend integration
  • βœ… API Versioning - /api/v1 prefix
  • βœ… Clean Architecture - Separated concerns

Frontend Quality

  • βœ… Modern React - Hooks and functional components
  • βœ… Beautiful UI - Gradient design with animations
  • βœ… Error Handling - User-friendly messages
  • βœ… Loading States - Visual feedback
  • βœ… Responsive Design - Mobile and desktop
  • βœ… Real-time Updates - Instant UI feedback

Code Quality

  • βœ… Type Hints - Full type coverage
  • βœ… Documentation - Comprehensive docs
  • βœ… Best Practices - Industry standards
  • βœ… Clean Code - Readable and maintainable
  • βœ… Testing Ready - Structured for tests

πŸš€ Quick Start

View the Buggy Code

cd Initial_Code
cat README.md  # See all the bugs Bob found

Run Bob's Solution

# Backend
cd Result_After_Bob/backend
pip install -r requirements.txt
python3 -m uvicorn backend.main:app --reload --port 8001

# Frontend (in another terminal)
cd Result_After_Bob/frontend
npm install
npm run dev

Access the Application

πŸ“ˆ Metrics

Metric Before Bob After Bob
Bugs 20+ critical issues 0 bugs
Architecture Mixed concerns Clean separation
Async Support None Fully async
Validation None Pydantic models
Error Handling Silent failures HTTP exceptions
UI Basic Modern & beautiful
Documentation Minimal Comprehensive
Code Quality Poor Production-ready

πŸŽ“ Learning Outcomes

This repository demonstrates:

  1. Code Analysis - How to identify bugs and issues
  2. Refactoring - Transforming bad code into good code
  3. Best Practices - FastAPI and React patterns
  4. Architecture - Clean, maintainable structure
  5. Documentation - Professional documentation standards

πŸ”— Resources

  • Initial Code: See Initial_Code/ for the buggy version
  • Solution: See Result_After_Bob/ for the fixed version
  • Refactoring Details: See REFACTORING_SUMMARY.md
  • Backend Docs: See Result_After_Bob/backend/README.md
  • Frontend Docs: See Result_After_Bob/frontend/README.md

πŸ’‘ Use Cases

For Testing Bob

  1. Clone this repo
  2. Ask Bob to analyze the code
  3. Ask Bob to fix the bugs
  4. Ask Bob to run it locally
  5. Ask Bob to create a UI
  6. Compare results with Result_After_Bob/

For Learning

  1. Study the bugs in Initial_Code/
  2. Review the fixes in Result_After_Bob/
  3. Read REFACTORING_SUMMARY.md
  4. Understand the before/after comparison

For Portfolio

  1. Showcase Bob's capabilities
  2. Demonstrate refactoring skills
  3. Show before/after transformations
  4. Highlight best practices

πŸŽ‰ Conclusion

This repository proves Bob can:

  • βœ… Analyze complex codebases
  • βœ… Identify and fix bugs
  • βœ… Refactor following best practices
  • βœ… Create modern UIs
  • βœ… Deploy applications locally
  • βœ… Generate comprehensive documentation

Perfect for testing AI coding assistants or learning best practices!


Repository: https://github.com/vperrinfr/Bob_mini-tasks

License: MIT

Created by: Vincent Perrin & Bob AI Assistant

About

Code to evaluate IBM Project Bob

Resources

Stars

Watchers

Forks

Packages

No packages published