From 7535f0f5001bb38c1e06fdd3d58f8a3e2ec2a4e8 Mon Sep 17 00:00:00 2001 From: Marcelo Lotif Date: Thu, 15 Feb 2024 15:09:28 -0500 Subject: [PATCH] Kickstart the repo with the template code (#3) Applying the template to a Next.js+FastAPI application. Using the template app from https://github.com/digitros/nextjs-fastapi --- .eslintrc.json | 3 + .flake8 | 3 + .gitignore | 36 + assets/img/apple-icon.png | Bin 809 -> 0 bytes assets/img/favicon.png | Bin 809 -> 0 bytes assets/js/plugins/perfect-scrollbar.min.js | 19 - assets/js/plugins/smooth-scrollbar.min.js | 25 - florist/api/index.py | 8 + .../app/assets}/css/material-dashboard.css | 0 .../app/assets}/css/nucleo-icons.css | 0 .../app/assets}/css/nucleo-svg.css | 0 florist/app/assets/fonts/nucleo-icons.eot | Bin 0 -> 18516 bytes florist/app/assets/fonts/nucleo-icons.svg | 312 + florist/app/assets/fonts/nucleo-icons.ttf | Bin 0 -> 18292 bytes florist/app/assets/fonts/nucleo-icons.woff | Bin 0 -> 10220 bytes florist/app/assets/fonts/nucleo-icons.woff2 | Bin 0 -> 8580 bytes florist/app/assets/fonts/nucleo.eot | Bin 0 -> 26524 bytes florist/app/assets/fonts/nucleo.ttf | Bin 0 -> 26364 bytes florist/app/assets/fonts/nucleo.woff | Bin 0 -> 15168 bytes florist/app/assets/fonts/nucleo.woff2 | Bin 0 -> 12616 bytes .../app/assets}/img/logo-ct.png | Bin .../app/assets}/js/core/bootstrap.min.js | 0 .../app/assets}/js/core/popper.min.js | 0 .../app/assets}/js/material-dashboard.min.js | 0 florist/app/client_imports.tsx | 15 + florist/app/layout.tsx | 103 + florist/app/page.tsx | 7 + florist/app/sidebar.tsx | 31 + index.html | 122 - mypy.ini | 11 + next.config.js | 30 + package-lock.json | 7467 +++++++++++++++++ package.json | 30 + poetry.lock | 515 +- postcss.config.js | 6 + pyproject.toml | 2 + tailwind.config.js | 18 + tsconfig.json | 28 + yarn.lock | 2706 ++++++ 39 files changed, 11330 insertions(+), 167 deletions(-) create mode 100644 .eslintrc.json create mode 100644 .flake8 delete mode 100644 assets/img/apple-icon.png delete mode 100644 assets/img/favicon.png delete mode 100644 assets/js/plugins/perfect-scrollbar.min.js delete mode 100644 assets/js/plugins/smooth-scrollbar.min.js create mode 100644 florist/api/index.py rename {assets => florist/app/assets}/css/material-dashboard.css (100%) rename {assets => florist/app/assets}/css/nucleo-icons.css (100%) rename {assets => florist/app/assets}/css/nucleo-svg.css (100%) create mode 100644 florist/app/assets/fonts/nucleo-icons.eot create mode 100644 florist/app/assets/fonts/nucleo-icons.svg create mode 100644 florist/app/assets/fonts/nucleo-icons.ttf create mode 100644 florist/app/assets/fonts/nucleo-icons.woff create mode 100644 florist/app/assets/fonts/nucleo-icons.woff2 create mode 100644 florist/app/assets/fonts/nucleo.eot create mode 100644 florist/app/assets/fonts/nucleo.ttf create mode 100644 florist/app/assets/fonts/nucleo.woff create mode 100644 florist/app/assets/fonts/nucleo.woff2 rename {assets => florist/app/assets}/img/logo-ct.png (100%) rename {assets => florist/app/assets}/js/core/bootstrap.min.js (100%) rename {assets => florist/app/assets}/js/core/popper.min.js (100%) rename {assets => florist/app/assets}/js/material-dashboard.min.js (100%) create mode 100644 florist/app/client_imports.tsx create mode 100644 florist/app/layout.tsx create mode 100644 florist/app/page.tsx create mode 100644 florist/app/sidebar.tsx delete mode 100644 index.html create mode 100644 mypy.ini create mode 100644 next.config.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 postcss.config.js create mode 100644 tailwind.config.js create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..06945f4 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 119 +ignore = E203, W503 diff --git a/.gitignore b/.gitignore index a0b56cf..a56e7ee 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,39 @@ dmypy.json # pycharm .idea/ + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/florist/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts +/florist/tsconfig.json diff --git a/assets/img/apple-icon.png b/assets/img/apple-icon.png deleted file mode 100644 index 08664e1f59a0889ed699c4c010b5bf56875d8593..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 809 zcmV+^1J?YBP)Px%<4Ht8R9FecS37GeK@>hd3I&^_@)9A1RVo|7$}&|@LPWzYVjwAE>7$KZy7&XM z69N$nlR|BSU}YB@tx^PT5(FcOf;kq_?*>ZevW0JuRx&P$q`fX0s_>Zm+GasbX?q zeO9uA&6#N+YkmD0n*1J`!DE!3(AR4Ns| znLa;1Cxx9(hgz)``Tc&fS~Z^T2uxz!nBEk#{Ojv$ zzJXp}UuUI-7;3QD*eff<=Q%6i1BM8^yu7GR#D2doF71MzAp*f*kdBX!>HYnk>(S8> z?e6X_2q~6n?gu~;Px%<4Ht8R9FecS37GeK@>hd3I&^_@)9A1RVo|7$}&|@LPWzYVjwAE>7$KZy7&XM z69N$nlR|BSU}YB@tx^PT5(FcOf;kq_?*>ZevW0JuRx&P$q`fX0s_>Zm+GasbX?q zeO9uA&6#N+YkmD0n*1J`!DE!3(AR4Ns| znLa;1Cxx9(hgz)``Tc&fS~Z^T2uxz!nBEk#{Ojv$ zzJXp}UuUI-7;3QD*eff<=Q%6i1BM8^yu7GR#D2doF71MzAp*f*kdBX!>HYnk>(S8> z?e6X_2q~6n?gu~;n[h]&&(a.reach[i]="start"),n[h]>a[f]-a[g]-1&&(a.reach[i]="end"),b&&(n.dispatchEvent(k("ps-scroll-"+i)),0>b?n.dispatchEvent(k("ps-scroll-"+l)):0=a.railXWidth-a.scrollbarXWidth&&(a.scrollbarXLeft=a.railXWidth-a.scrollbarXWidth),a.scrollbarYTop>=a.railYHeight-a.scrollbarYHeight&&(a.scrollbarYTop=a.railYHeight-a.scrollbarYHeight),s(c,a),a.scrollbarXActive?c.classList.add(z.state.active("x")):(c.classList.remove(z.state.active("x")),a.scrollbarXWidth=0,a.scrollbarXLeft=0,c.scrollLeft=!0===a.isRtl?a.contentWidth:0),a.scrollbarYActive?c.classList.add(z.state.active("y")):(c.classList.remove(z.state.active("y")),a.scrollbarYHeight=0,a.scrollbarYTop=0,c.scrollTop=0)}function r(a,b){var c=Math.min,d=Math.max;return a.settings.minScrollbarLength&&(b=d(b,a.settings.minScrollbarLength)),a.settings.maxScrollbarLength&&(b=c(b,a.settings.maxScrollbarLength)),b}function s(a,c){var d={width:c.railXWidth},e=v(a.scrollTop);d.left=c.isRtl?c.negativeScrollAdjustment+a.scrollLeft+c.containerWidth-c.contentWidth:a.scrollLeft,c.isScrollbarXUsingBottom?d.bottom=c.scrollbarXBottom-e:d.top=c.scrollbarXTop+e,b(c.scrollbarXRail,d);var f={top:e,height:c.railYHeight};c.isScrollbarYUsingRight?c.isRtl?f.right=c.contentWidth-(c.negativeScrollAdjustment+a.scrollLeft)-c.scrollbarYRight-c.scrollbarYOuterWidth-9:f.right=c.scrollbarYRight-a.scrollLeft:c.isRtl?f.left=c.negativeScrollAdjustment+a.scrollLeft+2*c.containerWidth-c.contentWidth-c.scrollbarYLeft-c.scrollbarYOuterWidth:f.left=c.scrollbarYLeft+a.scrollLeft,b(c.scrollbarYRail,f),b(c.scrollbarX,{left:c.scrollbarXLeft,width:c.scrollbarXWidth-c.railBorderXWidth}),b(c.scrollbarY,{top:c.scrollbarYTop,height:c.scrollbarYHeight-c.railBorderYWidth})}function t(a,b){function c(b){b.touches&&b.touches[0]&&(b[k]=b.touches[0].pageY),s[o]=t+v*(b[k]-u),g(a,p),q(a),b.stopPropagation(),b.preventDefault()}function d(){h(a,p),a[r].classList.remove(z.state.clicking),a.event.unbind(a.ownerDocument,"mousemove",c)}function f(b,e){t=s[o],e&&b.touches&&(b[k]=b.touches[0].pageY),u=b[k],v=(a[j]-a[i])/(a[l]-a[n]),e?a.event.bind(a.ownerDocument,"touchmove",c):(a.event.bind(a.ownerDocument,"mousemove",c),a.event.once(a.ownerDocument,"mouseup",d),b.preventDefault()),a[r].classList.add(z.state.clicking),b.stopPropagation()}var i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],r=b[8],s=a.element,t=null,u=null,v=null;a.event.bind(a[m],"mousedown",function(a){f(a)}),a.event.bind(a[m],"touchstart",function(a){f(a,!0)})}var w="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector),z={main:"ps",rtl:"ps__rtl",element:{thumb:function(a){return"ps__thumb-"+a},rail:function(a){return"ps__rail-"+a},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(a){return"ps--active-"+a},scrolling:function(a){return"ps--scrolling-"+a}}},A={x:null,y:null},B=function(a){this.element=a,this.handlers={}},C={isEmpty:{configurable:!0}};B.prototype.bind=function(a,b){"undefined"==typeof this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this.element.addEventListener(a,b,!1)},B.prototype.unbind=function(a,b){var c=this;this.handlers[a]=this.handlers[a].filter(function(d){return!!(b&&d!==b)||(c.element.removeEventListener(a,d,!1),!1)})},B.prototype.unbindAll=function(){for(var a in this.handlers)this.unbind(a)},C.isEmpty.get=function(){var a=this;return Object.keys(this.handlers).every(function(b){return 0===a.handlers[b].length})},Object.defineProperties(B.prototype,C);var D=function(){this.eventElements=[]};D.prototype.eventElement=function(a){var b=this.eventElements.filter(function(b){return b.element===a})[0];return b||(b=new B(a),this.eventElements.push(b)),b},D.prototype.bind=function(a,b,c){this.eventElement(a).bind(b,c)},D.prototype.unbind=function(a,b,c){var d=this.eventElement(a);d.unbind(b,c),d.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(d),1)},D.prototype.unbindAll=function(){this.eventElements.forEach(function(a){return a.unbindAll()}),this.eventElements=[]},D.prototype.once=function(a,b,c){var d=this.eventElement(a),e=function(a){d.unbind(b,e),c(a)};d.bind(b,e)};var E={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&0a.scrollbarYTop?1:-1;a.element.scrollTop+=d*a.containerHeight,q(a),b.stopPropagation()}),a.event.bind(a.scrollbarX,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarXRail,"mousedown",function(b){var c=b.pageX-window.pageXOffset-a.scrollbarXRail.getBoundingClientRect().left,d=c>a.scrollbarXLeft?1:-1;a.element.scrollLeft+=d*a.containerWidth,q(a),b.stopPropagation()})},"drag-thumb":function(a){t(a,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),t(a,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(a){function b(b,d){var e=v(c.scrollTop);if(0===b){if(!a.scrollbarYActive)return!1;if(0===e&&0=a.contentHeight-a.containerHeight&&0>d)return!a.settings.wheelPropagation}var f=c.scrollLeft;if(0===d){if(!a.scrollbarXActive)return!1;if(0===f&&0>b||f>=a.contentWidth-a.containerWidth&&0u(a)?f||g:i||j,!d||!b.settings.wheelPropagation}function d(a){var b=a.deltaX,c=-1*a.deltaY;return("undefined"==typeof b||"undefined"==typeof c)&&(b=-1*a.wheelDeltaX/6,c=a.wheelDeltaY/6),a.deltaMode&&1===a.deltaMode&&(b*=10,c*=10),b!==b&&c!==c/* NaN checks */&&(b=0,c=a.wheelDelta),a.shiftKey?[-c,-b]:[b,c]}function f(b,c,d){// FIXME: this is a workaround for