{"id":18376,"library":"flexbiz-server","title":"Flexbiz Server","description":"Flexbiz Server is the backend service for the Flexbiz business application, providing API endpoints for business operations. The current stable version is 12.6.8. It is released on an irregular cadence with breaking changes between major versions. Key differentiators: built for the Flexbiz ecosystem, tightly coupled with the Flexbiz client, and not designed as a general-purpose server framework. Underlying dependencies include Express.js for HTTP handling and Sequelize for ORM, though these may vary by version.","status":"active","version":"12.6.8","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","business","service","API"],"install":[{"cmd":"npm install flexbiz-server","lang":"bash","label":"npm"},{"cmd":"yarn add flexbiz-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add flexbiz-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP server framework used for routing and middleware","package":"express","optional":false},{"reason":"ORM for database operations, typically PostgreSQL or MySQL","package":"sequelize","optional":false}],"imports":[{"note":"ESM-only since v10; CommonJS require() fails with ERR_REQUIRE_ESM.","wrong":"const FlexbizServer = require('flexbiz-server')","symbol":"FlexbizServer","correct":"import { FlexbizServer } from 'flexbiz-server'"},{"note":"Named export, not default export. Do not use default import.","wrong":"import createApp from 'flexbiz-server'","symbol":"createApp","correct":"import { createApp } from 'flexbiz-server'"},{"note":"TypeScript type export; use type import for compilation only.","wrong":"import { Config } from 'flexbiz-server'","symbol":"Config","correct":"import type { Config } from 'flexbiz-server'"},{"note":"Subpath export for database utilities; not re-exported from main entry.","wrong":"import { initializeDatabase } from 'flexbiz-server'","symbol":"initializeDatabase","correct":"import { initializeDatabase } from 'flexbiz-server/db'"}],"quickstart":{"code":"import { FlexbizServer, Config } from 'flexbiz-server';\n\nconst config: Config = {\n  port: parseInt(process.env.PORT ?? '3000'),\n  db: {\n    host: process.env.DB_HOST ?? 'localhost',\n    port: parseInt(process.env.DB_PORT ?? '5432'),\n    database: process.env.DB_NAME ?? 'flexbiz',\n    username: process.env.DB_USER ?? 'admin',\n    password: process.env.DB_PASSWORD ?? '',\n  },\n};\n\nconst server = new FlexbizServer(config);\nawait server.start();\nconsole.log(`Server running on port ${config.port}`);","lang":"typescript","description":"Shows how to import and instantiate FlexbizServer with configuration, including database credentials from environment variables."},"warnings":[{"fix":"Switch to ESM by using import syntax, or downgrade to v9.x if CJS is required.","message":"ESM-only starting from v10. CommonJS require() will throw ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Replace `server.listen()` with `await server.start()`.","message":"The method `server.listen()` is deprecated; use `server.start()` instead.","severity":"deprecated","affected_versions":">=11.0.0"},{"fix":"Update config to use `host` property instead of `hostname`. Ensure `host` is provided.","message":"Configuration format changed: `db.host` is now required, `db.hostname` removed.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"Use named imports like `import { FlexbizServer } from 'flexbiz-server'`.","message":"Default export removed in v10; only named exports available.","severity":"gotcha","affected_versions":">=10.0.0"},{"fix":"Call `initializeDatabase(config.db)` before `new FlexbizServer(config)`.","message":"Database initialization must be called explicitly before starting the server; no auto-connect.","severity":"gotcha","affected_versions":">=12.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install flexbiz-server` and ensure the package is in node_modules.","cause":"Forgetting to install the package or incorrect import path.","error":"ERR_MODULE_NOT_FOUND: Cannot find module 'flexbiz-server'"},{"fix":"Replace `import FlexbizServer from 'flexbiz-server'` with `import { FlexbizServer } from 'flexbiz-server'`.","cause":"Using a default import when FlexbizServer is a named export.","error":"TypeError: flexbiz_server_1.FlexbizServer is not a constructor"},{"fix":"Use `await server.start()` instead of `server.listen()`.","cause":"Calling deprecated `server.listen()` on versions >=11.0.0.","error":"Error: listen is not a function"},{"fix":"Ensure `config.db.host` is set to a valid hostname or IP address.","cause":"Database host not provided or undefined in config.","error":"SequelizeConnectionError: getaddrinfo ENOTFOUND undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}