An AI-powered application that automatically generates Marktplaats listings from product images. Uses AWS Rekognition for image analysis, Claude Sonnet for intelligent content generation, and includes smart price estimation based on the Dutch second-hand market.
- πΈ Image Analysis: Upload product photos and get automatic object detection
- π§ AI-Generated Listings: Claude Sonnet creates titles, descriptions, and categories
- π° Smart Price Estimation: AI suggests realistic prices for the Dutch market
- π OAuth Integration: Secure Marktplaats account authorization
- π± Mobile Optimized: Automatic image compression for mobile devices
- π Full CRUD: Create, read, update, and delete advertisements
- πΌοΈ Image Management: Upload and display advertisement images
- Runtime: Python 3.11
- Framework: Serverless Framework
- Services: AWS Lambda, API Gateway, S3, DynamoDB, Rekognition, Bedrock
- AI Model: Claude Sonnet 3.7 via AWS Bedrock
- Framework: Nuxt.js 3 with Vue 3 Composition API
- Styling: Tailwind CSS with custom components
- Deployment: Static site on AWS S3
- Features: PWA ready with offline support
- Marktplaats API: OAuth, category management, advertisement CRUD
- AWS Rekognition: Image analysis and text extraction
- AWS Bedrock: Claude Sonnet for content generation
- Node.js 18+ and npm
- Python 3.11+
- AWS CLI configured with appropriate permissions
- Serverless Framework (
npm install -g serverless) - Marktplaats API credentials (client ID and secret)
git clone <repository-url>
cd marktplaatser
# Install dependencies
npm run install:all# Required environment variables
export MARKTPLAATS_CLIENT_ID=your_client_id
export MARKTPLAATS_CLIENT_SECRET=your_client_secret
# Optional for local development
export IS_LOCAL=trueUpdate marktplaats-frontend/.env.production:
NUXT_PUBLIC_API_BASE_URL=your_api_gateway_url
# Deploy both backend and frontend
./deploy.sh
# Or deploy individually
npm run deploy:backend
npm run deploy:frontendmarktplaatser/
βββ README.md # This file
βββ deploy.sh # Root deployment script
βββ package.json # Root package.json with scripts
β
βββ marktplaats-backend/ # AWS Lambda backend
β βββ src/marktplaats_backend/ # Python source code
β β βββ generate_listing_lambda.py # Main listing generation
β β βββ bedrock_utils.py # Claude Sonnet integration
β β βββ rekognition_utils.py # AWS Rekognition utilities
β β βββ marktplaats_auth.py # OAuth and token management
β β βββ marktplaats_ads_api.py # Marktplaats API integration
β β βββ category_matcher.py # Category matching logic
β β βββ attribute_mapper.py # Attribute mapping utilities
β βββ tests/ # Unit and integration tests
β βββ serverless.yaml # Serverless configuration
β βββ requirements.txt # Python dependencies
β βββ deploy.sh # Backend deployment script
β
βββ marktplaats-frontend/ # Nuxt.js frontend
βββ pages/ # Vue.js pages
β βββ index.vue # Main image upload and listing generation
β βββ listings.vue # Advertisement management
β βββ callback.vue # OAuth callback handler
βββ components/ # Reusable Vue components
β βββ EditListingModal.vue # Advertisement editing modal
β βββ CategorySelector.vue # Category selection component
βββ nuxt.config.ts # Nuxt configuration
βββ serverless.yml # Frontend deployment config
βββ deploy.sh # Frontend deployment script
cd marktplaats-backend
# Install dependencies
pip install -r requirements.txt
pip install -e ".[dev]"
# Run tests
python -m pytest tests/ -v
# Code quality
flake8 src/ tests/
black src/ tests/
mypy src/
# Local testing
serverless invoke local -f generateListing
# Deploy single function
serverless deploy function -f generateListingcd marktplaats-frontend
# Install dependencies
npm install
# Development server
npm run dev
# Build for production
npm run generate
# Deploy to S3
./deploy.shgenerate_listing_lambda.py- Main entry point for image analysis and listing generationbedrock_utils.py- Claude Sonnet integration with vision capabilities and price estimationmarktplaats_ads_api.py- Complete Marktplaats API wrapper with CRUD operationsmanage_advertisement_lambda.py- Advertisement management endpoints
pages/index.vue- Main application with image upload and AI generationpages/listings.vue- Advertisement management with edit/delete functionalitycomponents/EditListingModal.vue- Modal for editing advertisements
| Method | Endpoint | Description |
|---|---|---|
| POST | /generate-listing |
Generate listing from image |
| POST | /create-advertisement |
Create advertisement on Marktplaats |
| GET | /oauth/authorize |
Start OAuth flow |
| GET | /oauth/callback |
Handle OAuth callback |
| GET | /categories |
Get Marktplaats categories |
| GET | /list-advertisements |
List user advertisements |
| GET | /advertisement-images/{id} |
Get advertisement images |
| GET | /manage-advertisement/{id} |
Get advertisement details |
| PATCH | /manage-advertisement/{id} |
Update advertisement |
| DELETE | /manage-advertisement/{id} |
Delete advertisement |
curl -X POST https://your-api.com/dev/generate-listing \
-H "Content-Type: application/json" \
-d '{"image": "base64_encoded_image_data"}'Response:
{
"title": "Vintage houten tafel - eiken",
"description": "Mooie vintage eiken tafel...",
"categoryId": 621,
"categoryName": "Tafels > Eettafels",
"attributes": [...],
"estimatedPrice": 150,
"priceRange": {"min": 120, "max": 180},
"priceConfidence": "hoog"
}{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"lambda:*",
"apigateway:*",
"s3:*",
"dynamodb:*",
"rekognition:DetectLabels",
"rekognition:DetectText",
"bedrock:InvokeModel"
],
"Resource": "*"
}
]
}The marktplaats-user-tokens table is automatically created by Serverless Framework.
marktplaatser-images- Image storage (auto-created)marktplaats-frontend-simple-prod-website- Frontend hosting
| Variable | Description | Required |
|---|---|---|
MARKTPLAATS_CLIENT_ID |
Marktplaats API client ID | Yes |
MARKTPLAATS_CLIENT_SECRET |
Marktplaats API client secret | Yes |
AWS_REGION |
AWS region (default: eu-west-1) | No |
IS_LOCAL |
Enable local development mode | No |
cd marktplaats-backend
# Run all tests
python -m pytest tests/ -v
# Run specific test categories
python tests/test_integration.py # Integration tests
python tests/test_attribute_mapping.py # Unit tests
# Test deployed function
./test.sh sample.jpgcd marktplaats-frontend
# Build test
npm run generate
# Manual testing
npm run dev # Test at http://localhost:3000The application includes several mobile-specific optimizations:
- Image Compression: Automatic resizing to 1024x1024 with 80% quality
- Progress Feedback: Loading states for compression and AI processing
- Responsive Design: Tailwind CSS with mobile-first approach
- Touch-Friendly: Large buttons and intuitive gestures
- OAuth 2.0: Secure Marktplaats account integration
- Token Storage: Encrypted user tokens in DynamoDB
- CORS Protection: Configured for specific frontend domains
- Input Validation: Client and server-side validation
- API Rate Limiting: Handled by AWS API Gateway
# Full deployment
./deploy.sh
# Backend only
cd marktplaats-backend && ./deploy.sh
# Frontend only
cd marktplaats-frontend && ./deploy.sh- AWS credentials configured
- Marktplaats API credentials set
- Environment variables configured
- Tests passing
- CORS domains updated for production
- Solution: Image compression is automatic, but very large images (>10MB) may still timeout
- Workaround: Use the 1024x1024 compression setting
- Solution: Ensure callback URL matches Marktplaats app configuration
- Check:
FRONTEND_DOMAINenvironment variable
- Solution: Categories are fetched from Marktplaats API in real-time
- Check: Internet connectivity and API credentials
- Solution: Ensure AWS Bedrock has access to Claude Sonnet 3.7
- Check: AWS region (must be eu-west-1) and model permissions
# CloudWatch logs
aws logs tail /aws/lambda/marktplaats-backend-dev-generateListing --follow
# Specific function
serverless logs -f generateListing -t- Open browser developer tools
- Check console for compression logs
- Network tab for API call failures
- Fork and Clone: Fork the repository and clone locally
- Feature Branch: Create a feature branch (
git checkout -b feature/amazing-feature) - Development: Make changes and test thoroughly
- Tests: Ensure all tests pass
- Documentation: Update README if needed
- Pull Request: Submit PR with clear description
- Formatter: Black
- Linter: Flake8
- Type Checking: MyPy
- Docstrings: Google style
- Formatter: Prettier
- Linter: ESLint
- Style: Vue 3 Composition API
- CSS: Tailwind CSS classes
- Marktplaats API Documentation
- AWS Bedrock Claude Documentation
- Nuxt.js Documentation
- Serverless Framework Documentation
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or contributions:
- Check Issues: Look for existing GitHub issues
- Create Issue: Describe your problem with steps to reproduce
- Discussion: Use GitHub Discussions for questions
Made with β€οΈ and π€ AI assistance