| Method | Endpoint | Description | | ------ | ---------------------- | --------------------- | | GET | `/downtime-events` | Get all downtime logs | | POST | `/downtime-events` | Log a downtime event | | GET | `/downtime-events/:id` | Get one event |
| Method | Endpoint | Description | | ------ | -------------------- | ---------------------------- | | GET | `/pm-tasks` | List all preventive tasks | | POST | `/pm-tasks` | Create a PM task | | PUT | `/pm-tasks/:id` | Update task / mark completed | | GET | `/pm-tasks/upcoming` | Get upcoming PMs |
| Method | Endpoint | Description | | ------ | ------------------ | ----------------------------- | | GET | `/work-orders` | List all work orders | | POST | `/work-orders` | Create new work order | | GET | `/work-orders/:id` | Get details of one work order | | PUT | `/work-orders/:id` | Update a work order | | DELETE | `/work-orders/:id` | Delete a work order |
| Method | Endpoint | Description | | ------ | ---------------- | -------------------- | | GET | `/equipment` | Get all equipment | | GET | `/equipment/:id` | Get single equipment | | POST | `/equipment` | Create new equipment | | PUT | `/equipment/:id` | Update equipment | | DELETE | `/equipment/:id` | Delete equipment |
automainte-backend/ │ ├── src/ │ ├── controllers/ ← Request handlers (business logic) │ ├── models/ ← DB models (e.g., using Sequelize or Prisma) │ ├── routes/ ← Route definitions (REST endpoints) │ ├── middleware/ ← Auth, error handling │ ├── config/ ← DB config, env vars │ └── utils/ ← Helpers (e.g., date formatting) │ ├── .env ← Secrets and DB config ├── server.js ← Entry point ├── package.json └── README.md