muller-reporting-sys/README.md
2025-11-12 22:21:35 +03:00

135 lines
3.1 KiB
Markdown

# Müller Bottle Production Management System
A Next.js application for managing milk bottle production shifts, operators, and quality control reports.
## Features
- **Admin Dashboard**: Manage teams, workers, shift managers, and machines
- **Shift Manager Portal**: Create and manage shifts, assign operators to machines
- **Operator Portal**: View active shifts and fill out detailed production reports
- **Real-time Reporting**: Track production parameters, quality checks, bottle weights, and more
## Tech Stack
- Next.js 16 (App Router)
- TypeScript
- Prisma ORM
- PostgreSQL
- NextAuth.js for authentication
- Tailwind CSS
- Recharts for data visualization
## Getting Started
### Prerequisites
- Node.js 18+ installed
- PostgreSQL database running
### Installation
1. Clone the repository
2. Install dependencies:
```bash
npm install
```
3. Set up your environment variables in `.env`:
```
DATABASE_URL="postgresql://user:password@localhost:5432/muller_db"
AUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
```
4. Push the database schema:
```bash
npm run db:push
```
5. Seed the database with initial data:
```bash
npm run db:seed
```
6. Run the development server:
```bash
npm run dev
```
7. Open [http://localhost:3000](http://localhost:3000)
## Default Login Credentials
### Admin
- Email: `admin@muller.com`
- Password: `admin123`
### Shift Manager
- Email: `john.manager@muller.com`
- Password: (No password - needs to be set up)
### Operators
- Email: `operator1@muller.com` to `operator7@muller.com`
- Password: (No password - needs to be set up)
## Application Structure
### Admin Features
- Manage teams (Red, Green, Blue, Yellow)
- Add/edit workers and operators
- Add/edit shift managers
- Manage 7 machines (T1-T7)
### Shift Manager Features
- Create shifts (AM/PM)
- Assign team members to shifts
- Distribute operators across machines
- Close completed shifts
### Operator Features
- View active shifts
- Fill out comprehensive shift reports including:
- Safety checklist
- Production pre-checks (wall thickness, section weights, station weights)
- Hourly production parameters
- Bottle weight tracking with charts
- Hourly quality checks
- Production tracking
- Seam leak tests
- Film details
- Production data and metrics
## Database Schema
- **admins**: System administrators
- **shiftManagers**: Shift managers who create and manage shifts
- **workers**: Operators and engineers
- **teams**: 4 teams (Red, Green, Blue, Yellow)
- **machines**: 7 blow moulding machines (T1-T7)
- **shifts**: Shift records (AM/PM, 12 hours each)
- **shiftTeamMembers**: Assignment of workers to shifts
- **machineShiftReports**: Detailed production reports for each operator
## Development
```bash
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Lint code
npm run lint
```
## Notes
- AM shift: 7:00 AM - 7:00 PM
- PM shift: 8:00 PM - 7:00 AM
- Each shift requires 7 operators (one per machine), 1 Level 2 supervisor, and 1 engineer
- Reports are automatically created when a shift manager assigns operators to machines