This repository contains a sample writeback server implementation provided to demonstrate recommended architectural patterns, component responsibilities, and typical data flows involved in building a writeback service.
The purpose of this codebase is to serve as a reference example and accelerator for developers who want to understand how a writeback server can be structured and integrated.
Please note:
- This implementation is not intended to be deployed as-is in production.
- It may not include all security hardening, operational safeguards, or scalability measures required for real-world environments.
- Certain aspects may be simplified to keep the example focused on clarity and educational value.
Before using a writeback server in a production system, you are expected to design, implement, and validate a production-grade solution appropriate to your organisation’s requirements, including (but not limited to) security, authentication, monitoring, logging, backups, performance, and compliance.
This sample is provided without warranty of any kind. The authors assume no responsibility for issues arising from using this code beyond its intended educational and illustrative purpose.
AnyChart Writeback Server is a simple writeback server designed to work with the AnyChart Spreadsheets Qlik Extension. The server is built with Node.js, uses SQLite3, and fully reinitializes the database on each startup by applying SQL seed files.
⸻
Features
- Data storage using SQLite
- Full database reinitialization at startup
- Universal CRUD routes
- Support for batch operations
- Retrieving table structure
- API protection via custom auth
- Simple configuration via .env
git clone <repository-URL>
cd <project-folder>
npm install
The environment is configured via a .env file (you must create it before running the server):
PORT = 3333
TOKEN = YOUR_TOKENWhere:
- PORT – the port on which the server will run
- TOKEN - token needed for custom auth
node src/index.js
On startup the server:
- recreates the SQLite database,
- applies SQL seed files from the seeds directory,
- opens the API on the port specified in .env.
(Protected by Custom Token Auth)
:table parameter is the name of the table in database.
GET /:table/get?offset=0&limit=10
GET /:table/get
Will return all records.
POST /:table/post
PUT /:table/put
Allows performing multiple operations at once: insert / update / delete.
POST /:table/batch
On startup the server recreate database and applies all .sql files from the directory:
/seeds
Each seed file is a SQL script that should include:
- DROP TABLE – remove a table if it already exists (to be able to recreate table)
- CREATE TABLE – create a new table
- INSERT INTO – populate the table with initial data