{"id":13937918,"url":"https://github.com/zmts/beauty-vuejs-boilerplate","last_synced_at":"2025-04-12T20:42:04.487Z","repository":{"id":15916229,"uuid":"78978702","full_name":"zmts/beauty-vuejs-boilerplate","owner":"zmts","description":"❤️ Real world base Vue.js app. Access/refresh tokens auth, api services, http client, vuex modules","archived":false,"fork":false,"pushed_at":"2023-03-04T02:36:17.000Z","size":4099,"stargazers_count":858,"open_issues_count":12,"forks_count":210,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-04-14T13:15:41.437Z","etag":null,"topics":["access-token","api","boilerplate","data-access-layer","enterprise","flux","http-wrapper","jwt","realworld","refresh-token","spa","vue-boilerplate","vuejs","vuex"],"latest_commit_sha":null,"homepage":"","language":"Vue","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/zmts.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-14T23:57:56.000Z","updated_at":"2024-05-02T23:05:14.343Z","dependencies_parsed_at":"2024-05-02T23:04:15.115Z","dependency_job_id":"fcf93c67-77a0-43cb-819d-b8cea8110817","html_url":"https://github.com/zmts/beauty-vuejs-boilerplate","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/zmts%2Fbeauty-vuejs-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmts%2Fbeauty-vuejs-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmts%2Fbeauty-vuejs-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmts%2Fbeauty-vuejs-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmts","download_url":"https://codeload.github.com/zmts/beauty-vuejs-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631668,"owners_count":21136554,"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":["access-token","api","boilerplate","data-access-layer","enterprise","flux","http-wrapper","jwt","realworld","refresh-token","spa","vue-boilerplate","vuejs","vuex"],"created_at":"2024-08-07T23:04:06.314Z","updated_at":"2025-04-12T20:42:04.462Z","avatar_url":"https://github.com/zmts.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# Real World Vue.js Boilerplate\nThis project based on real world practice and ready to use. Have a fun!\n\n## Features\n- Http request class that implements API calls with Auth and tokens refresh based on Axios\n- Data access layer/API calls\n- Response wrapper/Response error wrapper\n- Base common and layout components\n- Some help mixins\n- Vue CLI v4\n- Developed to work with: https://github.com/zmts/supra-api-nodejs\n\n## Project structure\n- [`src`](#src)\n  - [`assets`](#assets)\n  - [`components`](#components)\n  - [`config`](#config)\n  - [`directives`](#directives)\n  - [`layout`](#layout)\n  - [`mixins`](#mixins)\n  - [`pages`](#pages)\n  - [`plugins`](#plugins)\n  - [`router`](#router)\n  - [`scss`](#scss)\n  - [`services`](#services)\n  - [`store`](#store)\n  - [`.env.js`](#envjs)\n  - [`main.js`](#mainjs)\n\n### `src`\nSource =)\n\n### `assets`\nImages/Fonts/Other media stuff.\n\n### `components`\nShared components folder.\n- `DataBox` wrap in this component any received data. It represents loading(spinloader animation), error and empty statuses (examaple in `src/pages/News.vue`).\n- `UiImgLoader` - `img` tag wrapper. Shows image loading(pulseloader animation) status and animate onloading as option.\n- `UiModal` - simple modal window.\n- `PulseLoading` and `SpinnerWave` - loading animation.\n- `UiUploadMulti` and `UiUploadSingle` - file upload example components.\n- ...\n\n### `config`\nApp config files. Each category in separate file.\n\n### `directives`\n- Handy debounce directive\n\n### `layout`\nBase app layout components.\n- `Header`, `Footer` components and main layout wrapper.\n\n### `mixins`\n- One method/prop per file principle.\n- Name files same as method/prop.\n- `currentUser` - Includes current user object from store. Global.\n- `formatDateTime` - Datetime moment formatters. Global.\n- `jumpTo` - Help jump to some DOM element. Global.\n- `prepareFetchParamsMixin` - Prepare params for data fetching (examaple in `src/pages/News.vue`).\n- `prepareQueryParamsMixin` - Prepare params for setting it in URL (examaple in `src/pages/News.vue`).\n- `setModelMixin` - Use to set same fields from response that declared in front-end model.\n\n### `pages`\nPage wrapper components(Pages) and Local components.\n\n### `plugins`\n- `globalEventBus` - $bus.\n\n### `router`\nRouter instance and routing declaration.\n- `index` - router initialization.\n- `routes` - routing.\n- `middlewares`:\n  - `initCurrentUserStateMiddleware` - Current user state initialization (each time app loads, check refresh token and fetch current user if token exist.)\n  - `checkAccessMiddleware` - Each time user change route, check permissions to route.\n  - `setPageTitleMiddleware` - Each time user change route, set page title.\n- `util`:\n  - `routePropResolver` - Pass params from URL to component as props (example in `src/router/routes.js`)\n\n### `scss`\nStyle files(partials, variables, mixins, reset).\n\n### `services`\nData access layer/API calls.\n- ES6 API calls classes.\n- API calls must be represented in separate classes (not in vuex action).\n- `auth.service` - Auth methods and API calls.\n- `http.init` - Http request class.\n- `util`:\n  - `ResponseWrapper` - Represent response object.\n  - `ErrorWrapper` - Represent error object.\n  - `clearData` - Uses to clear request data before send it. Helper.\n\n### `store`\nApp store with separate modules.\n\n### `.env.js`\nEnvironment variables (add this to git ignore).\n\n### `main.js`\nRoot app initialization file.\n\n### How to declare global SCSS variables/mixins etc... ?\nIn `/build/utils.js` \u003e\u003e `generateLoaders('sass')`\n\n## Utils/Helpers\n\n### What about debounce ?\n```\nimport debounce from '../directives/debounce'\ndirectives: {\n  debounce\n}\n```\nAnd use it in a template.\n```\n\u003cinput type=\"text\" v-model=\"name\" v-debounce=\"500\" @debounce-change=\"runSomeMethod\"\u003e\n```\n\n### Notifications/Toast:\nJust make mutation\n```\ncommit('dom/TOAST', { message: 'hello', duration: 2000, type: 'success' })\n```\n\n### Icons/SVG:\nSet up yours svg icons in `src/components/icons/` folder. Modify `UiIconBase.vue` related to yours newly added icons and use it in template.\n```\n\u003cUiIconBase size=\"40\" color=\"yellow\" icon=\"write\"/\u003e\n```\n\n## Build Setup\n``` bash\n# clone repo\ngit clone https://github.com/zmts/vuejs-boilerplate.git\n\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:8080\nnpm run serve\n\n# build for production with minification\nnpm run build\n```\n\nFor a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).\n\n# Amazing repos where I found some great approaches:\n- https://github.com/sdras/vue-sample-svg-icons\n- https://github.com/MillerRen/vue-boilerplate\n- https://github.com/vuejs-tips/v-debounce\n\n__!!! Project still in progress !!!__\n\n_2017 - 2018 - 2019 - 2020 ..._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmts%2Fbeauty-vuejs-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmts%2Fbeauty-vuejs-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmts%2Fbeauty-vuejs-boilerplate/lists"}