Skip to content

karthikj30/Karigar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Karigar - AI-Powered Artisan Marketplace

Karigar Logo WhatsApp Image 2025-09-21 at 22 12 04_fd1dc4ef

An innovative platform that bridges traditional Indian craftsmanship with modern AI technology, helping local artisans reach new digital audiences and preserve cultural heritage.

🌟 Features

WhatsApp Image 2025-09-21 at 21 37 32_ba37b559

Core AI-Powered Tools

  1. πŸ“– Story Generation & Posting

    • AI-generated compelling stories about artisans and their crafts
    • Social media ready captions and product descriptions
    • Personalized bios and marketing content
  2. πŸ—ΊοΈ Interactive Artisan Map

    • Google Maps integration showing artisan locations
    • Detailed artisan profiles with craft information
    • Location-based discovery and recommendations
  3. 🎀 Voice Story Creation

    • Text-to-Speech conversion of artisan stories
    • Multiple voice options and languages
    • Audio content for social media and marketing WhatsApp Image 2025-09-21 at 21 40 41_7fd47fef
  4. 🎨 Design Enhancement Ideas

    • AI-powered design suggestions for traditional crafts
    • Color palette recommendations
    • Modern application ideas while preserving tradition WhatsApp Image 2025-09-21 at 21 41 25_e11c8065 WhatsApp Image 2025-09-21 at 21 38 56_2004124d
  5. 🎬 Video Script Generation

    • Social media video scripts for YouTube, Instagram, TikTok
    • Platform-specific content optimization
    • Visual cues and timing suggestions WhatsApp Image 2025-09-21 at 21 43 26_c0590004
  6. ✏️ Drawing to Art Analysis

    • AI analysis of sketches and drawings
    • Traditional craft technique suggestions
    • Design variation recommendations WhatsApp Image 2025-09-21 at 21 44 04_ba5271e1 WhatsApp Image 2025-09-21 at 21 46 58_de665d21

WhatsApp Image 2025-09-21 at 21 50 08_ae4f2f6a WhatsApp Image 2025-09-21 at 22 09 49_524566f0

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Google Cloud Account
  • Google AI API Key (Gemini)
  • Google Maps API Key
  • Google Cloud Project with Firestore enabled

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/karigar.git
    cd karigar
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up environment variables

    cp config/env.example .env
    # Edit .env with your API keys
  4. Run the application

    python start.py
    # OR
    python app.py
  5. Access the application Open your browser and go to http://localhost:5000

πŸ”§ Configuration

Environment Variables

Create a .env file with the following variables:

GOOGLE_AI_API_KEY=your_gemini_api_key_here
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
GOOGLE_CLOUD_PROJECT=your_project_id_here
FIRESTORE_PROJECT_ID=your_project_id_here

Google Cloud Setup

  1. Enable APIs

    • Google AI API (Gemini)
    • Google Maps JavaScript API
    • Cloud Text-to-Speech API
    • Cloud Firestore API
  2. Create Service Account

    • Download service account key
    • Set GOOGLE_APPLICATION_CREDENTIALS environment variable

πŸ“ Project Structure

karigar/
β”œβ”€β”€ πŸ“„ app.py                    # Main Flask application
β”œβ”€β”€ πŸ“„ start.py                  # Simple startup script
β”œβ”€β”€ πŸ“„ requirements.txt          # Python dependencies
β”œβ”€β”€ πŸ“„ setup.py                  # Setup script
β”œβ”€β”€ πŸ“„ README.md                 # This file
β”œβ”€β”€ πŸ“ config/                   # Configuration files
β”‚   β”œβ”€β”€ env.example             # Environment variables template
β”‚   └── serviceAccount.json     # Google Cloud service account
β”œβ”€β”€ πŸ“ deployment/              # Deployment configurations
β”‚   β”œβ”€β”€ Dockerfile              # Docker configuration
β”‚   β”œβ”€β”€ app.yaml                # Google App Engine config
β”‚   └── cloudbuild.yaml         # Cloud Build configuration
β”œβ”€β”€ πŸ“ docs/                    # Documentation
β”‚   └── PROJECT_OVERVIEW.md     # Detailed project overview
β”œβ”€β”€ πŸ“ static/                  # Static assets
β”‚   β”œβ”€β”€ css/style.css           # Custom styling
β”‚   β”œβ”€β”€ js/app.js               # Frontend JavaScript
β”‚   β”œβ”€β”€ logo.png                # Application logo
β”‚   └── bg.mp4                  # Background video
└── πŸ“ templates/               # HTML templates
    β”œβ”€β”€ base.html               # Base template
    β”œβ”€β”€ index.html              # Home page
    β”œβ”€β”€ about.html              # About page
    β”œβ”€β”€ ai_tools.html           # AI tools page
    β”œβ”€β”€ artisan_map.html        # Artisan map page
    β”œβ”€β”€ home.html               # Home page variant
    └── profile.html            # Profile page

Architecture

Backend (Flask)

  • Framework: Flask with CORS support
  • AI Integration: Google Gemini API
  • Database: Google Cloud Firestore
  • Maps: Google Maps JavaScript API
  • TTS: Google Cloud Text-to-Speech

Frontend

  • Framework: Vanilla JavaScript with Bootstrap 5
  • Styling: Custom CSS with modern design
  • Maps: Google Maps JavaScript API
  • UI Components: Bootstrap modals and components

Deployment

  • Container: Docker
  • Platform: Google Cloud Run
  • CI/CD: Google Cloud Build
  • Scaling: Automatic scaling based on CPU utilization

πŸ“± Usage

For Artisans

  1. Generate Stories

    • Fill in artisan information
    • Select craft type
    • Describe your product
    • Get AI-generated story content
  2. Create Voice Content

    • Enter your story text
    • Generate audio narration
    • Download for social media
  3. Enhance Designs

    • Select your craft type
    • Describe current design
    • Get AI suggestions for improvements
  4. Create Video Scripts

    • Provide artisan and product details
    • Select target platform
    • Generate engaging video scripts

For Customers

  1. Discover Artisans

    • Browse interactive map
    • View artisan profiles
    • Learn about traditional crafts
  2. Explore Stories

    • Read artisan stories
    • Listen to voice narrations
    • Connect with local craftspeople

πŸ› οΈ API Endpoints

Story Generation

  • POST /api/generate-story - Generate artisan stories
  • POST /api/generate-voice - Convert text to speech
  • POST /api/enhance-design - Get design enhancement ideas

Artisan Management

  • GET /api/artisans - Get all artisans
  • GET /api/artisan/<id> - Get specific artisan

Video Creation

  • POST /api/generate-video-script - Generate video scripts
  • POST /api/analyze-drawing - Analyze drawings for craft applications

Health Check

  • GET /api/health - Application health status

πŸš€ Deployment

Google Cloud Run

  1. Build and deploy using Cloud Build

    gcloud builds submit --config deployment/cloudbuild.yaml
  2. Manual deployment

    # Build Docker image
    docker build -f deployment/Dockerfile -t gcr.io/PROJECT_ID/karigar .
    
    # Push to Container Registry
    docker push gcr.io/PROJECT_ID/karigar
    
    # Deploy to Cloud Run
    gcloud run deploy karigar --image gcr.io/PROJECT_ID/karigar --platform managed --region asia-south1 --allow-unauthenticated

Environment Variables in Cloud Run

Set the following environment variables in Cloud Run:

  • GOOGLE_AI_API_KEY
  • GOOGLE_MAPS_API_KEY
  • GOOGLE_CLOUD_PROJECT

πŸ§ͺ Testing

Manual Testing

  1. Story Generation

    • Test with different craft types
    • Verify story quality and relevance
    • Check social media caption generation
  2. Voice Generation

    • Test with various text lengths
    • Verify audio quality
    • Check different languages
  3. Map Functionality

    • Test artisan location display
    • Verify marker interactions
    • Check info window content

API Testing

Use tools like Postman or curl to test API endpoints:

# Test story generation
curl -X POST http://localhost:5000/api/generate-story \
  -H "Content-Type: application/json" \
  -d '{"artisan_info": {"name": "Test Artisan"}, "craft_type": "Pottery", "product_description": "Handmade ceramic bowls"}'

πŸ“Š Performance

Optimization Features

  • Caching: API response caching
  • Lazy Loading: Images and content loading
  • Compression: Gzip compression for static assets
  • CDN: Static asset delivery optimization

Monitoring

  • Health Checks: Built-in health monitoring
  • Logging: Comprehensive application logging
  • Metrics: Performance and usage metrics

πŸ”’ Security

Security Features

  • CORS: Configured for specific origins
  • Input Validation: All inputs are validated
  • API Keys: Secure environment variable storage
  • HTTPS: SSL/TLS encryption in production

Best Practices

  • Never commit API keys to version control
  • Use environment variables for sensitive data
  • Implement rate limiting for API endpoints
  • Regular security updates and patches

🀝 Contributing

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

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Google Cloud for providing the AI and cloud infrastructure
  • Traditional Artisans for preserving cultural heritage
  • Open Source Community for the amazing tools and libraries

πŸ“ž Support

For issues and questions:

  1. Check the troubleshooting section above
  2. Review the code comments and documentation
  3. Create an issue in the project repository
  4. Contact the development team

πŸ—ΊοΈ Roadmap

Phase 1 (Current)

  • βœ… Core AI tools implementation
  • βœ… Basic artisan mapping
  • βœ… Story generation
  • βœ… Voice synthesis

Phase 2 (Next)

  • πŸ”„ Advanced design analysis
  • πŸ”„ Video generation
  • πŸ”„ E-commerce integration
  • πŸ”„ Multi-language support

Phase 3 (Future)

  • πŸ“‹ AR/VR integration
  • πŸ“‹ Blockchain authentication
  • πŸ“‹ Advanced analytics
  • πŸ“‹ Mobile applications

WhatsApp Image 2025-09-21 at 21 47 38_530e9012

Made with ❀️ for preserving traditional Indian craftsmanship Made By:

"Empowering the backbone of India's Art culture through technology"

About

Karigar is an AI-powered marketplace assistant that empowers Indian artisans to market their craft, share stories, and connect with global consumers. Powered by Google Cloud Vertex AI, it features a storytelling engine, local language voice narration, and artisan mapping.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors