Store Vue
- Download the project or clone it.
- Copy and paste the file
.env.exampleor.env.example.dockerto.env. - If you want to containerize this application and you already have docker and docker-compose installed then run: For development and tests:
docker-compose -f docker-compose.dev.yml up
For production:
docker-compose up -d --build
- Review the settings in the
vite.config.tsfile. - If you are containerizing the app then get the IPAddress with the command:
docker inspect store_node
- Set up a domain in your
etc/hostswith the IPAddress of the containerstore_node:
sudo vim /etc/hosts
###.##.#.# store.dev.com
This template should help get you started developing with Vue 3 in Vite.
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
See Vite Configuration Reference.
npm installnpm run devnpm run buildRun Unit Tests with Vitest
npm run test:unitnpm init vue@latest
✔ Project name: … llaravuel-spa
✔ Add TypeScript? … Yes
✔ Add JSX Support? … No
✔ Add Vue Router for Single Page Application development? … Yes
✔ Add Pinia for state management? … Yes
✔ Add Vitest for Unit Testing? … Yes
✔ Add Cypress for End-to-End testing? … No
✔ Add ESLint for code quality? … No
Done. Now run:
cd llaravuel-spa
nvm install node
npm install
npm run devInstall tailwindcss and its peer dependencies via npm, and then run the init command to generate both tailwind.config.js and postcss.config.js.
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -pNext, add the paths to all of your template files in your tailwind.config.js file.
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Copy and paste asset/css/ folder and update main.ts file with the following line:
// omitted for brevity ...
// import './assets/main.css'
import '@/assets/css/app.css'
// omitted for brevity ...
Copy the following files and paste them in the root folder of the project:
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
// uncomment these lines to containerize
//server: {
// host: '0.0.0.0',
// port: '80'
//},
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
define: {
'process.env': {
// comment this line to containerize
VUE_APP_API_URL: "http://localhost:8000",
// uncomment this line to containerize
//VUE_APP_API_URL: "http://api.laravuel.dev.com"
}
},
test: {
globals: true,
environment: "jsdom",
},
})npm i axios
npm i @fortawesome/fontawesome-svg-core
npm i @fortawesome/free-solid-svg-icons
npm i @fortawesome/[email protected]https://www.npmjs.com/package/@fortawesome/vue-fontawesome/v/3.0.0-5
npm i @vueuse/corenpm i lodashCopy the following folders and paste them in the public folder of the project:
menu/images/