├── .gitignore ├── README.md ├── anything.vue ├── assets └── css │ └── tailwind.css ├── components ├── Counter.vue ├── Home │ └── HomeWelcome.vue └── Navbar.vue ├── composables └── states.js ├── layouts ├── default.vue └── sidebar.vue ├── middleware ├── auth.js └── page-visit.global.js ├── nuxt.config.ts ├── package-lock.json ├── package.json ├── pages ├── about.vue ├── index.vue ├── iphone │ ├── index.vue │ └── iphone-[name].vue ├── login.vue └── profile.vue ├── public ├── images │ ├── iphone-12-pro.webp │ ├── iphone-12.webp │ ├── iphone-13-pro.webp │ └── iphone-13.webp └── robots.txt ├── server ├── api │ └── iphones.ts └── routes │ └── iphones.ts ├── tailwind.config.js └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log* 3 | .nuxt 4 | .nitro 5 | .cache 6 | .output 7 | .env 8 | dist 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuxt course 2022 -------------------------------------------------------------------------------- /anything.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /assets/css/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /components/Counter.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | -------------------------------------------------------------------------------- /components/Home/HomeWelcome.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /components/Navbar.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 33 | -------------------------------------------------------------------------------- /composables/states.js: -------------------------------------------------------------------------------- 1 | export const useCart = () => useState(() => []); 2 | export const useAuth = () => 3 | useState(() => ({ 4 | isAuthenticated: false, 5 | })); 6 | 7 | export const usePageVisitCount = () => useState(() => 0); 8 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /layouts/sidebar.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 24 | -------------------------------------------------------------------------------- /middleware/auth.js: -------------------------------------------------------------------------------- 1 | export default defineNuxtRouteMiddleware(() => { 2 | const auth = useAuth(); 3 | return auth.value.isAuthenticated; 4 | }); 5 | -------------------------------------------------------------------------------- /middleware/page-visit.global.js: -------------------------------------------------------------------------------- 1 | export default defineNuxtRouteMiddleware(() => { 2 | const pageVisitCount = usePageVisitCount(); 3 | pageVisitCount.value++; 4 | }); 5 | -------------------------------------------------------------------------------- /nuxt.config.ts: -------------------------------------------------------------------------------- 1 | import { defineNuxtConfig } from "nuxt"; 2 | 3 | // https://v3.nuxtjs.org/api/configuration/nuxt.config 4 | export default defineNuxtConfig({ 5 | css: ["assets/css/tailwind.css"], 6 | meta: { 7 | title: "Nuxt3 course", 8 | }, 9 | build: { 10 | postcss: { 11 | postcssOptions: { 12 | plugins: { 13 | tailwindcss: {}, 14 | autoprefixer: {}, 15 | }, 16 | }, 17 | }, 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "build": "nuxt build", 5 | "dev": "nuxt dev", 6 | "generate": "nuxt generate", 7 | "preview": "nuxt preview", 8 | "postinstall": "nuxt prepare" 9 | }, 10 | "devDependencies": { 11 | "@nuxt/postcss8": "^1.1.3", 12 | "autoprefixer": "^10.4.8", 13 | "nuxt": "3.0.0-rc.8", 14 | "postcss": "^8.4.16", 15 | "tailwindcss": "^3.1.8" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pages/about.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pages/iphone/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 27 | -------------------------------------------------------------------------------- /pages/iphone/iphone-[name].vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 54 | -------------------------------------------------------------------------------- /pages/login.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | 93 | -------------------------------------------------------------------------------- /pages/profile.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /public/images/iphone-12-pro.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitfumes/nuxtjs-course-2022/3f7bb1dd7c6a95387a6581860dde39eba232054a/public/images/iphone-12-pro.webp -------------------------------------------------------------------------------- /public/images/iphone-12.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitfumes/nuxtjs-course-2022/3f7bb1dd7c6a95387a6581860dde39eba232054a/public/images/iphone-12.webp -------------------------------------------------------------------------------- /public/images/iphone-13-pro.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitfumes/nuxtjs-course-2022/3f7bb1dd7c6a95387a6581860dde39eba232054a/public/images/iphone-13-pro.webp -------------------------------------------------------------------------------- /public/images/iphone-13.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitfumes/nuxtjs-course-2022/3f7bb1dd7c6a95387a6581860dde39eba232054a/public/images/iphone-13.webp -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /server/api/iphones.ts: -------------------------------------------------------------------------------- 1 | export default defineEventHandler(() => { 2 | return ["iphone-12", "iphone-12-pro", "iphone-13", "iphone-13-pro"]; 3 | }); 4 | -------------------------------------------------------------------------------- /server/routes/iphones.ts: -------------------------------------------------------------------------------- 1 | export default defineEventHandler(() => { 2 | return ["iphone-12", "iphone-12-pro", "iphone-13", "iphone-13-pro"]; 3 | }); 4 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./components/**/*.{js,vue,ts}", 5 | "./layouts/**/*.vue", 6 | "./pages/**/*.vue", 7 | "./plugins/**/*.{js,ts}", 8 | "./nuxt.config.{js,ts}", 9 | ], 10 | theme: { 11 | extend: {}, 12 | }, 13 | plugins: [], 14 | }; 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://v3.nuxtjs.org/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | --------------------------------------------------------------------------------