commit d4d7bf8378e508dc30f0a110bd9f892b3e7f7b1c Author: Fadhli Syaifullah Date: Tue Jun 4 19:23:05 2024 +0700 setup project diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..cecbe20 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_BASE_API_URL=https://erp.smgdev.top/api \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..d0b3f16 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-tailwindcss"] +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..0bfecb0 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Vue 3 + TypeScript + Vite + +This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..4c6c10b --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "asiagolf", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vue-tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@fontsource/poppins": "^5.0.14", + "@tailwindcss/container-queries": "^0.1.1", + "@tanstack/vue-query": "^5.40.0", + "@vee-validate/zod": "^4.13.0", + "@vueuse/core": "^10.10.0", + "axios": "^1.7.2", + "pinia": "^2.1.7", + "vee-validate": "^4.13.0", + "vue": "^3.4.21", + "vue-router": "4", + "vuetify": "^3.6.8", + "zod": "^3.23.8" + }, + "devDependencies": { + "@mdi/font": "^7.4.47", + "@types/node": "^20.14.0", + "@vitejs/plugin-vue": "^5.0.4", + "autoprefixer": "^10.4.19", + "postcss": "^8.4.38", + "prettier": "^3.3.0", + "prettier-plugin-tailwindcss": "^0.6.1", + "tailwind-scrollbar": "^3.1.0", + "tailwindcss": "^3.4.3", + "typescript": "^5.2.2", + "vite": "^5.2.0", + "vue-tsc": "^2.0.6" + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..2e7af2b --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..7bb2e3b Binary files /dev/null and b/public/favicon.ico differ diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..96489d2 --- /dev/null +++ b/shell.nix @@ -0,0 +1,11 @@ +{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/23.11.tar.gz") {} }: + +pkgs.mkShell { + shellHook = '' + alias cls=clear + ''; + + buildInputs = with pkgs; [ + bun + ]; +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..d418bd7 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,3 @@ + diff --git a/src/assets/images/logo-black.png b/src/assets/images/logo-black.png new file mode 100644 index 0000000..c673098 Binary files /dev/null and b/src/assets/images/logo-black.png differ diff --git a/src/assets/images/logo-white.jpg b/src/assets/images/logo-white.jpg new file mode 100644 index 0000000..ae8845b Binary files /dev/null and b/src/assets/images/logo-white.jpg differ diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..c0df87d --- /dev/null +++ b/src/main.ts @@ -0,0 +1,37 @@ +import { createApp } from "vue"; +import { createPinia } from "pinia"; +import { VueQueryPlugin } from "@tanstack/vue-query"; + +// Vuetify +import "vuetify/styles"; +import { createVuetify } from "vuetify"; +import { aliases, mdi } from "vuetify/iconsets/mdi"; +import * as components from "vuetify/components"; +import * as directives from "vuetify/directives"; + +import App from "@/App.vue"; + +import "@mdi/font/css/materialdesignicons.css"; +import "@fontsource/poppins"; +import "@/style.css"; + +const vuetify = createVuetify({ + components, + directives, + icons: { + defaultSet: "mdi", + aliases, + sets: { + mdi, + }, + }, +}); + +const pinia = createPinia(); + +const app = createApp(App); + +app.use(vuetify); +app.use(pinia); +app.use(VueQueryPlugin); +app.mount("#app"); diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..ac27391 --- /dev/null +++ b/src/style.css @@ -0,0 +1,7 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +body { + font-family: "Poppins"; +} diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..7fe0cb7 --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1,8 @@ +/// +interface ImportMetaEnv { + readonly VITE_BASE_API_URL: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..2217ce8 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,11 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], + theme: { + extend: {}, + }, + plugins: [ + require("@tailwindcss/container-queries"), + require("tailwind-scrollbar"), + ], +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..44ce8f1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..97ede7e --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true + }, + "include": ["vite.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..11fc998 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,23 @@ +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; +import path from "path"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), + }, + }, + server: { + proxy: { + "/api": { + target: "https://erp.smgdev.top/api", + changeOrigin: true, + secure: false, + rewrite: (path) => path.replace(/^\/api/, ""), + }, + }, + }, +});