@undp/create-app 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -27
- package/bin/generateFiles/generateEnv.js +21 -0
- package/bin/{templates/next/withoutDataViz/auth/app/layout.tsx → generateFiles/generateLayoutForNext.js} +35 -30
- package/bin/generateFiles/generateNextEnvTypes.js +9 -0
- package/bin/generateFiles/generatePackageJson.js +11 -8
- package/bin/generateFiles/generateStaticWebAppConfig.js +47 -0
- package/bin/generateFiles/generateStylesCss.js +8 -0
- package/bin/generateFiles/index.js +5 -0
- package/bin/index.js +22 -4
- package/bin/promptUser.js +8 -25
- package/bin/templates/next/auth/app/about/page.tsx +51 -0
- package/bin/templates/next/{withDataViz/auth → auth}/app/login/page.tsx +20 -2
- package/bin/templates/next/auth/app/page.tsx +75 -0
- package/bin/templates/next/auth/app/user/page.tsx +84 -0
- package/bin/templates/next/auth/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/next/auth/stores/counter.ts +23 -0
- package/bin/templates/next/basic/app/about/page.tsx +51 -0
- package/bin/templates/next/basic/app/page.tsx +75 -0
- package/bin/templates/next/basic/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/next/basic/stores/counter.ts +23 -0
- package/bin/templates/vite/basic/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/{withDataViz/query → basic}/src/App.tsx +30 -31
- package/bin/templates/vite/{withDataViz/basic → basic}/src/main.tsx +1 -1
- package/bin/templates/vite/basic/src/stores/counter.ts +23 -0
- package/bin/templates/vite/query/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/{withoutDataViz/query → query}/src/App.tsx +39 -10
- package/bin/templates/vite/query/src/stores/counter.ts +23 -0
- package/bin/templates/vite/query+router/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/query+router/src/App.tsx +73 -0
- package/bin/templates/vite/{withDataViz/query+router → query+router}/src/routes/queryDemo.tsx +12 -8
- package/bin/templates/vite/query+router/src/stores/counter.ts +23 -0
- package/bin/templates/vite/router/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/router/src/App.tsx +73 -0
- package/bin/templates/vite/{withDataViz/router → router}/src/main.tsx +2 -2
- package/bin/templates/vite/{withoutDataViz/router/src/App.tsx → router/src/routes/about.tsx} +14 -7
- package/bin/templates/vite/router/src/stores/counter.ts +23 -0
- package/bin/templates/vite/{withoutDataViz/router → router}/src/styles/style.css +0 -1
- package/package.json +1 -1
- package/bin/generateFiles.js +0 -105
- package/bin/templates/next/withDataViz/auth/README.md +0 -108
- package/bin/templates/next/withDataViz/auth/app/about/page.tsx +0 -33
- package/bin/templates/next/withDataViz/auth/app/page.tsx +0 -33
- package/bin/templates/next/withDataViz/auth/app/user/page.tsx +0 -86
- package/bin/templates/next/withDataViz/basic/README.md +0 -56
- package/bin/templates/next/withDataViz/basic/app/about/page.tsx +0 -33
- package/bin/templates/next/withDataViz/basic/app/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/auth/app/about/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/auth/app/api/auth/[...all]/route.ts +0 -5
- package/bin/templates/next/withoutDataViz/auth/app/globals.css +0 -3
- package/bin/templates/next/withoutDataViz/auth/app/login/page.tsx +0 -45
- package/bin/templates/next/withoutDataViz/auth/app/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/auth/app/user/page.tsx +0 -86
- package/bin/templates/next/withoutDataViz/auth/components/Footer.tsx +0 -16
- package/bin/templates/next/withoutDataViz/auth/components/Header.tsx +0 -56
- package/bin/templates/next/withoutDataViz/auth/eslint.config.mjs +0 -103
- package/bin/templates/next/withoutDataViz/auth/lib/auth-client.ts +0 -7
- package/bin/templates/next/withoutDataViz/auth/lib/auth.ts +0 -30
- package/bin/templates/next/withoutDataViz/auth/next.config.ts +0 -10
- package/bin/templates/next/withoutDataViz/auth/postcss.config.mjs +0 -7
- package/bin/templates/next/withoutDataViz/auth/public/next.svg +0 -1
- package/bin/templates/next/withoutDataViz/auth/tsconfig.json +0 -34
- package/bin/templates/next/withoutDataViz/basic/app/about/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/basic/app/globals.css +0 -3
- package/bin/templates/next/withoutDataViz/basic/app/layout.tsx +0 -31
- package/bin/templates/next/withoutDataViz/basic/app/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/basic/components/Footer.tsx +0 -16
- package/bin/templates/next/withoutDataViz/basic/components/Header.tsx +0 -27
- package/bin/templates/next/withoutDataViz/basic/eslint.config.mjs +0 -103
- package/bin/templates/next/withoutDataViz/basic/next.config.ts +0 -7
- package/bin/templates/next/withoutDataViz/basic/postcss.config.mjs +0 -7
- package/bin/templates/next/withoutDataViz/basic/public/next.svg +0 -1
- package/bin/templates/next/withoutDataViz/basic/tsconfig.json +0 -34
- package/bin/templates/vite/withDataViz/basic/README.md +0 -76
- package/bin/templates/vite/withDataViz/basic/src/App.tsx +0 -38
- package/bin/templates/vite/withDataViz/basic/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/basic/vite.config.ts +0 -74
- package/bin/templates/vite/withDataViz/query/.prettierrc +0 -10
- package/bin/templates/vite/withDataViz/query/README.md +0 -80
- package/bin/templates/vite/withDataViz/query/public/favicon.ico +0 -0
- package/bin/templates/vite/withDataViz/query/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/query/tailwind.config.js +0 -7
- package/bin/templates/vite/withDataViz/query+router/README.md +0 -112
- package/bin/templates/vite/withDataViz/query+router/src/App.tsx +0 -42
- package/bin/templates/vite/withDataViz/query+router/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/router/.prettierrc +0 -10
- package/bin/templates/vite/withDataViz/router/README.md +0 -107
- package/bin/templates/vite/withDataViz/router/public/favicon.ico +0 -0
- package/bin/templates/vite/withDataViz/router/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withDataViz/router/src/App.tsx +0 -51
- package/bin/templates/vite/withDataViz/router/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withDataViz/router/src/routes/about.tsx +0 -73
- package/bin/templates/vite/withDataViz/router/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/router/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/basic/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/basic/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/basic/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/basic/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/basic/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/basic/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/basic/src/App.tsx +0 -38
- package/bin/templates/vite/withoutDataViz/basic/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/basic/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/basic/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/basic/src/main.tsx +0 -10
- package/bin/templates/vite/withoutDataViz/basic/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/basic/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/basic/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/basic/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/basic/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/query/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/query/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/query/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/query/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/query/public/imgs/Tailwind_CSS_Logo.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/query/public/imgs/logo-color-600.png +0 -0
- package/bin/templates/vite/withoutDataViz/query/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/query/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/query/src/integration/tanstack-query.tsx +0 -27
- package/bin/templates/vite/withoutDataViz/query/src/main.tsx +0 -21
- package/bin/templates/vite/withoutDataViz/query/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/query/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/query/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/query/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/query/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/query/vite.config.ts +0 -75
- package/bin/templates/vite/withoutDataViz/query+router/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/query+router/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/query+router/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/query+router/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/query+router/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/query+router/public/imgs/logo-color-600.png +0 -0
- package/bin/templates/vite/withoutDataViz/query+router/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query+router/src/App.tsx +0 -42
- package/bin/templates/vite/withoutDataViz/query+router/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query+router/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/query+router/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/query+router/src/integration/tanstack-query.tsx +0 -27
- package/bin/templates/vite/withoutDataViz/query+router/src/main.tsx +0 -73
- package/bin/templates/vite/withoutDataViz/query+router/src/routes/queryDemo.tsx +0 -73
- package/bin/templates/vite/withoutDataViz/query+router/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/query+router/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/query+router/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/query+router/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/query+router/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/query+router/vite.config.ts +0 -75
- package/bin/templates/vite/withoutDataViz/router/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/router/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/router/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/router/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/router/public/imgs/Tailwind_CSS_Logo.svg +0 -1
- package/bin/templates/vite/withoutDataViz/router/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/router/public/imgs/logo-color-600.png +0 -0
- package/bin/templates/vite/withoutDataViz/router/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/router/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/router/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/router/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/router/src/main.tsx +0 -66
- package/bin/templates/vite/withoutDataViz/router/src/routes/about.tsx +0 -73
- package/bin/templates/vite/withoutDataViz/router/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/router/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/router/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/router/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/router/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/router/vite.config.ts +0 -75
- /package/bin/templates/next/{withDataViz/auth → auth}/.prettierrc +0 -0
- /package/bin/templates/next/{withoutDataViz/auth → auth}/README.md +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/api/auth/[...all]/route.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/favicon.ico +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/globals.css +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/layout.tsx +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/components/Footer.tsx +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/components/Header.tsx +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/eslint.config.mjs +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/lib/auth-client.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/lib/auth.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/next.config.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/postcss.config.mjs +0 -0
- /package/bin/templates/{vite/withDataViz/basic → next/auth}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/next/{withDataViz/auth/public → auth/public/imgs}/next.svg +0 -0
- /package/bin/templates/next/{withDataViz/auth/public → auth/public/imgs}/undp-logo-blue.svg +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/tailwind.config.js +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/tsconfig.json +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/.prettierrc +0 -0
- /package/bin/templates/next/{withoutDataViz/basic → basic}/README.md +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/app/favicon.ico +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/app/globals.css +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/app/layout.tsx +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/components/Footer.tsx +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/components/Header.tsx +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/eslint.config.mjs +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/next.config.ts +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/postcss.config.mjs +0 -0
- /package/bin/templates/{vite/withDataViz/query+router → next/basic}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/next/{withDataViz/basic/public → basic/public/imgs}/next.svg +0 -0
- /package/bin/templates/next/{withDataViz/basic/public → basic/public/imgs}/undp-logo-blue.svg +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/tailwind.config.js +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/tsconfig.json +0 -0
- /package/bin/templates/{next/withoutDataViz/auth → vite/basic}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → basic}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/index.html +0 -0
- /package/bin/templates/{next/withoutDataViz/auth/app → vite/basic/public}/favicon.ico +0 -0
- /package/bin/templates/vite/{withDataViz/query → basic}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/{next/withoutDataViz/auth/public → vite/basic/public/imgs}/undp-logo-blue.svg +0 -0
- /package/bin/templates/{next/withoutDataViz/basic/public → vite/basic/src/assets}/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → basic}/src/styles/style.css +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/vite-env.d.ts +0 -0
- /package/bin/templates/{next/withoutDataViz/auth → vite/basic}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → basic}/vite.config.ts +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/query → query}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/index.html +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query}/public/favicon.ico +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → query}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query/public/imgs/logo-color-600.png → query/public/imgs/Tanstack-logo.png} +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query}/public/imgs/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query}/src/assets/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/integration/tanstack-query.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/main.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withoutDataViz/query → query}/src/styles/style.css +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/vite-env.d.ts +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withDataViz/router → query}/vite.config.ts +0 -0
- /package/bin/templates/{next/withoutDataViz/basic → vite/query+router}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/query+router → query+router}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/index.html +0 -0
- /package/bin/templates/{next/withoutDataViz/basic/app → vite/query+router/public}/favicon.ico +0 -0
- /package/bin/templates/vite/{withDataViz/router → query+router}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router/public/imgs/logo-color-600.png → query+router/public/imgs/Tanstack-logo.png} +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query+router}/public/imgs/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query+router}/src/assets/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/integration/tanstack-query.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/main.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withoutDataViz/query+router → query+router}/src/styles/style.css +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/vite-env.d.ts +0 -0
- /package/bin/templates/{next/withoutDataViz/basic → vite/query+router}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withDataViz/query → query+router}/vite.config.ts +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → router}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/router → router}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/index.html +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → router}/public/favicon.ico +0 -0
- /package/bin/templates/vite/{withoutDataViz/query+router → router}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/router/public/imgs/logo-color-600.png → router/public/imgs/Tanstack-logo.png} +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query → router}/public/imgs/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query → router}/src/assets/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/vite-env.d.ts +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → router}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → router}/vite.config.ts +0 -0
package/README.md
CHANGED
|
@@ -8,29 +8,29 @@
|
|
|
8
8
|
|
|
9
9
|
## 🚀 Features
|
|
10
10
|
|
|
11
|
-
- ⚡ **React + TypeScript
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
11
|
+
- ⚡ **React + TypeScript** setup out of the box
|
|
12
|
+
- 🎨 Includes **Tailwind CSS** for styling
|
|
13
|
+
- 🧠 Includes **Zustand** for state management
|
|
14
|
+
- 🚀 **Vite support** for fast SPA development, including optional **routing** and **data fetching** with **TanStack** libraries
|
|
15
|
+
- 🌐 **Next.js support** for full-stack apps, including optional **authentication** with **Better Auth**
|
|
16
|
+
- 🧱 Preconfigured for **UNDP’s Design System**
|
|
17
|
+
- 📊 Optional integration with **@undp/data-viz** for interactive data visualization
|
|
18
|
+
- 🧼 **ESLint** + **Prettier** preconfigured for consistent code style
|
|
17
19
|
|
|
18
20
|
---
|
|
19
21
|
|
|
20
22
|
## 🧩 Pre-configured setups
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- Next.js + Tailwind + Auth
|
|
33
|
-
- Secure, full-stack framework with authentication and SSR
|
|
24
|
+
All setups include **Tailwind CSS** for styling and **Zustand** for state management.
|
|
25
|
+
|
|
26
|
+
| Framework | Variants | Description |
|
|
27
|
+
|------------|-----------|-------------|
|
|
28
|
+
| **Vite** | Basic | Minimal React + TypeScript setup |
|
|
29
|
+
| **Vite** | + Query | Adds TanStack Query for data fetching |
|
|
30
|
+
| **Vite** | + Router | Adds TanStack Router for routing |
|
|
31
|
+
| **Vite** | + Router + Query | Full-featured Vite setup |
|
|
32
|
+
| **Next.js** | Basic | SSR and file-based routing |
|
|
33
|
+
| **Next.js** | + Auth | Includes authentication via Better Auth |
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
@@ -39,14 +39,7 @@
|
|
|
39
39
|
You don’t need to install it globally — just use **npx**:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx @undp/create-app my-
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
or install it globally
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm install -g @undp/create-app
|
|
49
|
-
create-undp-app my-project
|
|
42
|
+
npx @undp/create-app my-undp-app
|
|
50
43
|
```
|
|
51
44
|
|
|
52
45
|
---
|
|
@@ -56,7 +49,7 @@ create-undp-app my-project
|
|
|
56
49
|
After running the CLI, navigate into your project and start the dev server:
|
|
57
50
|
|
|
58
51
|
```bash
|
|
59
|
-
cd my-
|
|
52
|
+
cd my-undp-app && npm run dev
|
|
60
53
|
```
|
|
61
54
|
|
|
62
55
|
*Please note: If you have not installed the dependencies then you might want to run `npm install` before `npm run dev`.*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function generateEnv() {
|
|
2
|
+
return `# Secret key used by Better Auth for signing tokens and securing sessions
|
|
3
|
+
BETTER_AUTH_SECRET=
|
|
4
|
+
|
|
5
|
+
# The base URL where your Better Auth instance is running (e.g., localhost for dev)
|
|
6
|
+
BETTER_AUTH_URL=http://localhost:3000
|
|
7
|
+
|
|
8
|
+
# --- GitHub OAuth credentials ---
|
|
9
|
+
# Client ID from your GitHub OAuth app (used for GitHub login)
|
|
10
|
+
GITHUB_CLIENT_ID=
|
|
11
|
+
# Client Secret from your GitHub OAuth app
|
|
12
|
+
GITHUB_CLIENT_SECRET=
|
|
13
|
+
|
|
14
|
+
# --- Azure AD OAuth credentials ---
|
|
15
|
+
# Client ID from your Azure AD App Registration
|
|
16
|
+
AZURE_CLIENT_ID=
|
|
17
|
+
# Client Secret generated for your Azure AD App
|
|
18
|
+
AZURE_CLIENT_SECRET=
|
|
19
|
+
# Tenant ID of your Azure AD directory (found in Azure portal)
|
|
20
|
+
AZURE_TENANT_ID=`
|
|
21
|
+
}
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import '
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
export function generateLayoutForNext(dataViz, projectName) {
|
|
2
|
+
return `import type { Metadata } from 'next';
|
|
3
|
+
|
|
4
|
+
import HeaderEl from '@/components/Header';
|
|
5
|
+
import FooterEl from '@/components/Footer';
|
|
6
|
+
|
|
7
|
+
import './globals.css';
|
|
8
|
+
import '@undp/design-system-react/style.css';${dataViz ? `
|
|
9
|
+
import '@undp/data-viz/style.css';` : ''}
|
|
10
|
+
|
|
11
|
+
export const metadata: Metadata = {
|
|
12
|
+
title: '${projectName}',
|
|
13
|
+
description: 'Generated by create undp app',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default function RootLayout({
|
|
17
|
+
children,
|
|
18
|
+
}: Readonly<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}>) {
|
|
21
|
+
return (
|
|
22
|
+
<html lang='en'>
|
|
23
|
+
<body className='flex flex-col gap-0 min-h-screen'>
|
|
24
|
+
<HeaderEl />
|
|
25
|
+
<main className='grow-1 flex flex-col justify-center'>
|
|
26
|
+
<div className='flex flex-col justify-center'>{children}</div>
|
|
27
|
+
</main>
|
|
28
|
+
<FooterEl />
|
|
29
|
+
</body>
|
|
30
|
+
</html>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
`
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function generateNextEnvTypes() {
|
|
2
|
+
return `/// <reference types='next' />
|
|
3
|
+
/// <reference types='next/image-types/global' />
|
|
4
|
+
import './.next/dev/types/routes.d.ts';
|
|
5
|
+
|
|
6
|
+
// NOTE: This file should not be edited
|
|
7
|
+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
8
|
+
`
|
|
9
|
+
}
|
|
@@ -2,7 +2,6 @@ import { execSync } from 'child_process';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
4
|
function getLatestVersion(pkg) {
|
|
5
|
-
console.log(chalk.gray(` Fetching latest version for ${pkg}`));
|
|
6
5
|
try {
|
|
7
6
|
return execSync(`npm show ${pkg} version`).toString().trim();
|
|
8
7
|
} catch {
|
|
@@ -11,9 +10,9 @@ function getLatestVersion(pkg) {
|
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export function generatePackageJson(config) {
|
|
13
|
+
console.log(chalk.gray(` Fetching latest version for packages...`));
|
|
14
14
|
const designSystemVer = `^${getLatestVersion('@undp/design-system-react')}`
|
|
15
|
-
const
|
|
16
|
-
const lucideReactVer = `^${getLatestVersion('lucide-react')}`
|
|
15
|
+
const zustandVer = `^${getLatestVersion('zustand')}`
|
|
17
16
|
const dependencies = config.libraries.includes('peer') && config.libraries.includes('@undp/data-viz') ? {
|
|
18
17
|
"@undp/design-system-react": designSystemVer,
|
|
19
18
|
"react": "^19.2.0",
|
|
@@ -29,11 +28,13 @@ export function generatePackageJson(config) {
|
|
|
29
28
|
"math-expression-evaluator": "^2.0.7",
|
|
30
29
|
"pmtiles": "^4.3.0",
|
|
31
30
|
"react-globe.gl": "^2.37.0",
|
|
32
|
-
"three": "^0.180.0"
|
|
31
|
+
"three": "^0.180.0",
|
|
32
|
+
"zustand": zustandVer
|
|
33
33
|
} : {
|
|
34
34
|
"@undp/design-system-react": designSystemVer,
|
|
35
35
|
"react": "^19.2.0",
|
|
36
36
|
"react-dom": "^19.2.0",
|
|
37
|
+
"zustand": zustandVer
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
switch (config.framework) {
|
|
@@ -58,12 +59,14 @@ export function generatePackageJson(config) {
|
|
|
58
59
|
break;
|
|
59
60
|
}
|
|
60
61
|
if (config.libraries.includes('@undp/data-viz')) {
|
|
61
|
-
|
|
62
|
+
const dataVizVer = `^${getLatestVersion('@undp/data-viz')}`
|
|
63
|
+
dependencies['@undp/data-viz'] = dataVizVer;
|
|
62
64
|
}
|
|
63
65
|
if (config.libraries.includes('lucide-react')) {
|
|
64
|
-
|
|
66
|
+
const lucideReactVer = `^${getLatestVersion('lucide-react')}`
|
|
67
|
+
dependencies['lucide-react'] = lucideReactVer;
|
|
65
68
|
}
|
|
66
|
-
const devDependencies = config.framework
|
|
69
|
+
const devDependencies = config.framework.includes('vite') ? {
|
|
67
70
|
"@eslint/config-array": "^0.21.1",
|
|
68
71
|
"@eslint/js": "^9.39.1",
|
|
69
72
|
"@nabla/vite-plugin-eslint": "^2.0.6",
|
|
@@ -138,7 +141,7 @@ export function generatePackageJson(config) {
|
|
|
138
141
|
sideEffects: [
|
|
139
142
|
'*.css'
|
|
140
143
|
],
|
|
141
|
-
scripts: config.framework
|
|
144
|
+
scripts: config.framework.includes('next')
|
|
142
145
|
? {
|
|
143
146
|
dev: 'next dev',
|
|
144
147
|
build: 'next build',
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function generateStaticWebAppConfig() {
|
|
2
|
+
return `{
|
|
3
|
+
"globalHeaders": {
|
|
4
|
+
"Access-Control-Allow-Origin": "*",
|
|
5
|
+
"Access-Control-Allow-Methods": "GET, OPTIONS"
|
|
6
|
+
},
|
|
7
|
+
"routes": [
|
|
8
|
+
{
|
|
9
|
+
"route": "/react-*.js",
|
|
10
|
+
"headers": {
|
|
11
|
+
"Access-Control-Allow-Origin": "*",
|
|
12
|
+
"Access-Control-Allow-Methods": "GET, OPTIONS",
|
|
13
|
+
"Cache-Control": "public, max-age=31536000, immutable"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"route": "/undp-*.js",
|
|
18
|
+
"headers": {
|
|
19
|
+
"Access-Control-Allow-Origin": "*",
|
|
20
|
+
"Access-Control-Allow-Methods": "GET, OPTIONS",
|
|
21
|
+
"Cache-Control": "public, max-age=31536000, immutable"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"route": "/index.js",
|
|
26
|
+
"headers": {
|
|
27
|
+
"Access-Control-Allow-Origin": "*",
|
|
28
|
+
"Access-Control-Allow-Methods": "GET, OPTIONS",
|
|
29
|
+
"Cache-Control": "no-cache"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"route": "/*",
|
|
34
|
+
"headers": {
|
|
35
|
+
"Access-Control-Allow-Origin": "*",
|
|
36
|
+
"Access-Control-Allow-Methods": "GET, OPTIONS",
|
|
37
|
+
"Cache-Control": "no-cache"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"navigationFallback": {
|
|
42
|
+
"rewrite": "/index.html",
|
|
43
|
+
"exclude": ["/assets/*", "/*.js", "/*.css", "/*.png", "/*.jpg", "/*.svg"]
|
|
44
|
+
}
|
|
45
|
+
}`
|
|
46
|
+
}
|
|
47
|
+
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export { generatePackageJson } from './generatePackageJson.js';
|
|
2
2
|
export { generateViteConfig } from './generateViteConfig.js';
|
|
3
3
|
export { generateIndexHtml } from './generateIndexHtml.js';
|
|
4
|
+
export { generateStaticWebAppConfig } from './generateStaticWebAppConfig.js';
|
|
5
|
+
export { generateLayoutForNext } from './generateLayoutForNext.js';
|
|
6
|
+
export { generateStylesCss } from './generateStylesCss.js';
|
|
7
|
+
export { generateNextEnvTypes } from './generateNextEnvTypes.js';
|
|
8
|
+
export { generateEnv } from './generateEnv.js';
|
package/bin/index.js
CHANGED
|
@@ -8,7 +8,16 @@ import { promptUser } from './promptUser.js';
|
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
import { fileURLToPath } from 'url';
|
|
10
10
|
import { printSuccess, createFolders } from './utils/index.js';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
generatePackageJson,
|
|
13
|
+
generateViteConfig,
|
|
14
|
+
generateIndexHtml,
|
|
15
|
+
generateStaticWebAppConfig,
|
|
16
|
+
generateStylesCss,
|
|
17
|
+
generateLayoutForNext,
|
|
18
|
+
generateNextEnvTypes,
|
|
19
|
+
generateEnv,
|
|
20
|
+
} from './generateFiles/index.js';
|
|
12
21
|
|
|
13
22
|
function copyFolder(source, destination) {
|
|
14
23
|
fs.cpSync(source, destination, { recursive: true, force: true });
|
|
@@ -32,7 +41,6 @@ async function main() {
|
|
|
32
41
|
|
|
33
42
|
const baseFolder = config.framework.includes('vite') ? 'vite' : 'next';
|
|
34
43
|
|
|
35
|
-
const secondaryFolder = config.libraries.includes('@undp/data-viz') ? 'withDataViz' : 'withoutDataViz';
|
|
36
44
|
|
|
37
45
|
let tertiaryFolder = 'basic';
|
|
38
46
|
|
|
@@ -53,15 +61,25 @@ async function main() {
|
|
|
53
61
|
break;
|
|
54
62
|
}
|
|
55
63
|
|
|
56
|
-
|
|
64
|
+
|
|
57
65
|
|
|
58
66
|
if (config.framework.includes('vite')) {
|
|
67
|
+
copyFolder(path.join(__dirname, `./templates/${baseFolder}/${tertiaryFolder}`), projectPath);
|
|
59
68
|
fs.writeFileSync('vite.config.ts', generateViteConfig(config));
|
|
60
69
|
fs.writeFileSync('index.html', generateIndexHtml(config));
|
|
70
|
+
fs.writeFileSync('src/styles/style.css', generateStylesCss(config.libraries.includes('@undp/data-viz')));
|
|
71
|
+
if (config.addStaticWebAppConfig) {
|
|
72
|
+
fs.writeFileSync('staticwebapp.config.json', generateStaticWebAppConfig());
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
copyFolder(path.join(__dirname, `./templates/${baseFolder}/${tertiaryFolder}`), projectPath);
|
|
76
|
+
fs.writeFileSync('app/layout.tsx', generateLayoutForNext(config.libraries.includes('@undp/data-viz'), config.projectName));
|
|
77
|
+
fs.writeFileSync('next-env.d.ts', generateNextEnvTypes());
|
|
78
|
+
if (config.framework === 'next-auth') fs.writeFileSync('.env.local', generateEnv());
|
|
61
79
|
}
|
|
62
80
|
fs.writeFileSync('package.json', JSON.stringify(generatePackageJson(config), null, 2));
|
|
63
81
|
|
|
64
|
-
console.log(chalk.green(' ✓ Project folder and files generated'));
|
|
82
|
+
console.log(chalk.green(' ✓ Project folder and files generated\n'));
|
|
65
83
|
|
|
66
84
|
const { installNow } = await inquirer.prompt([
|
|
67
85
|
{
|
package/bin/promptUser.js
CHANGED
|
@@ -22,32 +22,15 @@ export async function promptUser(name) {
|
|
|
22
22
|
{
|
|
23
23
|
type: 'list',
|
|
24
24
|
name: 'framework',
|
|
25
|
-
|
|
25
|
+
loop: false,
|
|
26
|
+
message: chalk.yellow('📦 Choose your setup (all include Tailwind for styling & Zustand for state management):\n'),
|
|
26
27
|
choices: [
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
value: 'vite-query'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'Vite + Tailwind + Router — Fast starter with built-in routing support',
|
|
37
|
-
value: 'vite-router'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Vite + Tailwind + Router + Query — Complete Vite setup for routing and data management',
|
|
41
|
-
value: 'vite-full'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'Next.js + Tailwind — Production-ready React framework with file-based routing and SSR',
|
|
45
|
-
value: 'next-basic'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'Next.js + Tailwind + Auth — Secure, full-stack framework with authentication and SSR',
|
|
49
|
-
value: 'next-auth'
|
|
50
|
-
},
|
|
28
|
+
{ name: 'Vite — Basic React setup', value: 'vite-basic' },
|
|
29
|
+
{ name: 'Vite + Query — With TanStack Query', value: 'vite-query' },
|
|
30
|
+
{ name: 'Vite + Router — With routing support', value: 'vite-router' },
|
|
31
|
+
{ name: 'Vite + Router + Query — Full Vite setup', value: 'vite-full' },
|
|
32
|
+
{ name: 'Next.js — SSR and file routing', value: 'next-basic' },
|
|
33
|
+
{ name: 'Next.js + Auth — With authentication', value: 'next-auth' },
|
|
51
34
|
],
|
|
52
35
|
default: 'vite-basic',
|
|
53
36
|
},
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { P } from '@undp/design-system-react/Typography';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
|
|
6
|
+
export default function About() {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
10
|
+
<Image
|
|
11
|
+
className='dark:invert'
|
|
12
|
+
src='/imgs/next.svg'
|
|
13
|
+
alt='Next.js logo'
|
|
14
|
+
width={100}
|
|
15
|
+
height={20}
|
|
16
|
+
priority
|
|
17
|
+
/>
|
|
18
|
+
<P marginBottom='none'>&</P>
|
|
19
|
+
<Image
|
|
20
|
+
className='dark:invert'
|
|
21
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
22
|
+
alt='Tailwind logo'
|
|
23
|
+
width={40}
|
|
24
|
+
height={20}
|
|
25
|
+
priority
|
|
26
|
+
/>
|
|
27
|
+
<P marginBottom='none'>&</P>
|
|
28
|
+
<Image
|
|
29
|
+
className='dark:invert'
|
|
30
|
+
src='/imgs/Zustand-logo.svg'
|
|
31
|
+
alt='Zustand logo'
|
|
32
|
+
width={40}
|
|
33
|
+
height={20}
|
|
34
|
+
priority
|
|
35
|
+
/>
|
|
36
|
+
<P marginBottom='none'>&</P>
|
|
37
|
+
<Image
|
|
38
|
+
className='dark:invert'
|
|
39
|
+
src='/imgs/undp-logo-blue.svg'
|
|
40
|
+
alt='UNDP logo'
|
|
41
|
+
width={40}
|
|
42
|
+
height={20}
|
|
43
|
+
priority
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
<P marginBottom='xl' className='text-center'>
|
|
47
|
+
To edit this page, edit the page.tsx file in the about folder.
|
|
48
|
+
</P>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -19,7 +19,7 @@ export default function LoginPage() {
|
|
|
19
19
|
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
20
20
|
<Image
|
|
21
21
|
className='dark:invert'
|
|
22
|
-
src='/next.svg'
|
|
22
|
+
src='/imgs/next.svg'
|
|
23
23
|
alt='Next.js logo'
|
|
24
24
|
width={100}
|
|
25
25
|
height={20}
|
|
@@ -28,7 +28,25 @@ export default function LoginPage() {
|
|
|
28
28
|
<P marginBottom='none'>&</P>
|
|
29
29
|
<Image
|
|
30
30
|
className='dark:invert'
|
|
31
|
-
src='/
|
|
31
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
32
|
+
alt='Tailwind logo'
|
|
33
|
+
width={40}
|
|
34
|
+
height={20}
|
|
35
|
+
priority
|
|
36
|
+
/>
|
|
37
|
+
<P marginBottom='none'>&</P>
|
|
38
|
+
<Image
|
|
39
|
+
className='dark:invert'
|
|
40
|
+
src='/imgs/Zustand-logo.svg'
|
|
41
|
+
alt='Zustand logo'
|
|
42
|
+
width={40}
|
|
43
|
+
height={20}
|
|
44
|
+
priority
|
|
45
|
+
/>
|
|
46
|
+
<P marginBottom='none'>&</P>
|
|
47
|
+
<Image
|
|
48
|
+
className='dark:invert'
|
|
49
|
+
src='/imgs/undp-logo-blue.svg'
|
|
32
50
|
alt='UNDP logo'
|
|
33
51
|
width={40}
|
|
34
52
|
height={20}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { P } from '@undp/design-system-react/Typography';
|
|
4
|
+
import { Button } from '@undp/design-system-react/Button';
|
|
5
|
+
import Image from 'next/image';
|
|
6
|
+
|
|
7
|
+
import { useCounterActions, useCounter } from '@/stores/counter';
|
|
8
|
+
|
|
9
|
+
export default function Home() {
|
|
10
|
+
const count = useCounter();
|
|
11
|
+
const { increment, decrement } = useCounterActions();
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
15
|
+
<Image
|
|
16
|
+
className='dark:invert'
|
|
17
|
+
src='/imgs/next.svg'
|
|
18
|
+
alt='Next.js logo'
|
|
19
|
+
width={100}
|
|
20
|
+
height={20}
|
|
21
|
+
priority
|
|
22
|
+
/>
|
|
23
|
+
<P marginBottom='none'>&</P>
|
|
24
|
+
<Image
|
|
25
|
+
className='dark:invert'
|
|
26
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
27
|
+
alt='Tailwind logo'
|
|
28
|
+
width={40}
|
|
29
|
+
height={20}
|
|
30
|
+
priority
|
|
31
|
+
/>
|
|
32
|
+
<P marginBottom='none'>&</P>
|
|
33
|
+
<Image
|
|
34
|
+
className='dark:invert'
|
|
35
|
+
src='/imgs/Zustand-logo.svg'
|
|
36
|
+
alt='Zustand logo'
|
|
37
|
+
width={40}
|
|
38
|
+
height={20}
|
|
39
|
+
priority
|
|
40
|
+
/>
|
|
41
|
+
<P marginBottom='none'>&</P>
|
|
42
|
+
<Image
|
|
43
|
+
className='dark:invert'
|
|
44
|
+
src='/imgs/undp-logo-blue.svg'
|
|
45
|
+
alt='UNDP logo'
|
|
46
|
+
width={40}
|
|
47
|
+
height={20}
|
|
48
|
+
priority
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
<P marginBottom='xl' className='text-center'>
|
|
52
|
+
To get started, edit the App.tsx file.{' '}
|
|
53
|
+
<span className='font-bold'>Count: {count}</span>
|
|
54
|
+
</P>
|
|
55
|
+
<div className='flex gap-4 justify-center'>
|
|
56
|
+
<Button
|
|
57
|
+
variant='tertiary'
|
|
58
|
+
onClick={() => {
|
|
59
|
+
increment();
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
Increase counter
|
|
63
|
+
</Button>
|
|
64
|
+
<Button
|
|
65
|
+
variant='tertiary'
|
|
66
|
+
onClick={() => {
|
|
67
|
+
decrement();
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
Decrease counter
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { Spinner } from '@undp/design-system-react/Spinner';
|
|
5
|
+
import { P } from '@undp/design-system-react/Typography';
|
|
6
|
+
import { Button } from '@undp/design-system-react/Button';
|
|
7
|
+
|
|
8
|
+
import { useSession, signIn } from '@/lib/auth-client';
|
|
9
|
+
|
|
10
|
+
export default function UserPage() {
|
|
11
|
+
const { data: session, isPending } = useSession();
|
|
12
|
+
|
|
13
|
+
if (isPending) {
|
|
14
|
+
return (
|
|
15
|
+
<div className='my-8 mx-aut'>
|
|
16
|
+
<Spinner />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const handleSignIn = async () => {
|
|
21
|
+
await signIn.social({
|
|
22
|
+
provider: 'microsoft',
|
|
23
|
+
callbackURL: '/user',
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
30
|
+
<Image
|
|
31
|
+
className='dark:invert'
|
|
32
|
+
src='/imgs/next.svg'
|
|
33
|
+
alt='Next.js logo'
|
|
34
|
+
width={100}
|
|
35
|
+
height={20}
|
|
36
|
+
priority
|
|
37
|
+
/>
|
|
38
|
+
<P marginBottom='none'>&</P>
|
|
39
|
+
<Image
|
|
40
|
+
className='dark:invert'
|
|
41
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
42
|
+
alt='Tailwind logo'
|
|
43
|
+
width={40}
|
|
44
|
+
height={20}
|
|
45
|
+
priority
|
|
46
|
+
/>
|
|
47
|
+
<P marginBottom='none'>&</P>
|
|
48
|
+
<Image
|
|
49
|
+
className='dark:invert'
|
|
50
|
+
src='/imgs/Zustand-logo.svg'
|
|
51
|
+
alt='Zustand logo'
|
|
52
|
+
width={40}
|
|
53
|
+
height={20}
|
|
54
|
+
priority
|
|
55
|
+
/>
|
|
56
|
+
<P marginBottom='none'>&</P>
|
|
57
|
+
<Image
|
|
58
|
+
className='dark:invert'
|
|
59
|
+
src='/imgs/undp-logo-blue.svg'
|
|
60
|
+
alt='UNDP logo'
|
|
61
|
+
width={40}
|
|
62
|
+
height={20}
|
|
63
|
+
priority
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
{!session ? (
|
|
67
|
+
<>
|
|
68
|
+
<P marginBottom='xl' className='text-center'>
|
|
69
|
+
Please sign in to view this page
|
|
70
|
+
</P>
|
|
71
|
+
<div className='flex justify-center'>
|
|
72
|
+
<Button variant='tertiary' onClick={handleSignIn}>
|
|
73
|
+
Sign In
|
|
74
|
+
</Button>
|
|
75
|
+
</div>
|
|
76
|
+
</>
|
|
77
|
+
) : (
|
|
78
|
+
<P marginBottom='xl' className='text-center'>
|
|
79
|
+
Welcome, {session.user.name || session.user.email}!
|
|
80
|
+
</P>
|
|
81
|
+
)}
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
}
|