gohorsejobs/backend/internal
root e1c61289af feat(config): Add MCP JSON bootstrap and unify docs
Enable backend fallback to MCP JSON for database connection when DATABASE_URL is absent.\nAdd credentials bootstrap support from JSON for cloud/external services.\n\nConsolidate documentation with MCP integration guide and unified status.\nUpdate backlog to move video interviews endpoint out of current sprint.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-09 20:39:16 +01:00
..
api fix: complete restoration of core_handlers.go with HttpOnly and missing methods 2026-03-07 19:44:22 -03:00
core feat: implement LavinMQ messaging and background FCM notification worker 2026-03-07 18:49:33 -03:00
database feat(config): Add MCP JSON bootstrap and unify docs 2026-03-09 20:39:16 +01:00
dto feat: add pagination to candidates list endpoint 2026-02-23 18:02:41 -06:00
handlers feat: fix seeder password hashing, add custom questions, navbar/footer on register, payment handler 2026-02-23 20:26:49 -06:00
infrastructure fix: resolve duplicate FCM service and add SendMulticast method 2026-03-07 19:09:34 -03:00
middleware feat: implement full auth system with HTTPOnly cookies + JWT, fix migrations to UUID v7, remove mock data from frontend 2026-02-16 05:20:46 -06:00
models feat: fix seeder password hashing, add custom questions, navbar/footer on register, payment handler 2026-02-23 20:26:49 -06:00
router fix: desativa SanitizeMiddleware para evitar corrupção de encoding e erros de JSON 2026-03-07 19:30:13 -03:00
services feat(config): Add MCP JSON bootstrap and unify docs 2026-03-09 20:39:16 +01:00
utils fix: global document and phone handling — remove Brazil-specific formatting 2026-02-22 12:46:54 -06:00
README.md docs: complete project documentation overhaul 2025-12-09 19:36:36 -03:00

Internal - Backend Core

Este diretório contém toda a lógica interna do backend, seguindo princípios de Clean Architecture.


📁 Estrutura de Módulos

Diretório Camada Responsabilidade
api/ Interface Handlers e middlewares (Clean Arch)
core/ Domain Entidades, ports e use cases (DDD)
database/ Infrastructure Conexão GORM com PostgreSQL
dto/ Interface Data Transfer Objects (request/response)
handlers/ Interface Controllers HTTP (legacy)
infrastructure/ Infrastructure Implementações de ports
middleware/ Interface Middlewares de segurança
models/ Infrastructure Modelos GORM
router/ Interface Configuração de rotas
services/ Application Lógica de negócios (legacy)
utils/ Shared Utilitários (JWT, Sanitizer)

🏗️ Fluxo de Requisição

HTTP Request
     │
     ▼
┌─────────────┐
│ Middleware  │  (Auth, CORS, Rate Limit, Security Headers)
└─────────────┘
     │
     ▼
┌─────────────┐
│  Router     │  (router/router.go)
└─────────────┘
     │
     ▼
┌─────────────┐
│  Handler    │  (api/handlers/ ou handlers/)
└─────────────┘
     │
     ▼
┌─────────────┐
│  UseCase    │  (core/usecases/)
└─────────────┘
     │
     ▼
┌─────────────┐
│ Repository  │  (infrastructure/persistence/)
└─────────────┘
     │
     ▼
┌─────────────┐
│  Database   │  (PostgreSQL via GORM)
└─────────────┘

📦 Módulos Detalhados

api/

Implementação Clean Architecture dos handlers e middlewares.

  • handlers/ - Controllers HTTP novos
  • middleware/ - Auth com JWT Service

core/

Camada de domínio puro seguindo DDD.

  • domain/entity/ - Entidades sem dependências externas
  • ports/ - Interfaces de repositórios e serviços
  • usecases/ - Casos de uso (Login, CreateUser, etc.)

middleware/

Middlewares de segurança aplicados globalmente.

  • auth.go - Validação JWT + RBAC
  • cors.go - Whitelist de origens
  • rate_limit.go - 100 req/min por IP
  • security_headers.go - Headers OWASP

utils/

Utilitários compartilhados.

  • jwt.go - Geração e validação de tokens
  • sanitizer.go - Sanitização de inputs (XSS prevention)