Replacing manual plant registers with a role-based digital workflow — logging, monitoring, reporting, and ML-assisted insights, all in one platform.
- Overview
- Key Features
- Tech Stack
- Architecture
- Project Structure
- User Roles & Permissions
- Shift Lifecycle
- Getting Started
- Environment Variables
- Demo Data Seeder
- API Reference
- Security
- Testing
- Roadmap
- Contributing
- License
- Author
E-Logbook is a full-stack web application built to digitize industrial shift logging for plant operations. It replaces paper-based shift registers with a controlled, role-based digital system covering shift management, parameter monitoring, event and issue tracking, handover communication, audit trails, analytics, and ML-assisted anomaly detection.
It was built to model a real plant operations workflow — the kind used in power generation facilities — where every action (submit, approve, lock) needs to be traceable and accountable.
- 🔐 Role-based access control — Admin, HOD, Shift In-Charge, Operator, each with scoped permissions
- 📋 Shift lifecycle management — Draft → Submitted → Approved → Locked, with edit-locking after approval
- 📊 Dynamic parameter templates — admins define plant-specific parameters with min/max safety limits, no code changes needed
⚠️ Real-time safety alerts — readings outside safe range are flagged instantly in UI, reports, and PDFs- 📝 Event & issue logging — track operational events and issues with priority levels and closure remarks
- 🔄 Shift handover notes — structured communication between outgoing and incoming shifts
- 📈 Analytics dashboard — parameter trends, efficiency summaries, issue statistics
- 🧾 PDF report generation — full shift reports exportable via PDFKit
- 📅 Date-range reporting — cross-shift, cross-plant, cross-unit reports for management review
- 🕵️ Audit logging — every critical action (create, submit, approve, lock) is logged with user, role, and IP
- 🤖 ML-assisted anomaly detection — Python-based anomaly detection and predictive maintenance risk scoring
- 🌱 One-command demo data seeder — spin up realistic test data (plants, shifts, issues, users) instantly
| Layer | Technologies |
|---|---|
| Frontend | React, Vite, React Router, Axios, Chart.js / React-Chart.js-2 |
| Backend | Node.js, Express.js, JWT Auth, bcryptjs, Joi validation, PDFKit |
| Database | MongoDB with Mongoose ODM |
| ML Module | Python (anomaly detection script, invoked by backend as a child process) |
┌─────────────────────┐
│ React Frontend │
│ (Vite + Axios) │
└──────────┬───────────┘
│ REST API calls
▼
┌─────────────────────┐
│ Express Backend API │
│ (JWT auth, routes, │
│ controllers) │
└──────────┬───────────┘
│ Mongoose ODM
▼
┌─────────────────────┐
│ MongoDB Database │
└──────────┬───────────┘
│ spawns child process
▼
┌─────────────────────┐
│ Python ML Script │
│ (anomaly detection) │
└─────────────────────┘
e-logbook/
├── elogbook-backend/
│ ├── config/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── scripts/ # demo data seeder
│ ├── utils/ # PDF generator, audit logger
│ ├── validations/
│ └── server.js
│
├── elogbook-frontend/
│ └── src/
│ ├── api/
│ ├── components/
│ ├── pages/
│ ├── App.jsx
│ └── main.jsx
│
├── elogbook-ml/
│ └── anomaly.py
│
└── PROJECT_REPORT.md
| Role | Can Do |
|---|---|
| Admin | Create parameter templates, manage plants/departments/units, create shifts, view reports & audit logs, lock/approve, full dashboard & analytics access |
| HOD | Approve/lock shifts, view date-range reports, view audit logs, review operational data |
| Shift In-Charge | Create shifts, submit/approve per workflow, manage handover notes, add events/issues, view reports |
| Operator | Create shifts, log parameter readings, add events/issues, submit draft shifts |
Draft ──submit──▶ Submitted ──approve──▶ Approved ──lock──▶ Locked
✏️ editable 🔍 under review ✅ confirmed 🔒 read-only
Once locked, a shift becomes a permanent, unmodifiable record — closed issues and handover notes are also frozen after this point.
- Node.js (v16+ recommended)
- MongoDB (local instance or Atlas connection string)
- Python 3.x (for the ML module)
git clone https://github.com/arka562/e-logbook.git
cd e-logbookcd elogbook-backend
npm install
# create a .env file — see Environment Variables section below
npm run dev # starts with nodemon on default port 5000cd elogbook-frontend
npm install
npm run dev # starts the Vite dev servercd elogbook-ml
pip install -r requirements.txt # if present
# invoked automatically by the backend's ML controller — no separate server neededCreate a .env file inside elogbook-backend/:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
⚠️ Never commit your.envfile. Add it to.gitignoreif it isn't already there.
Spin up a realistic dataset in one command:
npm run seed:demoReset and recreate from scratch:
npm run seed:demo -- --reset-demo📦 What gets created
- 3 plants, 12 departments, 9 units
- 5 demo users (one per role)
- 36 parameter templates
- 126 shifts with ~1,512 parameter entries
- ~378 events, ~126 issues
- Audit logs, handover notes, missing handovers, critical issues, and aged unresolved issues
🔐 Demo login credentials
All demo users share the password: Password@123
| Role | |
|---|---|
| Admin | demo.admin@elogbook.test |
| HOD | demo.hod@elogbook.test |
| Shift In-Charge | demo.incharge@elogbook.test |
| Operator 1 | demo.operator1@elogbook.test |
| Operator 2 | demo.operator2@elogbook.test |
🔑 Authentication
POST /api/auth/register
POST /api/auth/login
🛠️ Admin
GET /api/admin/plants
POST /api/admin/plant
DELETE /api/admin/plants/:id
GET /api/admin/departments
POST /api/admin/department
GET /api/admin/plants/:plantId/departments
GET /api/admin/units
POST /api/admin/unit
GET /api/admin/departments/:departmentId/units
📋 Shifts
POST /api/shifts
GET /api/shifts
GET /api/shifts/:id
PUT /api/shifts/submit/:shiftId
PUT /api/shifts/approve/:shiftId
PUT /api/shifts/lock/:shiftId
PATCH /api/shifts/:shiftId/handover
📊 Parameters & Entries
POST /api/parameters/templates
GET /api/parameters/templates
POST /api/entries
📝 Events & Issues
POST /api/events
POST /api/issues
GET /api/issues/shift/:shiftId
PATCH /api/issues/:issueId/status
DELETE /api/issues/:issueId
📈 Dashboard, Reports, Audit & Analytics
GET /api/dashboard
GET /api/reports/shift/:shiftId
GET /api/reports/shift/:shiftId/pdf
GET /api/reports/range
GET /api/audit
GET /api/analytics/parameters
GET /api/analytics/trends
GET /api/analytics/efficiency
GET /api/analytics/issues
🤖 ML / Anomaly Detection
GET /api/ml/anomaly
GET /api/ml/predictive-maintenance
- JWT-based authentication on all protected routes
- Password hashing via
bcryptjs - Role-based authorization, enforced on both backend and frontend
- Locked shifts and closed issues are immutable
- Closure remarks are mandatory before an issue can be closed
Manual testing covers: login per role, shift creation, parameter entry with min/max alerts, event/issue logging, handover notes, the full submit → approve → lock flow, PDF export, date-range reports, audit logs, and the ML anomaly/predictive maintenance pages.
Automated checks:
npm run build # frontend build
npm run lint # frontend lint
node --check file.js # backend syntax check- Excel export for reports
- Email / WhatsApp notifications
- File and photo attachments for issues
- Advanced charting
- Admin user management UI
- More advanced anomaly detection models
- Real-time WebSocket notifications
- Mobile-responsive optimization
- Offline data entry support
- Digital signatures for shift approval
- Multi-plant permission matrix
This is currently a solo academic/portfolio project. If you'd like to suggest improvements:
- Fork the repo
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes
- Open a pull request
No license file is currently present in this repo. Add a LICENSE file (e.g. MIT) if you intend others to reuse this code.
Arkaprava GitHub: @arka562
Built as part of a B.Tech final-year project, originating from a Digital E-Logbook system developed during an industrial internship.