{"id":21205,"library":"egg-qeelyn-framework","title":"egg-qeelyn-framework","description":"Egg.js-based server-side framework (version 1.6.0) that extends Egg.js with pre-configured JSON logging, Redis integration, common controllers for user authentication (login, logout, SPM), middleware for JWT API auth, request signing, and anti-replay, plus services for HTTP requests, email, and user center. Release cadence: low (last update 2020). Key differentiator: opinionated framework aimed at reducing boilerplate for Egg.js microservices with built-in auth and SPM (Single Page Message) support.","status":"maintenance","version":"1.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/qeelyn/eggjs-framework","tags":["javascript","egg","egg-framework"],"install":[{"cmd":"npm install egg-qeelyn-framework","lang":"bash","label":"npm"},{"cmd":"yarn add egg-qeelyn-framework","lang":"bash","label":"yarn"},{"cmd":"pnpm add egg-qeelyn-framework","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; the framework extends egg.","package":"egg","optional":false}],"imports":[{"note":"Not imported directly; used as Egg.js framework via package.json egg.framework field.","wrong":"expecting npm require('egg-qeelyn-framework') as module","symbol":"default","correct":"in package.json: { \"egg\": { \"framework\": \"egg-qeelyn-framework\" } }"},{"note":"Available after proper framework setup; defined in extend/helper.js.","wrong":"ctx.helper.json(data, error)","symbol":"ctx.helper.jsonResult","correct":"ctx.helper.jsonResult(data, error)"},{"note":"Must call as function to get middleware.","wrong":"app.middleware.qeelynApiAuth","symbol":"app.middleware.qeelynApiAuth","correct":"app.middleware.qeelynApiAuth()"}],"quickstart":{"code":"// package.json\n{\n  \"name\": \"my-app\",\n  \"egg\": {\n    \"framework\": \"egg-qeelyn-framework\"\n  },\n  \"dependencies\": {\n    \"egg\": \"^2.0.0\",\n    \"egg-qeelyn-framework\": \"^1.6.0\"\n  }\n}\n\n// config/config.default.js\n'use strict';\nmodule.exports = appInfo => {\n  const config = {};\n  config.keys = appInfo.name + '_v1.0.0';\n  config.appCode = 'myAppCode';\n  // required for JWT auth: public key\n  config.publicKeyPath = require('path').join(appInfo.baseDir, 'config/rsa_pub.pem');\n  config.api = {\n    deoGateway: 'https://gateway.example.com',\n    ucenterAuth: 'https://ucenter.example.com',\n  };\n  config.pageConfig = {\n    loginUrl: 'https://login.example.com',\n    ucenterHost: 'https://ucenter.example.com',\n  };\n  config.cache = {\n    redis: {\n      port: 6379,\n      host: '127.0.0.1',\n      db: 0,\n    },\n  };\n  return config;\n};\n\n// app/router.js\n'use strict';\nmodule.exports = app => {\n  const { router, controller } = app;\n  // Use built-in controllers\n  router.post('/qeelyn-framework/usercenter-api', controller.qeelynFrameworkApi.ucenterApi);\n  router.get('/qeelyn-framework/logout', controller.qeelynFrameworkApi.logout);\n  router.get('/qeelyn-framework/log', controller.qeelynFrameworkApi.log);\n  router.post('/qeelyn-framework/spm', controller.qeelynFrameworkApi.spm);\n  \n  // Use middleware for API routes\n  const qeelynApiAuth = app.middleware.qeelynApiAuth();\n  const qeelynValidSign = app.middleware.qeelynValidSign();\n  const qeelynLog = app.middleware.qeelynLog();\n  router.post('/api/protected', qeelynValidSign, qeelynLog, qeelynApiAuth, controller.api.index);\n};","lang":"javascript","description":"Shows how to set up framework, configure, define routes, and use built-in controllers and middleware."},"warnings":[{"fix":"Place a valid RSA public key file at app/config/rsa_pub.pem.","message":"Framework requires RSA public key (rsa_pub.pem) in app/config/ for JWT verification. Missing file causes middleware to throw during authentication.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use egg ^2.0.0; do not upgrade to egg 3.x without migration.","message":"Framework depends on egg ^2.x. Incompatible with egg 3.x.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use ctx.logger.info() or structured logging from egg directly.","message":"Extend/context.js: ctx.logger for JSON logging is marked as deprecated (currently abandoned).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always call .qeelynApiAuth() with parentheses when using in route.","message":"Middleware must be called as a function (e.g., app.middleware.qeelynApiAuth()) to instantiate; passing the function directly as middleware will fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Configure Redis in config.default.js under config.cache.redis.","message":"SPM (Single Page Message) functionality requires Redis. If Redis is not configured, SPM endpoints will throw connection errors.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure egg-qeelyn-framework is added to dependencies and package.json has { \"egg\": { \"framework\": \"egg-qeelyn-framework\" } }","cause":"Missing or incorrect package.json 'egg.framework' field, or package not installed.","error":"Error: Can't find module 'egg-qeelyn-framework' required by 'egg'"},{"fix":"Place a valid RSA public key file at app/config/rsa_pub.pem (or update config.publicKeyPath).","cause":"Missing RSA public key file needed for JWT verification.","error":"Error: ENOENT: no such file or directory, open '.../config/rsa_pub.pem'"},{"fix":"Use app.middleware.qeelynApiAuth() to get the middleware function.","cause":"Middleware accessed without parenthesis — it returns a middleware factory, not a direct middleware.","error":"TypeError: app.middleware.qeelynApiAuth is not a function"},{"fix":"Either configure Redis properly in config.cache.redis or disable features that require Redis.","cause":"Redis connection failure when using SPM or cache. Framework assumes Redis is configured.","error":"Error: connect ECONNREFUSED 127.0.0.1:6379"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}