Case study 03
Production planning. A daily system for a weaving and embroidery factory.
Finite-capacity planning for a textile and embroidery factory: cycles, stages, machine queues, daily follow-up, and rescheduling from actual output.
- Sector
- Textile and embroidery manufacturing
- Type
- Daily production planning and follow-up
- Role
- End-to-end owner: factory method, data model, scheduling engine, Arabic and English UI, database, and release
The business problem
Each item passes through weaving, embroidery, appliqué, and other department stages. Every stage has minutes per piece, a headcount, and machines. Before the system, the plan was spread by hand.
- There was no real calculation of the day’s capacity. Quantity was split across days without working hours, efficiency, headcount, or the factory calendar. Friday is off. Saturday is a working day.
- Who runs which machine, who is paused, and who is stopped did not live in one place.
- The next stage was scheduled as if it were independent.
- If a department produced less or more than required, later dates did not move on their own.
What the system changes
Operating timings are not listed. No percentage is stated without a measurement.
A plan in minutes
The cycle, the items, and the queues generate a stage schedule: start, finish, planned quantity, and working days.
Capacity is a constraint
Daily quantity comes from department hours × efficiency × headcount ÷ minutes per piece.
Daily supervision
Each item is on time, late, or not started. Follow-up compares plan with actual.
The plan moves with reality
After actual output is recorded, rolling reschedule closes the finished part and recalculates the rest, with a preview and a rollback.
The machine decision is recorded
Each weaving or embroidery machine has a queue, with pause, resume, and a final stop.
How the engine works
- A stage does not start before the previous stage finishes, or before the worker or machine is free.
- Queues set the order of items on a machine. A pause or a final stop changes the quantity and the schedule.
- Reschedule closes recorded days, rebuilds the rest, and keeps the last version for rollback.
Define the factory
- Departments and efficiency
- Machines
- Stage templates
The cycle
- Create a cycle
- Items and quantities
- Queues
- Generate the schedule
Execution
- Daily follow-up
- Plan versus actual
- Gantt
Correction
- Preview
- Apply or roll back
- Delay board
Technical architecture
No cycle names, item codes, quantities, or delivery dates are shown.
| Interface | Next.js 16, React 19, TypeScript, Tailwind CSS 4, Arabic RTL and English |
|---|---|
| Server | Next.js Route Handlers |
| Data | PostgreSQL on Supabase, JSONB for stages, queues, and the follow-up log |
| Engine | Finite-capacity scheduling written for this line |
| Calendar | Local working days, Friday off |
| Hosting | Vercel, with a longer limit for rescheduling |