Skip to content
forms-raw_singleitemedit-icon
navigation
modification_btn
docs
messages
flatprojectmap.handlebars
Costing Summary
modificationbutton
docs_htmltables.handlebars

Costing Summary

docs_html.handlebars
documentation.handlebars

Lynx Plugin Summary

The Lynx plugin extends the ShiftBulk application by providing a comprehensive task management and costing interface. Named after the lynx in keeping with the project’s animal theme, the plugin offers both a browser‑based CRUD interface and a REST API for programmatic access. When a task is saved, the server automatically computes labour and non‑labour costs, applies overheads, contingency and margin, and stores the grand total.

Plugin Name & Location

Name: Lynx – continuing the animal motif of other internal modules.
Location: The plugin resides in plugins/lynx within your Node/Express project. To enable it, import the router and mount it in your main Express application. If you use Handlebars, register the plugin’s partials directory so that its templates can be found.

// app.js or similar
                    const lynx = require('./plugins/lynx');
                    partialsDir.push('./plugins/lynx/views/partials');
                    app.use('/', lynx);

Purpose

Lynx provides a unified interface for task management and costing. Users can list, create, edit and delete tasks from the web UI. The plugin also exposes a set of endpoints identical to those in the Beaver costing API, allowing developers to perform the same operations via JSON without using the UI.

Key Routes and Methods

UI CRUD Routes

These routes render Handlebars templates and handle form submissions. They are the entry points for the browser‑based interface:

Method & PathDescription
GET /lynxDisplays the landing page with a list of tasks and a form to create a new one.
POST /lynx/tasksProcesses the “Create New Task” form, saves the task and recalculates totals.
GET /lynx/tasks/:id/editShows a form populated with the current values of the specified task.
POST /lynx/tasks/:id/editUpdates an existing task and recomputes its totals.
POST /lynx/tasks/:id/deleteDeletes the specified task and redirects back to the listing.

REST API Endpoints

These endpoints return JSON and are suitable for integration with single page applications or other services:

  • GET /api/projects/:id/catalogs – Returns phases, work types, disciplines, cost types and the project’s rate card.
  • POST /api/tasks / PATCH /api/tasks/:id – Create or update tasks via JSON.
  • POST /api/tasks/:id/recalc – Recalculate cost totals for a task.
  • GET /api/projects/:id/rollup – Produces a hierarchical roll up of project cost totals.
  • GET /api/projects/:id/export.csv – Exports task data as a CSV file.

Folder Structure

Lynx uses a clear MVC layout for maintainability. Controllers, models and views are separated so that you can extend or replace parts of the plugin without affecting the whole:

PathDescription
plugins/lynx/index.jsRegisters both the UI and API routes with an Express router.
plugins/lynx/controllers/Contains logic for catalogues, tasks, roll up and CSV export.
plugins/lynx/models/Defines Mongoose schemas for Project, Area, System, WorkPackage, Task and RateCard.
plugins/lynx/views/lynx/index.handlebarsLanding page template showing tasks and the create form.
plugins/lynx/views/lynx/edit.handlebarsTemplate for editing a specific task.
plugins/lynx/views/partials/Reusable UI fragments such as navigation panels.

Integration Notes

  • Ensure MongoDB is configured; Lynx relies on Mongoose for data persistence.
  • The plugin uses your application’s default layout; it does not specify its own. If you have multiple layouts, adjust accordingly.
  • The UI captures only essential fields; cost calculations are delegated to server‑side helpers. Extend the forms if you need additional attributes.
  • The Task model in Lynx allows ad hoc tasks by relaxing projectId and areaId requirements. For production use, always supply these references.
  • Prefer the REST API over direct database access. This ensures that business rules—such as recalculation of totals—are applied consistently.

This summary provides a high‑level overview of the Lynx plugin. For detailed data structures and UI markup, refer to the other documentation sets.

modal1
modal2
modal3
docs_javascript
new_issue_button.handlebars
shortcut_edit