Deivid VanegasDesarrollador Backend e Integración
Back to projects

Java backend

Cham Orders API

Production-style order management REST API built with Java 21, Spring Boot, PostgreSQL, Flyway, Docker and OpenAPI.

Locally verified Release Candidate

Project overview

Context and approach

Overview

Cham Orders API is a transactional backend case study for managing users, customers, products and multi-item orders through a versioned REST contract.

Problem

Order systems must protect monetary calculations, preserve the historical state of purchased products and enforce authorization and lifecycle rules without leaking infrastructure details to clients.

Solution

A feature-first Spring Boot modular monolith applies JWT authentication, role-based authorization, server-side BigDecimal calculations, historical item snapshots, explicit state transitions and a consistent correlation-aware error contract.

Key figures

38

Automated tests

2

Flyway migrations

200

OpenAPI responses

59.85

Verified server total

Architecture

  1. 01

    API Consumer

    Authenticated REST requests and correlation IDs.

  2. 02

    Spring Web

    Versioned controllers, DTO validation and OpenAPI.

  3. 03

    Application modules

    Business rules, security and transactional services.

  4. 04

    PostgreSQL

    Persistent data, constraints and Flyway migrations.

Main capabilities

  • JWT authentication and ADMIN/OPERATOR authorization.
  • Customer, product and multi-item order management.
  • Server-side monetary calculations with explicit mathematical limits.
  • Historical product name, SKU and price snapshots.
  • PENDING to CONFIRMED or CANCELLED transitions.
  • Pagination, filtering and correlation ID propagation.
  • Standardized HTTP errors, OpenAPI and Swagger UI.

Verification evidence

  • 38 automated tests passed.
  • Maven clean test and clean package passed.
  • Docker image built and PostgreSQL 17.10 reported healthy.
  • Flyway V1 and V2 applied successfully.
  • OpenAPI JSON and YAML returned HTTP 200.
  • Docker-backed release-candidate smoke test passed.
  • Clean-clone verification passed.

Engineering decisions

  • — The server is the only authority for subtotals and totals.
  • — Order items store historical product snapshots.
  • — Expected HTTP failures share one stable error contract.
  • — Flyway exclusively manages the PostgreSQL schema.
  • — Correlation IDs are propagated when safe and generated otherwise.

Scope limitations

  • — No public or production deployment.
  • — No refresh tokens, payments, inventory, shipping or messaging.
  • — No Testcontainers suite or remote CI execution yet.
  • — Advanced observability and measured query optimization remain outside the MVP.

Review the implementation

Source code, documentation and reproducible local instructions are available on GitHub.

Open GitHub ↗