gohorsejobs/backend/internal
2026-02-25 07:23:45 -06:00
..
api feat: add pagination to candidates list endpoint 2026-02-23 18:02:41 -06:00
core feat: fix seeder password hashing, add custom questions, navbar/footer on register, payment handler 2026-02-23 20:26:49 -06:00
database chore: commit pending changes 2026-02-15 16:03:40 +00: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 remaining merge conflicts 2026-02-14 17:21:10 +00: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 feat: fix seeder password hashing, add custom questions, navbar/footer on register, payment handler 2026-02-23 20:26:49 -06:00
services feat: optimize jobs database querying and immutable indexes 2026-02-25 07:23:45 -06: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)