Add Docker Compose architecture with 4 microservices and Hugo/FACODI export system - #6
Conversation
Co-authored-by: marcelo-m7 <117441129+marcelo-m7@users.noreply.github.com>
…ples Co-authored-by: marcelo-m7 <117441129+marcelo-m7@users.noreply.github.com>
Co-authored-by: marcelo-m7 <117441129+marcelo-m7@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Configurações | ||
| DB_PATH = "ualg_courses.db" |
There was a problem hiding this comment.
Respect DB_PATH env so Docker services share database
The new Compose stack mounts ./data:/data and passes DB_PATH=/data/ualg_courses.db, but the API still hard‑codes DB_PATH = "ualg_courses.db". When the container starts, SQLite creates /app/ualg_courses.db instead of using the shared /data volume, so the API never sees data written by the scraper and the database is not persisted. Reading the path from the environment (or the Config class) would allow both services to operate on the same file.
Useful? React with 👍 / 👎.
Implements Docker-based production architecture with isolated services for API, scraping, and Hugo site generation, plus automated export pipeline for FACODI.pt integration.
Infrastructure
.env.example, rate limiting support (REQUEST_DELAY)Export System
export_to_hugo.py: SQLite → Hugo markdown with YAML front matter, module organization, document copyingsync_with_facodi.sh: Automation helper with validation and statisticsAPI Enhancements
New endpoints for FACODI integration:
Documentation (33,700 words)
docs/INTEGRATION.md: Architecture, data flow, setup workflow, troubleshootingdocs/HUGO_LAYOUTS_EXAMPLE.md: Complete template examples with stylingdocs/QUICK_REFERENCE.md: Command cheat sheet, common tasksdocs/IMPLEMENTATION_SUMMARY.md: Technical overviewREADME.md: Docker setup, FACODI integration workflow, updated endpointsQuick Start
Services: API (8000), FACODI (3000), on-demand scraper (profile-based), shared SQLite.
Testing
All 46 tests passing. No breaking changes. Backwards compatible with local development.
Original prompt
Análise do site UAlg e Plano de Implementação
1) Investigação do site UAlg - URLs coletadas ✅
URLs Exemplares Identificadas:
Páginas índice/listagem:
Exemplos de páginas de curso (padrão
/curso/{ID}):Análise técnica:
/curso/{ID}com ID numérico2) Arquitetura Docker Compose - 4 Serviços Isolados
Baseado nas suas especificações, vou estruturar o projeto com:
Serviço 1: API Python + SQLite
Serviço 2: Frontend Visualização Scraper
Serviço 3: Scraper Service
Serviço 4: Frontend FACODI.pt (clone)
3) Estrutura de Diretórios Proposta
4) Próximas Etapas Concretas (Priorizadas)
Fase 1: Preparação e Infraestrutura (Imediato - 1-2 dias)
1.1. Verificar robots.txt e permissões
1.2. Clonar facodi.pt para dentro do repositório
facodi-clone/directory com código Hugo1.3. Criar estrutura Docker
docker-compose.ymlcom 4 serviçosdocker/docker-compose upsobe todos os serviços1.4. Configurar variáveis de ambiente
Variáveis necessárias:
Fase 2: Desenvolvimento do Scraper e API (Curto prazo - 1 semana)
2.1. Ajustar scraper para URLs identificadas
START_URLemscrape_ualg.py/oferta-formativae/licenciaturas2.2. Implementar rate limiting configurável
2.3. Expandir schema.sql (se necessário)
duration_years,ects_total,regime,candidature_info2.4. API: Adicionar endpoints para FACODI