Skip to content
nexus-dialogs
GitHub npm

Human resources mini ERP

A small application that brings together several modules of the library: hiring wizard, Excel import and export, vacation with a calendar, bulk actions with progress and removals with confirmation. Everything runs in your browser; nothing is saved.

Employees 0

Employee list
No.NameAreaPositionDaily salaryActions

Tip: “Import” brings a downloadable CSV template with the headers to try it. The HR templates (hiring, vacation) are plain JSON in Spanish; as they are data, you can translate them.

Activity

What each dialog returned. This is how the result your code receives looks.

How it is built

The page’s code is a few lines per module.

import { formFromJSON } from 'nexus-dialogs/forms'
import { plantillas, sinResolvers } from 'nexus-dialogs/rrhh'
import { importData, exportData } from 'nexus-dialogs/import'
import { confirmDelete, bulkAction } from 'nexus-dialogs/patterns'
import { toast } from 'nexus-dialogs/toast'

// Hiring: the HR template already brings the steps, RFC/CURP/CLABE validators and the review
const hire = await formFromJSON(sinResolvers(plantillas.altaEmpleado))
if (hire.confirmed) employees.push(toEmployee(hire.value))

// Import: choose a file, map columns and review errors per row
await importData({ title: 'Import employees', columns, onImport: (rows) => employees.push(...rows) })

// Removal with consequences and “Undo”
if (await confirmDelete({ what: 'Laura Méndez', consequences: ['Their access is cancelled'] })) {
  toast.success('Removal recorded', { action: { label: 'Undo', onClick: restore } })
}