{"id":24905639,"url":"https://github.com/victor-abz/frappejs-backend","last_synced_at":"2026-04-29T16:04:15.424Z","repository":{"id":101265194,"uuid":"469918907","full_name":"victor-abz/frappejs-backend","owner":"victor-abz","description":"Frappe backend is a meta-data driven backend framework that enables rapid application development of Node.js REST API. Inspired by [frappejs](https://github.com/frappe/frappejs) a product from [Frappe](https://frappeframework.com).","archived":false,"fork":false,"pushed_at":"2022-07-24T13:28:02.000Z","size":956,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T18:34:05.321Z","etag":null,"topics":["framework","json-schema","metadata","node","rapid-development"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victor-abz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-14T22:03:56.000Z","updated_at":"2022-03-27T21:43:09.000Z","dependencies_parsed_at":"2023-05-03T09:00:35.466Z","dependency_job_id":null,"html_url":"https://github.com/victor-abz/frappejs-backend","commit_stats":{"total_commits":63,"total_committers":1,"mean_commits":63.0,"dds":0.0,"last_synced_commit":"3e20aaad84e513af1b7c385d7a9e24c30986f4f5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor-abz%2Ffrappejs-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor-abz%2Ffrappejs-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor-abz%2Ffrappejs-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor-abz%2Ffrappejs-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victor-abz","download_url":"https://codeload.github.com/victor-abz/frappejs-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841741,"owners_count":20681194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","json-schema","metadata","node","rapid-development"],"created_at":"2025-02-02T00:23:50.685Z","updated_at":"2025-10-09T00:21:59.315Z","avatar_url":"https://github.com/victor-abz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frappe-backend.js\n\nFrappe backend is a meta-data driven backend framework that enables rapid application development of Node.js REST API.\nInspired by [frappejs](https://github.com/frappe/frappejs) a product from [Frappe](https://frappeframework.com).\n\nThe objective of Frappe Backend is be a clean and opinionated micro-framework to develop small-business applications.\n\nSo, I love the simplicity of frappejs, and the Schema defined in the frappe framework to act as a Document Oriented framework, but using the power of a Relational Database Engine, what simplify and boost the level of coherence in the system.\n\n## Features\n\n- Rapid REST-API Development\n- Database backends\n\n## Quick Start\n\n---\n\n\u003e You can quickly get started with [Typescript BoilerPlate](https://github.com/victor-abz/frappe-backend-typescript-boilerplate)\n\n---\n\nI you like to build it on your own, follow below guide:\n\n### Initialize a new NodeJS project\n\n`mkdir fback-demo \u0026\u0026 cd fback-demo`\n`npm init -y`\n\n### Install Frappe Backend\n\n`npm i frappe-backend`\n\nadd the Following to your package.json\nTo start the server add this to your `package.json`\n\n```bash\n{\n  ...\n  \"scripts\": {\n\t\"new-model\": \"frp-cmd new-model\",\n    \"start\": \"frp-cmd start\",\n\t\"dev\": \"frp-cmd start dev\"\n  }\n  ...\n}\n```\n\n### Create app Entry file for your project. e.g app.js and backend config file\n\n```js\nconst server = require('frappe-backend/server');\n\nserver.start({\n  backend: 'pg', // To start a postgres backend.\n  connectionParams: {\n    db_name: process.env.DB_NAME, // Existing postgres database name\n    username: process.env.DB_USERNAME, // Database username\n    password: process.env.DB_PWD, // Database password\n    host: process.env.DB_HOST, // Database host\n    client: 'pg', // Database client. options are [pg]\n  },\n  enableCORS: true,\n  //   models, // this will contain your database models\n  // \troutes,\n  // \tmiddlewareList: [testMid(124), testMid(5)],\n});\n```\n\nCreate `frappe-backend.conf.js` file at the root directory of your project. Minimum config look like:\n\n```js\nmodule.exports = {\n  dev: {\n    devServerPort: process.env.PORT || 3000,\n    devServerHost: 'localhost',\n  },\n  baseDir: '.', // If you want the model codes to be in another folder such as src\n  useEs6: true, // If you want to generate models in ES6 Format\n  node: {\n    paths: {\n      main: 'app.js',\n    },\n  },\n  nodemon: {\n    // To be able to run the development server\n    watch: ['.'],\n    ext: '.ts,.js',\n    ignore: [],\n    exec: 'ts-node',\n    entry: './src/app.ts',\n  },\n};\n```\n\n### To Generate your first Model(model is like database table). Example ToDo:\n\nNow run `npm run new_model ToDo`\nThis will create a new model in `models/doctype` called ToDo\nit will include a name field which represent the ID of each record. Go ahead and add the following fields under fields.:\n[Read this to Understand more about models](docs/models/index.md)\n\n```js\n{\n\tfieldname: 'subject',\n\tlabel: t`Subject`,\n\tplaceholder: 'Subject',\n\tfieldtype: 'Data',\n\trequired: 1,\n},\n{\n\tfieldname: 'status',\n\tlabel: t`Status`,\n\tfieldtype: 'Select',\n\toptions: ['Open', 'Closed'],\n\tdefault: 'Open',\n\trequired: 1,\n},\n{\n\tfieldname: 'description',\n\tlabel: t`Description`,\n\tfieldtype: 'Text',\n},\n```\n\nYour ToDo.js Model should like this now:\n\n```js\nmodule.exports = {\n  name: 'ToDo',\n  label: 'ToDo',\n  naming: 'name', // {random|autoincrement}\n  isSingle: 0,\n  isChild: 0,\n  isSubmittable: 0,\n  settings: null,\n  keywordFields: [],\n  fields: [\n    {\n      fieldname: 'name',\n      label: 'Name',\n      fieldtype: 'Data',\n      required: 1,\n    },\n    {\n      fieldname: 'subject',\n      label: t`Subject`,\n      placeholder: 'Subject',\n      fieldtype: 'Data',\n      required: 1,\n    },\n    {\n      fieldname: 'status',\n      label: t`Status`,\n      fieldtype: 'Select',\n      options: ['Open', 'Closed'],\n      default: 'Open',\n      required: 1,\n    },\n    {\n      fieldname: 'description',\n      label: t`Description`,\n      fieldtype: 'Text',\n    },\n  ],\n};\n```\n\nImport models folder in your entry file\n\n```js\nconst server = require('frappe-backend/server');\nconst models = require('./models'); // Import Models folder\n// import routes from './routes'; // Import Custom Routes\n// import { testMid } from './middleware/sample.middleware';\n\nserver.start({\n  backend: 'pg', // To start a postgres backend.\n  connectionParams: {\n    db_name: process.env.DB_NAME, // Existing postgres database name\n    username: process.env.DB_USERNAME, // Database username\n    password: process.env.DB_PWD, // Database password\n    host: process.env.DB_HOST, // Database host\n    client: 'pg', // Database client. options are [pg]\n  },\n  enableCORS: true,\n  models, // Your Import\n  // routes, // Your custom routing\n  // middlewareList: [middleWare1, middleWare2], // Pass global middleware functions\n});\n```\n\n### Start Server\n\nnow run your server with `npm run start`. Your NodeJs Server will start at specified port.\nGo to your Postman and you should be able to consume RestAPI to your ToDo model.\n[check this RestAPI Documentation](docs/server/rest.md)\n\n## Documentation\n\n[Read the full docs](docs/index.md)\n\n## ToDo\n\n- [x] Allow custom Routes and overriding\n- [x] Add development nodemon reload/watch changes to files\n- [x] Pass custom Middleware to routes\n- [ ] Integrate various type of Authentication\n- [ ] Convert Package to Typescript\n\n## Contribution\n\nYou are welcome to contibute. Just raise the PR.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor-abz%2Ffrappejs-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictor-abz%2Ffrappejs-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor-abz%2Ffrappejs-backend/lists"}