GrapORM is an educational backend ORM built on Node.js and PostgreSQL, implementing a single-dispatch pattern where all business operations pass through a single endpoint (/to-process). It enforces session validation, permission checking, and method execution via reflection. Version 1.0.1 requires Node >=18 and a local PostgreSQL installation. Unlike traditional REST APIs, GrapORM centralizes security and allows adding new business objects without defining new routes. It caches permissions in memory for O(1) lookup. The project is released under an unspecified license and is currently in active development.
npm install grap-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic Express setup with CORS, session, and a simplified /to-process endpoint that dynamically loads business objects and executes methods.
Upgrade to Node.js 18 or later.
Install PostgreSQL and ensure it is in PATH. Run 'npm run init' to create the database schema.
Use require() for now. When upgrading, check for ESM compatibility.
Create the BO file in bo/ and add its name to allowedObjects in configs/bosconfig.json.
Ensure bosconfig.json contains only safe BO names. Avoid passing unsanitized user input to require().
Generate a random secret with node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" and set it in .env.Ensure the file exists at bo/UserBO.js and that the name matches exactly (case-sensitive).
Start PostgreSQL service and verify host/port in configs/connections.json.
Ensure the user is logged in via /login first and that the session cookie is sent in the request.
Verify the method name spelling and ensure the BO exports the method as a function.