Production Cost Analyzer

Hi everyone! Welcome to my project for calculating labor cost. Just upload your Excel (.xlsx) file containing the process data and lot quantites, and it will compute everything automaticly.





How The Math Works (The Logic)

So, to calculate the exact cost per process, I used the provided master data. Here is a breakdown of how I did the maths, using Process A as an example:

When you upload the excel sheet, my python backend reads the "Lot Quantity" for each process. It multiplys the cost per lot and the output per lot by the number of lots to get the total cost and total output for the whole batch. Then it sums it all up across all processes and divides total cost by total output to generate the final Overall Labor Cost per kg.

Tech Stack I Used & My Implementation Details

For this assignment, I decided to build my solution using a decoupled architecture. This means I separated the "frontend" (what you see on this page) from the "backend" (the engine doing the math). Even though I could have put it all in one script, separating them makes the application much more scalable and easier to maintain. Here is a detailed breakdown of the exact technologies I used and why I chose them:

Overall, this architecture perfectly satisfies the functional requirements of the assignment. It securely applies the predefined master data (labor wages and standards), accurately extracts the lot quantities from your Excel sheet, dynamically computes the costs per kg, and neatly displays everything without any page reloads.

Other Approaches I Considered

Before writing the code, I thought about a few different ways to build this project:

Approach 1: The Minimalist Python Web Server (Flask/Jinja)

This is the most literal interpretation of the assignment, keeping everything within a single framework.

Approach 2: Modern Decoupled Architecture (FastAPI + Next.js)

Instead of mixing HTML rendering into Python, you separate concerns. This approach results in a much more professional application.

Approach 3: The Data Pipeline Approach (Streamlit)

If the goal is to build an internal tool purely for data analysis without worrying about complex frontend routing or DOM manipulation, Streamlit is a fantastic Python-native option.