Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🏭 Production Control System

Java Spring Boot React TypeScript Docker Maven Tests License

A full stack application for production management that allows managing products, raw materials and their relationships, and calculating which products can be manufactured based on available stock.

This project demonstrates a production-ready architecture with a fully containerized environment, automated tests, clean backend structure and modern frontend integration.


🚀 Tech Stack

Backend

  • Java 17
  • Spring Boot
  • Spring Data JPA
  • Maven
  • H2 / MySQL
  • JUnit & Mockito

Frontend

  • React
  • TypeScript
  • Vite
  • Axios
  • Nginx (production build)

DevOps

  • Docker
  • Docker Compose

Testing

  • Backend unit tests (Service layer)
  • Frontend tests (Vitest + Testing Library)
  • End-to-end tests (Cypress)

📌 Features

  • Product management
  • Raw material management
  • Product ↔ raw material association
  • Production feasibility calculation based on stock
  • Global exception handling
  • Structured API responses
  • Request traceability with Correlation ID
  • Environment-based configuration
  • Fully containerized application

🧠 Business Rules

  • A product can be linked to multiple raw materials
  • Each raw material has an available stock quantity
  • The system calculates which products can be produced based on current stock
  • Production is limited by the scarcest required raw material

🏗️ Backend Architecture

controller → REST endpoints  
service → business rules  
repository → data access  
entity → database mapping  
dto → request/response models  
exception → global error handling  
config → filters & environment configuration  

Design Patterns & Practices

  • Layered architecture
  • DTO pattern
  • Global exception handler
  • Correlation ID filter for logging
  • Unit testing with mocks

🐳 Running with Docker (Recommended)

Build and start the entire application:

docker-compose up --build

🔗 Access

Frontend: http://localhost
Backend API: http://localhost:8080
Swagger UI: http://localhost:8080/swagger-ui.html

The frontend is served by Nginx and API requests to /api are automatically proxied to the backend container.


💻 Running in Development Mode

Backend

mvn spring-boot:run

Backend:

http://localhost:8080

Frontend

cd frontend
npm install
npm run dev

Frontend:

http://localhost:5173

🧪 Running Tests

Backend

mvn test

Frontend

npm run test

Cypress E2E

npx cypress open

🔗 Main API Endpoints

Products

  • GET /products
  • POST /products
  • PUT /products/{id}
  • DELETE /products/{id}

Raw Materials

  • GET /raw-materials
  • POST /raw-materials

Product Materials

  • POST /product-materials

Producible Products

  • GET /products/producible

🌱 Environment Profiles

Supported profiles:

  • dev
  • prod

Configured via:

spring.profiles.active

📦 Container Structure

production-control-api/
├── Dockerfile
├── docker-compose.yml
├── .dockerignore
├── frontend/
│   ├── Dockerfile
│   └── nginx.conf

📚 What This Project Demonstrates

  • Clean architecture with Spring Boot
  • Real business logic implementation
  • Full stack integration
  • Production-ready Docker environment
  • Reverse proxy with Nginx
  • Automated testing strategy
  • REST API best practices

👨‍💻 Author

Gustavo Batista
Java & Spring Boot Backend Developer
Full Stack Developer

LinkedIn: www.linkedin.com/in/gustavo-batista-11a570291
GitHub: https://github.com/

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages