commit aa8dc12194ef00c26662ca881d37c38991a930d2 Author: Alexandre Aubin Date: Wed Jul 12 04:52:58 2023 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..768a14e --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Nuxt dev/build outputs +.output +.nuxt +.nitro +.cache +dist + +# Node dependencies +node_modules + +# Logs +logs +*.log + +# Misc +.DS_Store +.fleet +.idea + +# Local env files +.env +.env.* +!.env.example diff --git a/README.md b/README.md new file mode 100644 index 0000000..8a5b59d --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +## POC for new YunoHost portal + +- This is a based on [Nuxt v3](https://nuxt.com/) + +### Setup + +- I'm doing all this from inside a YunoHost LXC +- You may want to open port 3000 (or disable the firewall) to access the dev server +- You'll need NodeJS 18.14 (or higher) +- And `yarn` +- Run `yarn install` +- Also make sure the new yunohost-portal-api is running and corresponding route is in nginx config + +### Dev + +- Run `yarn dev` +- Access `http://1.2.3.4:3000/` diff --git a/assets/img/logo-white.svg b/assets/img/logo-white.svg new file mode 100644 index 0000000..f960fd3 --- /dev/null +++ b/assets/img/logo-white.svg @@ -0,0 +1,34 @@ + + + +]> + + + + + + + + + + + diff --git a/composables/states.ts b/composables/states.ts new file mode 100644 index 0000000..722773a --- /dev/null +++ b/composables/states.ts @@ -0,0 +1,2 @@ +export const useApiEndpoint = () => "https://" + window.location.hostname + '/yunohost/portalapi' +export const useIsLoggedIn = () => useState('isLoggedIn', () => false) diff --git a/layouts/default.vue b/layouts/default.vue new file mode 100644 index 0000000..202d6fc --- /dev/null +++ b/layouts/default.vue @@ -0,0 +1,31 @@ + + + diff --git a/nuxt.config.ts b/nuxt.config.ts new file mode 100644 index 0000000..6106dfd --- /dev/null +++ b/nuxt.config.ts @@ -0,0 +1,15 @@ +// https://nuxt.com/docs/api/configuration/nuxt-config +export default defineNuxtConfig({ + ssr: false, + modules: [ + '@nuxtjs/tailwindcss', + 'nuxt-icon', + "@nuxtjs/google-fonts", + ], + devtools: { enabled: true }, + googleFonts: { + families: { + 'Source+Sans+3': [500, 900] + } + } +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..4cda5a1 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "private": true, + "scripts": { + "build": "nuxt build", + "dev": "nuxt dev", + "generate": "nuxt generate", + "preview": "nuxt preview", + "postinstall": "nuxt prepare" + }, + "devDependencies": { + "@nuxt/devtools": "latest", + "@nuxtjs/google-fonts": "^3.0.1", + "@nuxtjs/tailwindcss": "^5.3.5", + "@types/node": "^18.16.19", + "nuxt": "^3.6.2", + "nuxt-icon": "^0.4.2" + } +} diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 0000000..a2576f9 --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,117 @@ + + + diff --git a/pages/login.vue b/pages/login.vue new file mode 100644 index 0000000..7caea32 --- /dev/null +++ b/pages/login.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..661ab5e --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,9 @@ +module.exports = { + // Safelisting some classes to avoid content purge + safelist: [ + 'safelisted', + { + pattern: /bg-.*-500/, + }, + ] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a746f2a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,4 @@ +{ + // https://nuxt.com/docs/guide/concepts/typescript + "extends": "./.nuxt/tsconfig.json" +}