From f8edd307bff1c99d9151daa8f4f804e01264105c Mon Sep 17 00:00:00 2001 From: Aabid Date: Wed, 26 Jan 2022 02:30:04 +0530 Subject: [PATCH 1/8] added dasboard vue --- apps/frontend/admin/package.json | 7 +- .../admin/src/components/AppSideBar.vue | 85 ++++++-- .../admin/src/components/HomeBestSellers.vue | 79 +++++++ .../admin/src/components/HomeRecentOrders.vue | 55 +++++ .../admin/src/components/SalesSummary.vue | 99 +++++++++ .../admin/src/components/SalesTodayCard.vue | 24 +++ .../admin/src/components/TheNavBar.vue | 39 ++-- .../admin/src/composables/useNavdrawer.js | 16 ++ apps/frontend/admin/src/css/_apply.sass | 7 + apps/frontend/admin/src/css/app.sass | 18 ++ apps/frontend/admin/src/css/apply/_alert.sass | 41 ++++ apps/frontend/admin/src/css/apply/_badge.sass | 6 + .../frontend/admin/src/css/apply/_button.sass | 69 ++++++ apps/frontend/admin/src/css/apply/_card.sass | 8 + apps/frontend/admin/src/css/apply/_code.sass | 20 ++ apps/frontend/admin/src/css/apply/_link.sass | 3 + .../admin/src/css/apply/_typography.sass | 24 +++ .../frontend/admin/src/css/external/prism.css | 201 ++++++++++++++++++ .../admin/src/css/index/_report-card.sass | 9 + .../admin/src/layouts/WithSideBar.vue | 15 +- apps/frontend/admin/src/main.js | 9 +- .../frontend/admin/src/plugins/fontAwesome.js | 43 ++++ apps/frontend/admin/src/views/dashboard.vue | 17 +- apps/frontend/admin/tailwind.config.js | 9 + apps/frontend/store-front/_package.json | 19 ++ apps/frontend/store-front/package.json | 73 ++++++- apps/frontend/store-front/vue.config.js | 9 + yarn.lock | 56 ++++- 28 files changed, 1005 insertions(+), 55 deletions(-) create mode 100644 apps/frontend/admin/src/components/HomeBestSellers.vue create mode 100644 apps/frontend/admin/src/components/HomeRecentOrders.vue create mode 100644 apps/frontend/admin/src/components/SalesSummary.vue create mode 100644 apps/frontend/admin/src/components/SalesTodayCard.vue create mode 100644 apps/frontend/admin/src/composables/useNavdrawer.js create mode 100644 apps/frontend/admin/src/css/_apply.sass create mode 100644 apps/frontend/admin/src/css/app.sass create mode 100644 apps/frontend/admin/src/css/apply/_alert.sass create mode 100644 apps/frontend/admin/src/css/apply/_badge.sass create mode 100644 apps/frontend/admin/src/css/apply/_button.sass create mode 100644 apps/frontend/admin/src/css/apply/_card.sass create mode 100644 apps/frontend/admin/src/css/apply/_code.sass create mode 100644 apps/frontend/admin/src/css/apply/_link.sass create mode 100644 apps/frontend/admin/src/css/apply/_typography.sass create mode 100644 apps/frontend/admin/src/css/external/prism.css create mode 100644 apps/frontend/admin/src/css/index/_report-card.sass create mode 100644 apps/frontend/admin/src/plugins/fontAwesome.js create mode 100644 apps/frontend/store-front/_package.json create mode 100644 apps/frontend/store-front/vue.config.js diff --git a/apps/frontend/admin/package.json b/apps/frontend/admin/package.json index c51c9dd..deda4e6 100644 --- a/apps/frontend/admin/package.json +++ b/apps/frontend/admin/package.json @@ -8,11 +8,16 @@ "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src" }, "dependencies": { + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/vue-fontawesome": "^3.0.0-5", "graphql-config": "*", "router": "^2.0.0-beta.1", "utils": "*", "vue": "^3.2.25", - "vue-awesome": "^4.5.0", + + "vue-chart-3": "^3.0.9", + "chart.js":"^3.0.0", "vue-router": "4", "vuex": "4" }, diff --git a/apps/frontend/admin/src/components/AppSideBar.vue b/apps/frontend/admin/src/components/AppSideBar.vue index cdd8d5f..6202012 100644 --- a/apps/frontend/admin/src/components/AppSideBar.vue +++ b/apps/frontend/admin/src/components/AppSideBar.vue @@ -1,17 +1,78 @@ + + + + diff --git a/apps/frontend/admin/src/components/HomeBestSellers.vue b/apps/frontend/admin/src/components/HomeBestSellers.vue new file mode 100644 index 0000000..94ecb37 --- /dev/null +++ b/apps/frontend/admin/src/components/HomeBestSellers.vue @@ -0,0 +1,79 @@ + diff --git a/apps/frontend/admin/src/components/HomeRecentOrders.vue b/apps/frontend/admin/src/components/HomeRecentOrders.vue new file mode 100644 index 0000000..40fc83f --- /dev/null +++ b/apps/frontend/admin/src/components/HomeRecentOrders.vue @@ -0,0 +1,55 @@ + diff --git a/apps/frontend/admin/src/components/SalesSummary.vue b/apps/frontend/admin/src/components/SalesSummary.vue new file mode 100644 index 0000000..9b3fc41 --- /dev/null +++ b/apps/frontend/admin/src/components/SalesSummary.vue @@ -0,0 +1,99 @@ + + + diff --git a/apps/frontend/admin/src/components/SalesTodayCard.vue b/apps/frontend/admin/src/components/SalesTodayCard.vue new file mode 100644 index 0000000..e4b4fb7 --- /dev/null +++ b/apps/frontend/admin/src/components/SalesTodayCard.vue @@ -0,0 +1,24 @@ + diff --git a/apps/frontend/admin/src/components/TheNavBar.vue b/apps/frontend/admin/src/components/TheNavBar.vue index 5048a73..6dd7ee0 100644 --- a/apps/frontend/admin/src/components/TheNavBar.vue +++ b/apps/frontend/admin/src/components/TheNavBar.vue @@ -1,23 +1,26 @@ - + + + diff --git a/apps/frontend/admin/src/composables/useNavdrawer.js b/apps/frontend/admin/src/composables/useNavdrawer.js new file mode 100644 index 0000000..83121d8 --- /dev/null +++ b/apps/frontend/admin/src/composables/useNavdrawer.js @@ -0,0 +1,16 @@ +import { ref, computed } from 'vue' + +const open = ref(false) + +export default () => { + const isDrawerOpen = computed(() => { + return open.value + }) + function toggleDrawer() { + console.log('toggke', open.value) + open.value = !open.value + console.log('toggke', open.value) + } + + return { isDrawerOpen, toggleDrawer, open } +} diff --git a/apps/frontend/admin/src/css/_apply.sass b/apps/frontend/admin/src/css/_apply.sass new file mode 100644 index 0000000..9e549ab --- /dev/null +++ b/apps/frontend/admin/src/css/_apply.sass @@ -0,0 +1,7 @@ +@import "apply/_typography" +@import "apply/_card" +@import "apply/_button" +@import "apply/code" +@import "apply/_badge" +@import "apply/_alert" +@import "apply/_link" \ No newline at end of file diff --git a/apps/frontend/admin/src/css/app.sass b/apps/frontend/admin/src/css/app.sass new file mode 100644 index 0000000..6cda810 --- /dev/null +++ b/apps/frontend/admin/src/css/app.sass @@ -0,0 +1,18 @@ +@tailwind base +@tailwind components + +// font imports +@import url('https://fonts.googleapis.com/css?family=Ubuntu&display=swap') + + +// external +@import "./external/prism" + +// apply +@import "apply" + +// index +@import "index/report-card" + + +@tailwind utilities diff --git a/apps/frontend/admin/src/css/apply/_alert.sass b/apps/frontend/admin/src/css/apply/_alert.sass new file mode 100644 index 0000000..36a12e9 --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_alert.sass @@ -0,0 +1,41 @@ +.alert + @apply border rounded bg-white py-4 px-6 text-sm + a + @apply font-extrabold text-black text-base transition ease-in-out duration-300 + &:hover + @apply opacity-75 + +.alert-default + @apply bg-teal-100 border-teal-200 text-teal-500 + a + @apply text-teal-700 + +.alert-light + @apply bg-gray-100 border-gray-300 text-gray-600 + a + @apply text-gray-700 + +.alert-dark + @apply bg-gray-700 border-gray-900 text-white + a + @apply text-gray-500 + +.alert-success + @apply bg-green-200 border-green-300 text-green-500 + a + @apply text-green-700 + +.alert-error + @apply bg-red-200 border-red-300 text-red-500 + a + @apply text-red-700 + + +.alert-close + @apply flex flex-row-reverse + button.alert-btn-close + @apply transition ease-in-out duration-300 + &:hover + @apply opacity-75 + span + @apply flex-1 \ No newline at end of file diff --git a/apps/frontend/admin/src/css/apply/_badge.sass b/apps/frontend/admin/src/css/apply/_badge.sass new file mode 100644 index 0000000..26d3cf8 --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_badge.sass @@ -0,0 +1,6 @@ +.badge + padding: 2px 0 + @apply px-2 + +.badge-primary + @apply bg-teal-200 border border-teal-300 text-teal-600 rounded lowercase \ No newline at end of file diff --git a/apps/frontend/admin/src/css/apply/_button.sass b/apps/frontend/admin/src/css/apply/_button.sass new file mode 100644 index 0000000..9a73a18 --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_button.sass @@ -0,0 +1,69 @@ +.btn-shadow + @apply text-center capitalize bg-teal-400 block py-2 px-5 rounded text-white transition-all ease-in-out duration-300 shadow-md + &:hover + @apply shadow-lg + +.btn + @apply text-center capitalize bg-teal-200 block py-2 px-5 rounded text-teal-600 transition-all ease-in-out duration-300 + &:hover + @apply bg-teal-300 text-teal-800 + +.btn-indigo + @apply text-center capitalize bg-indigo-500 text-indigo-100 block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply bg-indigo-600 text-indigo-200 + +.btn-info + @apply text-center capitalize bg-yellow-300 text-yellow-600 block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply bg-yellow-400 text-yellow-600 + +.btn-danger + @apply text-center capitalize bg-red-300 text-red-600 block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply bg-red-400 text-red-600 + + +.btn-gray + @apply text-center capitalize bg-gray-100 border border-gray-300 block py-2 px-5 rounded text-gray-600 transition-all ease-in-out duration-300 + &:hover + @apply bg-white text-gray-800 border border-gray-300 + + + +.btn-bs-dark + @apply text-center capitalize bg-gray-900 text-white block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply opacity-75 + +.btn-bs-primary + @apply text-center capitalize bg-indigo-600 text-white block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply opacity-75 + +.btn-bs-secondary + @apply text-center capitalize bg-gray-500 text-white block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply opacity-75 + +.btn-bs-success + @apply text-center capitalize bg-green-500 text-white block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply opacity-75 + +.btn-bs-danger + @apply text-center capitalize bg-red-500 text-white block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply opacity-75 + +.btn-bs-info + @apply text-center capitalize bg-yellow-500 text-white block py-2 px-5 rounded transition-all ease-in-out duration-300 + &:hover + @apply opacity-75 + + + +// overflow +.menu-overflow + &:focus + outline: none \ No newline at end of file diff --git a/apps/frontend/admin/src/css/apply/_card.sass b/apps/frontend/admin/src/css/apply/_card.sass new file mode 100644 index 0000000..fe625c8 --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_card.sass @@ -0,0 +1,8 @@ +.card + @apply rounded bg-white border border-gray-300 + .card-header + @apply border-b p-6 + .card-body + @apply p-6 + .card-footer + @apply border-t p-6 \ No newline at end of file diff --git a/apps/frontend/admin/src/css/apply/_code.sass b/apps/frontend/admin/src/css/apply/_code.sass new file mode 100644 index 0000000..3389c4b --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_code.sass @@ -0,0 +1,20 @@ +code[class*="language-"], +pre[class*="language-"] + border-radius: 5px + text-transform: lowercase + + +div.code-toolbar + .toolbar + opacity: 1 !important + button + transition: all 0.2s !important + padding: 10px 20px !important + border-radius: 4px !important + background: transparent !important + box-shadow: 0 0 0 !important + letter-spacing: 1px !important + font-weight: 900 !important + &:hover + background-color: #fff !important + \ No newline at end of file diff --git a/apps/frontend/admin/src/css/apply/_link.sass b/apps/frontend/admin/src/css/apply/_link.sass new file mode 100644 index 0000000..177402d --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_link.sass @@ -0,0 +1,3 @@ +.nav-link + + @apply hover:text-gray-800 active:text-green-800 hover:bg-white flex items-center p-2 my-2 transition-colors dark:hover:text-white dark:hover:bg-gray-600 duration-200 text-gray-600 dark:text-gray-400 rounded-lg diff --git a/apps/frontend/admin/src/css/apply/_typography.sass b/apps/frontend/admin/src/css/apply/_typography.sass new file mode 100644 index 0000000..cda942d --- /dev/null +++ b/apps/frontend/admin/src/css/apply/_typography.sass @@ -0,0 +1,24 @@ +body,h1,h2,h3,h4,h5,h6,p,a + @apply capitalize + +p + @apply tracking-wider text-sm text-gray-500 + + +.h1 + @apply text-6xl font-black + +.h2 + @apply text-5xl font-extrabold + +.h3 + @apply text-4xl font-extrabold + +.h4 + @apply text-3xl font-extrabold + +.h5 + @apply text-2xl font-extrabold + +.h6 + @apply text-xl font-extrabold \ No newline at end of file diff --git a/apps/frontend/admin/src/css/external/prism.css b/apps/frontend/admin/src/css/external/prism.css new file mode 100644 index 0000000..b61a827 --- /dev/null +++ b/apps/frontend/admin/src/css/external/prism.css @@ -0,0 +1,201 @@ +/* PrismJS 1.19.0 +https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+http+javadoclike+json+jsonp+json5+markup-templating+php+phpdoc+plsql+python+sass+scss+sql&plugins=unescaped-markup+normalize-whitespace+toolbar+copy-to-clipboard */ +/** + * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML + * Based on https://github.com/chriskempson/tomorrow-theme + * @author Rose Pritchard + */ + +code[class*="language-"], +pre[class*="language-"] { + color: #ccc; + background: none; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #2d2d2d; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.block-comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #999; +} + +.token.punctuation { + color: #ccc; +} + +.token.tag, +.token.attr-name, +.token.namespace, +.token.deleted { + color: #e2777a; +} + +.token.function-name { + color: #6196cc; +} + +.token.boolean, +.token.number, +.token.function { + color: #f08d49; +} + +.token.property, +.token.class-name, +.token.constant, +.token.symbol { + color: #f8c555; +} + +.token.selector, +.token.important, +.token.atrule, +.token.keyword, +.token.builtin { + color: #cc99cd; +} + +.token.string, +.token.char, +.token.attr-value, +.token.regex, +.token.variable { + color: #7ec699; +} + +.token.operator, +.token.entity, +.token.url { + color: #67cdcc; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.token.inserted { + color: green; +} + +/* Fallback, in case JS does not run, to ensure the code is at least visible */ +[class*='lang-'] script[type='text/plain'], +[class*='language-'] script[type='text/plain'], +script[type='text/plain'][class*='lang-'], +script[type='text/plain'][class*='language-'] { + display: block; + font: 100% Consolas, Monaco, monospace; + white-space: pre; + overflow: auto; +} + +div.code-toolbar { + position: relative; +} + +div.code-toolbar > .toolbar { + position: absolute; + top: .3em; + right: .2em; + transition: opacity 0.3s ease-in-out; + opacity: 0; +} + +div.code-toolbar:hover > .toolbar { + opacity: 1; +} + +/* Separate line b/c rules are thrown out if selector is invalid. + IE11 and old Edge versions don't support :focus-within. */ +div.code-toolbar:focus-within > .toolbar { + opacity: 1; +} + +div.code-toolbar > .toolbar .toolbar-item { + display: inline-block; +} + +div.code-toolbar > .toolbar a { + cursor: pointer; +} + +div.code-toolbar > .toolbar button { + background: none; + border: 0; + color: inherit; + font: inherit; + line-height: normal; + overflow: visible; + padding: 0; + -webkit-user-select: none; /* for button */ + -moz-user-select: none; + -ms-user-select: none; +} + +div.code-toolbar > .toolbar a, +div.code-toolbar > .toolbar button, +div.code-toolbar > .toolbar span { + color: #bbb; + font-size: .8em; + padding: 0 .5em; + background: #f5f2f0; + background: rgba(224, 224, 224, 0.2); + box-shadow: 0 2px 0 0 rgba(0,0,0,0.2); + border-radius: .5em; +} + +div.code-toolbar > .toolbar a:hover, +div.code-toolbar > .toolbar a:focus, +div.code-toolbar > .toolbar button:hover, +div.code-toolbar > .toolbar button:focus, +div.code-toolbar > .toolbar span:hover, +div.code-toolbar > .toolbar span:focus { + color: inherit; + text-decoration: none; +} + diff --git a/apps/frontend/admin/src/css/index/_report-card.sass b/apps/frontend/admin/src/css/index/_report-card.sass new file mode 100644 index 0000000..de04d7e --- /dev/null +++ b/apps/frontend/admin/src/css/index/_report-card.sass @@ -0,0 +1,9 @@ +.report-card + &:hover + .card + @apply shadow-lg border-white + transform: scale(1.01) + .footer + @apply p-0 border-0 + .footer , .card + @apply transition-all ease-in-out duration-300 diff --git a/apps/frontend/admin/src/layouts/WithSideBar.vue b/apps/frontend/admin/src/layouts/WithSideBar.vue index cd747fc..9cc5990 100644 --- a/apps/frontend/admin/src/layouts/WithSideBar.vue +++ b/apps/frontend/admin/src/layouts/WithSideBar.vue @@ -1,18 +1,16 @@