Files
CLProject/copy/README.md
T
2026-04-09 19:15:39 +02:00

2.8 KiB

Check List Proof of Concept

This repository contains a minimal proof-of-concept backend for the Check List hybrid reporting solution described in the project documentation.

What is included

  • Node.js REST API for template and configuration delivery
  • MariaDB schema for phase 1 configuration data
  • seed data with one sample inspection checklist template
  • lookup values, image policy, and export profile
  • setup instructions for local development

Scope of this PoC

Included:

  • template list endpoint
  • active template endpoint
  • specific template version endpoint
  • lookup endpoints
  • image rule endpoint
  • export profile endpoint
  • generic application config endpoint
  • MariaDB schema and seed data

Not included:

  • report upload
  • authentication
  • admin UI
  • report draft storage backend
  • XLSX or ZIP generation
  • client-side offline application

The PoC keeps template content inside a JSON column to reduce initial complexity and speed up delivery. This is deliberate for phase 1 proof-of-concept work.

Project structure

.
├── package.json
├── sql/
│   ├── schema.sql
│   └── seed.sql
└── src/
    ├── app.js
    ├── server.js
    ├── config/
    ├── db/
    ├── middleware/
    ├── routes/
    ├── services/
    └── utils/

Prerequisites

  • Node.js 20+
  • MariaDB 10.6+

Setup

  1. Copy .env.example to .env and adjust the database credentials.
  2. Create the schema:
SOURCE sql/schema.sql;
  1. Seed the sample data:
SOURCE sql/seed.sql;
  1. Install dependencies:
npm install
  1. Start the API:
npm start

API endpoints

Service health

GET /api/health

Templates

  • GET /api/templates
  • GET /api/templates/incoming-inspection
  • GET /api/templates/incoming-inspection/versions/1

Lookups

  • GET /api/lookups
  • GET /api/lookups/pass-fail

Configuration

  • GET /api/config/image-rules
  • GET /api/config/export
  • GET /api/config/app-config

Example response

GET /api/templates/incoming-inspection

{
  "code": "incoming-inspection",
  "name": "Incoming Inspection Checklist",
  "description": "PoC template for supplier or incoming goods quality inspection.",
  "version": 1,
  "status": "active",
  "publishedAt": "2026-04-09T10:00:00.000Z",
  "definition": {
    "templateId": "incoming-inspection",
    "templateName": "Incoming Inspection Checklist",
    "version": 1,
    "sections": []
  }
}

The next logical implementation layer is the client application that:

  • caches templates in IndexedDB,
  • renders forms dynamically from definition,
  • stores local drafts and image metadata,
  • applies validation rules before export,
  • generates XLSX and ZIP locally.