├── .gitignore ├── README.md ├── app.vue ├── assets └── main.css ├── components ├── GoBack.vue ├── IconBack.vue ├── IconChevronDown.vue ├── IconChevronUp.vue ├── IconEdit.vue ├── IconLink.vue ├── IconLogout.vue ├── IconPlusCircle.vue ├── IconRefresh.vue ├── IconSearch.vue ├── IconSquaresPlus.vue ├── IconTrash.vue ├── SearchInput.vue ├── TableTh.vue └── TheMainNav.vue ├── formkit.config.ts ├── layouts ├── centered.vue ├── default.vue └── plain.vue ├── nuxt.config.ts ├── package-lock.json ├── package.json ├── pages ├── index.vue ├── links │ ├── [id].vue │ ├── create.vue │ └── index.vue ├── login.vue ├── logout.vue ├── me.vue └── register.vue └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log* 3 | .nuxt 4 | .nitro 5 | .cache 6 | .output 7 | .env 8 | dist 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # "Laravel Backends for Vue.js 3" Front End Source Code 2 | 3 | [![](https://vueschool.io/media/1b4b17d7dfaf4a708fbd160ba767b6d8/laravel-backends-for-vue-js-3-not-transparent.jpg)](https://vueschool.io/courses/laravel-backends-for-vue-js-3) 4 | 5 | This repository contains the front end source code for the course: "Laravel Backends for Vue.js 3". 6 | 7 | The main branch is the starting point for the course (the boilerplate code) and the solutions branch 8 | includes commits for each lesson. 9 | 10 | ## Setup 11 | 12 | Make sure to install the dependencies: 13 | 14 | ```bash 15 | # yarn 16 | yarn install 17 | 18 | # npm 19 | npm install 20 | 21 | # pnpm 22 | pnpm install --shamefully-hoist 23 | ``` 24 | 25 | ## Development Server 26 | 27 | Start the development server on http://localhost:3000 28 | 29 | ```bash 30 | npm run dev 31 | ``` 32 | 33 | ## Production 34 | 35 | Build the application for production: 36 | 37 | ```bash 38 | npm run build 39 | ``` 40 | 41 | Locally preview production build: 42 | 43 | ```bash 44 | npm run preview 45 | ``` 46 | 47 | Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. 48 | -------------------------------------------------------------------------------- /app.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /assets/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | @apply bg-gray-200; 3 | } 4 | h1 { 5 | @apply text-3xl font-thin mb-3; 6 | } 7 | 8 | .btn { 9 | text-decoration: none; 10 | background: var(--fk-bg-submit); 11 | color: var(--fk-color-submit); 12 | font-size: var(--fk-font-size-button); 13 | border-radius: var(--fk-border-radius); 14 | cursor: pointer; 15 | display: inline-flex; 16 | width: auto; 17 | justify-content: center; 18 | padding: var(--fk-padding-button); 19 | margin: var(--fk-margin-button); 20 | position: relative; 21 | transition: filter 0.25s; 22 | border: 1px solid transparent; 23 | line-height: var(--fk-line-height-button); 24 | } 25 | table { 26 | @apply rounded overflow-hidden; 27 | } 28 | table thead { 29 | @apply text-left bg-gray-800 text-white rounded-t; 30 | } 31 | table th { 32 | @apply font-normal p-2; 33 | } 34 | table td { 35 | border-bottom: 1px solid; 36 | @apply p-3 border-gray-300; 37 | } 38 | 39 | button.formkit-input, 40 | .btn { 41 | @apply bg-gray-800 !important; 42 | } 43 | 44 | /** 45 | Apply formkit like styles to non formkit inputs 46 | this way it looks the same before and after we use formkit 47 | **/ 48 | form:not(.formkit-form) { 49 | margin-bottom: 10px; 50 | max-width: var(--fk-max-width-input); 51 | } 52 | label:not(.formkit-label) { 53 | margin: var(--fk-margin-outer); 54 | display: block; 55 | } 56 | label > div { 57 | display: block; 58 | margin: var(--fk-margin-label); 59 | padding: var(--fk-padding-label); 60 | font-family: var(--fk-font-family-label); 61 | font-size: var(--fk-font-size-label); 62 | font-weight: var(--fk-font-weight-label); 63 | line-height: var(--fk-line-height-label); 64 | } 65 | input:not(.formkit-input) { 66 | display: block; 67 | width: 100%; 68 | border-radius: var(--fk-border-radius); 69 | padding: var(--fk-padding-input); 70 | font-family: var(--fk-font-family-input); 71 | font-size: var(--fk-font-size-input); 72 | font-weight: var(--fk-font-weight-input); 73 | line-height: var(--fk-line-height-input); 74 | background-color: var(--fk-bg-input); 75 | color: var(--fk-color-input); 76 | position: relative; 77 | box-shadow: var(--fk-border-box-shadow); 78 | border-radius: var(--fk-border-radius); 79 | display: flex; 80 | align-items: center; 81 | } 82 | -------------------------------------------------------------------------------- /components/GoBack.vue: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /components/IconBack.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconChevronDown.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconChevronUp.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconEdit.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconLink.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconLogout.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconPlusCircle.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconRefresh.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconSearch.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconSquaresPlus.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/IconTrash.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /components/SearchInput.vue: -------------------------------------------------------------------------------- 1 | 10 | 27 | -------------------------------------------------------------------------------- /components/TableTh.vue: -------------------------------------------------------------------------------- 1 | 19 | 35 | -------------------------------------------------------------------------------- /components/TheMainNav.vue: -------------------------------------------------------------------------------- 1 | 20 | 25 | -------------------------------------------------------------------------------- /formkit.config.ts: -------------------------------------------------------------------------------- 1 | import { DefaultConfigOptions } from "@formkit/vue"; 2 | 3 | export default { 4 | theme: "genesis", 5 | } as DefaultConfigOptions; 6 | -------------------------------------------------------------------------------- /layouts/centered.vue: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /layouts/plain.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /nuxt.config.ts: -------------------------------------------------------------------------------- 1 | // https://nuxt.com/docs/api/configuration/nuxt-config 2 | export default defineNuxtConfig({ 3 | modules: ["@vueuse/nuxt", "@nuxtjs/tailwindcss", "@formkit/nuxt"], 4 | css: ["@/assets/main.css"], 5 | tailwindcss: { 6 | config: { 7 | content: ["./node_modules/laravel-vue-pagination/**/*.vue"], 8 | }, 9 | }, 10 | runtimeConfig: { 11 | public: { 12 | appURL: "http://localhost", 13 | }, 14 | }, 15 | routeRules: { 16 | "/profiles/*": { swr: true }, 17 | "/*": { ssr: false }, 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 | "@nuxtjs/tailwindcss": "^6.2.0", 12 | "nuxt": "3.0.0" 13 | }, 14 | "dependencies": { 15 | "@formkit/icons": "^1.0.0-beta.14", 16 | "@formkit/nuxt": "^1.0.0-beta.14", 17 | "@formkit/themes": "^1.0.0-beta.14", 18 | "@formkit/vue": "^1.0.0-beta.14", 19 | "@vueuse/nuxt": "^9.11.0", 20 | "axios": "^1.2.3", 21 | "laravel-vue-pagination": "^4.0.0", 22 | "nanoid": "^4.0.0", 23 | "query-string": "^8.1.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /pages/links/[id].vue: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /pages/links/create.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /pages/links/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 108 | -------------------------------------------------------------------------------- /pages/login.vue: -------------------------------------------------------------------------------- 1 | 6 | 30 | -------------------------------------------------------------------------------- /pages/logout.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /pages/me.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /pages/register.vue: -------------------------------------------------------------------------------- 1 | 6 | 39 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://nuxt.com/docs/guide/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | --------------------------------------------------------------------------------