2025-08-16 15:00:36 +02:00
2025-08-15 22:40:19 +02:00
2025-08-16 15:00:36 +02:00
2025-08-15 23:11:53 +02:00
2025-08-12 18:17:30 +02:00
2025-08-16 15:00:36 +02:00
2025-08-16 08:00:52 +02:00
2025-08-12 18:17:30 +02:00
2025-07-17 14:34:24 +02:00
2025-08-16 15:00:36 +02:00
2025-07-18 17:14:30 +02:00

Bakery Forecasting Platform - Microservices

Overview

AI-powered demand forecasting platform for bakeries in Madrid, Spain using microservices architecture.

Architecture

  • API Gateway: Central entry point for all client requests
  • Auth Service: User authentication and authorization
  • Training Service: ML model training for demand forecasting
  • Forecasting Service: Generate predictions using trained models
  • Data Service: External data integration (weather, traffic, events)
  • Tenant Service: Multi-tenant management
  • Notification Service: Email and WhatsApp notifications

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Python 3.11+
  • Node.js 18+

Setup

# Run setup script (this script!)
./scripts/setup.sh

# Start services
docker-compose up -d

# Check service health
curl http://localhost:8000/health

Services

Development

Running Tests

./scripts/test.sh

Building Services

docker-compose build

Viewing Logs

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f auth-service

Service URLs (Development)

Environment Variables

Copy .env.example to .env and update the following:

# External API Keys
AEMET_API_KEY=your-aemet-api-key
MADRID_OPENDATA_API_KEY=your-madrid-opendata-key

# Email Configuration
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-email-password

# WhatsApp API
WHATSAPP_API_KEY=your-whatsapp-api-key

# JWT Secret (change in production!)
JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production

Troubleshooting

Services won't start

# Check if ports are available
docker-compose ps
netstat -tulpn | grep :8000

# Restart services
docker-compose down
docker-compose up -d

Database connection issues

# Check database containers
docker-compose logs auth-db
docker-compose logs training-db

# Reset databases
docker-compose down -v
docker-compose up -d

Service communication issues

# Check service health
curl http://localhost:8000/health
curl http://localhost:8001/health
curl http://localhost:8002/health

# Check RabbitMQ
open http://localhost:15672
# User: bakery, Password: forecast123

Next Steps

  1. Configure External APIs: Add your AEMET and Madrid Open Data API keys
  2. Test Authentication: Register a user and test login
  3. Upload Sales Data: Import historical sales data
  4. Train Models: Start your first training job
  5. Generate Forecasts: Create demand predictions

License

MIT License

Description
Main repository for Bakery IA project - Automatically created
Readme 20 MiB
Languages
Python 56.3%
TypeScript 39.6%
Shell 2.9%
CSS 0.4%
Starlark 0.3%
Other 0.3%