{"id":21944260,"url":"https://github.com/michaelkrone/generator-material-app","last_synced_at":"2025-03-17T09:08:48.556Z","repository":{"id":25905405,"uuid":"29346110","full_name":"michaelkrone/generator-material-app","owner":"michaelkrone","description":"Yet another yeoman generator for scaffolding a simple Node.js/Express/MongoDB/Angular.js app using some material design elements.","archived":false,"fork":false,"pushed_at":"2017-04-26T20:26:01.000Z","size":720,"stargazers_count":177,"open_issues_count":16,"forks_count":48,"subscribers_count":23,"default_branch":"develop","last_synced_at":"2025-03-04T07:11:25.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelkrone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-16T11:39:26.000Z","updated_at":"2023-11-29T08:32:18.000Z","dependencies_parsed_at":"2022-08-24T16:11:04.648Z","dependency_job_id":null,"html_url":"https://github.com/michaelkrone/generator-material-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fgenerator-material-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fgenerator-material-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fgenerator-material-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fgenerator-material-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelkrone","download_url":"https://codeload.github.com/michaelkrone/generator-material-app/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006278,"owners_count":20382444,"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":[],"created_at":"2024-11-29T04:15:13.943Z","updated_at":"2025-03-17T09:08:48.539Z","avatar_url":"https://github.com/michaelkrone.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generator-material-app\n\nYet another yeoman generator for scaffolding a simple MEAN stack application using some material design elements.\n\n![User administration](https://michaelkrone.github.io/generator-material-app/screenshots/users-detail.png)\n\n###### This project is still under heavy development.\n\n## Features\nThe generator supports group based ACL's and socket.io communication with the server API.\n\n\n## Install\n```bash\n$ npm install generator-material-app\n```\n\n## Quick Start\nTo quickly scaffold an application use the following commands (Answer all questions with hitting the enter key):\n```bash\n$ mkdir app \u0026\u0026 cd $_\n$ yo material-app\n$ gulp build\n$ npm start\n```\nWill generate something like this:\n![User creation](https://michaelkrone.github.io/generator-material-app/screenshots/users-create.png)\nCreate user dialog\n\nNavigate to [http://localhost:9001](http://localhost:9001) to see the generated application where you can administer the users of your application\n\n### Add API\nThis will add a server API and a corresponding client route to manage your cats including test stubs and documentation:\n```bash\n$ yo material-app:api cat\n$ yo material-app:apiroute cat\n$ gulp build\n$ npm start\n```\n\n### Generate Documentation\nThe documentation is by now generated for server side code only:\n```bash\ngulp jsdoc\n```\n\n### Run Tests\nFor running the generated test start the following gulp tasks\n```bash\ngulp unit:server\ngulp unit:client\n```\n\n### Deploy\nFor now, run commands:\n\n```\nNODE_ENV=production gulp build\nNODE_ENV=production npm start\n```\nAnd manually seed database with `NODE_ENV=production npm run seed` if you choosed to auth your app.\nYou can't sign into app without any users. You can specify users and seed data in `server/config/seed.js`.\n\n#### Environment Variables\n- DATABASE_NAME\n- MONGO_URI || 'mongodb://localhost/' + process.env.DATABASE_NAME\n- MONGO_OPTIONS\n\n### ModelDefinition\nModefy factory YourResourceDefinition in your-resource.service.js.\nFor example:\n```\nModelDefinitions({\n  name: {type: 'text', required: true},\n  info: 'text',\n  nested: {\n    name: {\n      type: 'text',\n      desc: 'Nested Name'\n    }\n  }\n})\n```\nFor detail [options](#PropDefintion).\n\n\n## List of Generators\n* Application scaffold\n    - [`material-app`](#app) (alias for `material-app:app`) - The directory name will be used as the application name\n\n* Server API\n    - [`material-app:api`](#api) - Pass the name of the API items as an argument\n    \n* Client Generators\n    - [`material-app:apiroute`](#apiroute) - Pass the name of the route as an argument\n    - [`material-app:decorator`](#decorator) - Pass the name of the decorator as an argument\n    - [`material-app:directive`](#directive) - Pass the name of the directive as an argument\n    - [`material-app:route`](#route) - Pass the name of the route as an argument\n    - [`material-app:controller`](#controller) - Pass the name of the controller as an argument\n    - [`material-app:filter`](#filter) - Pass the name of the filter as an argument\n    - [`material-app:service`](#service) - Pass the name of the service as an argument\n    - [`material-app:provider`](#provider) - Pass the name of the provider as an argument\n    - [`material-app:factory`](#factory) - Pass the name of the factory as an argument\n\n## APIs\n### PropDefintion\n- types supported now:\n  - **types for input**(corresponding Mongoose type in `()`), like `'text'`(`String`), `'url'`(`String`), `'number'`(`Number`), `'date'`(`Date`), `'password'`(`String`),\n  - `'select'` - type values in options array correspond to mongoose type\n  - `'select/resource'` - mongoose `ObjectId`, use `resource` to simulate mongoose `ref`\n- common options\n  - type - different types of property\n    Notice: `name: {type: 'text'}` can be short in `name: 'text'` but `type: {type: 'text'}` can't\n  - desc - name of prop displayed in form, detail and list\n    - default is capitalized last name of nested name\n  - displayKey - key to display in `md-select`\n    - default is 'name' when `type === 'select/resource'`\n  - displayPriority - when set to `'low'`, field in list will auto-hide when\n    1. when screen width is less than 1200 because of css class `.hide-in-narrow`\n    2. `narrowMode` in ModelViewGroup is true\n- validation options\n  - required - `ng-required`\n  - format - regex for `ng-validate`\n  - remoteUnique - resource name to check unique from server\n  - repeatInput - force repeat field, usually for `type=password`\n  - validators - for `ng-messages`, above validations can be written in `validators` uniformly\n    - required\n    - pattern\n    - remote-unique\n    - repeat-input\n- special config options for `'select'`\n  - options - static options for select\n  - valueKey - key to value in `md-select`\n      - default is '_id' when `type === 'select/resource'`\n\n  - resource - static resource for `'select/resource'`\n    - only work when `type === ''`\n  - params - static params for `'select/resource'`\n  - getOptions - async function returns a promise to load options upon `md-select` is open, resource and params can be dynamic with this\n\nBelow is an example with all options, which can be generated into app with the demo option\n```\nvar typeMap = {\n  User: User,\n  ClientModelDoc: ClientModelDoc\n};\n\nreturn ModelDefinitions({\n  name: {\n    type: 'text',\n    format: {\n      value: /^[a-zA-Z]{6,18}$/,\n      error: 'Should be 6-18 letters.'\n    },\n    required: true,\n    remoteUnique: 'ClientModelDoc'\n  },\n  repeatName: {\n    type: 'text',\n    repeatInput: 'name',\n    desc: 'Repeat Name',\n    displayPriority: 'low'\n  },\n  wholeName: {\n    type: 'text',\n    validators: {\n      required: true,\n      'remote-unique': {\n        value: 'ClientModelDoc',\n        error: 'Override default error'\n      },\n      pattern: /^[a-zA-Z0-9]{8,12}$/\n    }\n  },\n  user: {\n    type: 'select/resource',\n    required: true,\n    resource: User\n  },\n  rootUser: {\n    type: 'select/resource',\n    resource: User,\n    params: {\n      role: 'root'\n    },\n    displayKey: '_id'\n  },\n  anyType: {\n    type: 'select',\n    options: ['User', 'ClientModelDoc']\n  },\n  anyTypeRef: {\n    type: 'select',\n    getOptions: function(model) {\n      var resource = typeMap[model.anyType];\n      if (!resource || !resource.query) return $q.when([]);\n      return resource.query().$promise;\n    },\n    displayKey: 'name',\n    valueKey: '_id'\n  },\n  important: 'text',\n  notImportant: {\n    type: 'text',\n    desc: 'Not Important',\n    displayPriority: 'low'\n  },\n  nested: {\n    name: 'text',\n    repeatName: {\n      type: 'text',\n      repeatInput: 'nested.name',\n      desc: 'Nested Repeat Name',\n      displayPriority: 'low'\n    },\n    wholeName: {\n      type: 'text',\n      desc: 'Whole Name',\n      remoteUnique: 'ClientModelDoc',\n      auto: function (nestedModel) {\n        return nestedModel.nested.firstName + ' ' + nestedModel.nested.secondName;\n      }\n    },\n    firstName: {\n      type: 'text',\n      desc: 'First Name',\n      displayPriority: 'low'\n    },\n    secondName: {\n      type: 'text',\n      desc: 'Second Name',\n      displayPriority: 'low'\n    },\n  },\n  info: 'text',\n  //active: 'boolean'\n})\n```\n\n\n## Purpose\nThis generator is suited for prototyping simple CRUD applications. The generated code is somehow following  [John Papa's Styleguide](https://github.com/johnpapa/angular-styleguide) for Angular applications. Every generator generates a test stub\nfor easily adding tests to your application. Note that there is not much material design in the layout yet, despite the use of \nthe [Angular Material Design](https://material.angularjs.org/#) components.\n\n## Used Technologies\n\n * Node.js\n * MongoDB\n * Express\n * mongoose\n * socket.io\n * Angular.js\n * ui.router\n * SASS\n * Gulp\n \n## Screenshots\n \n![User password](https://michaelkrone.github.io/generator-material-app/screenshots/users-password.png)\nSet password dialog\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelkrone%2Fgenerator-material-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelkrone%2Fgenerator-material-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelkrone%2Fgenerator-material-app/lists"}