GithubHelp home page GithubHelp logo

tianhe-labs / vue3-template Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 3.1 MB

Vue Vite Template

Home Page: https://vue3-template.v.skyvault.cn/

Shell 0.21% TypeScript 51.65% HTML 0.57% Vue 37.36% Sass 7.40% JavaScript 1.77% Dockerfile 1.04%
naiveui pnpm typescript vite2 vue3 windicss

vue3-template's Introduction

Vue 3 Template on NaiveUI & UnoCSS

NaiveUI

UnoCSS

  • presetUno: Uno

  • presetAttributify: Attributify

  • presetWebFonts: Web Fonts

  • presetIcons: Icons, Iconify

    <!-- example -->
    
    <n-icon class="i-solar:box-bold-duotone"  />
    <!-- n-icon is naiveui built-in component, i- is prefix -->

Features

  • User Authentication: api/user, store/user

  • User Permission: router/guard, hooks/permission

  • Rich icon library: UnoCSS/Iconify

    <!-- example -->
    
    <n-icon class="i-solar:box-bold-duotone"  />
    <!-- n-icon is naiveui built-in component, i- is prefix -->
  • Responsive: CSS(UnoCSS Variants), JS(@vueuse/core useBreakpoints, provide in App.vue)

    // App.vue
    const breakpoints = useBreakpoints(breakpointsTailwind);
    provide('breakpoints', breakpoints);
    
    // child component
    const breakpoints = inject('breakpoints') as any;
  • Theme Mode: light mode & dark mode, combining Arco Design with UnoCSS ensures consistency

    <!-- [light:]<class name> -->
    <div text-primary></div>
    <div light:text-primary></div>
    
    <!-- dark:<class name> -->
    <div dark:text-primary></div>
  • Instant On-demand Atomic CSS: UnoCSS(Attributify supported)

  • Mock Data: mockjs

  • Auto Lint: hucky, lint-staged, code lint(eslint, prettier, stylelint), commit lint(commmitlint)

  • CI/CD: Github Actions

Folder Structure

  • .github/workflows

  • .husky: pre-comment(lint-staged), commit-msg(Conventional Commits)

  • config: Vite Config (Current: Vite@^^4.2.1 installed)

  • mock: mock data in development

  • src

    • assets: static files, eg: json, image, video

    • components: common components, inclues some global components(index.ts)

    • hooks: common hooks, eg: chart-option, loading, logout, permission

    • layouts: common layout components

    • pages: Vue3 page

    • plugins: eg: axios, emitter

    • router: routes, global route guard

    • store: global data store, eg: app(theme, ...), tab-bar(multi page), user(login, userinfo, ...), oss(ali oss sts)

    • utils: tool function, eg: formatX(preset dayjs), hasX, isY, canZ, transformA, index(Unclassifiable fragmentary functions & Unified entry for various types of functions)

    • styles: css, less

    • App.vue: Vue3 entry

    • main.ts: entry

    • settings.json: app settings (only accessible in development)

  • types: global type definition, eg: env.d.ts

    // env.d.ts
    interface ImportMetaEnv {
      readonly VITE_API_BASE: string
      readonly VITE_APP_NAME: string
      readonly VITE_APP_DESC: string
      readonly VITE_APP_COPR: string
      readonly VITE_DEV_PROXY: string[][]
    }
  • .env: common environment, .env.development only in development(gitignore), .env.production only in production(gitignore)

  • .eslintignore

  • .eslintrc: eslint config

  • .gitignore

  • .prettierignore

  • .prettierrc.js: prettier config

  • commitlint.config.js: commitlint config (husky/commit-msg)

  • docker.nginx.template

  • Dockerfile

  • index.html: entry

  • package.json: package

  • package-lock.yaml: pnpm

  • tsconfig.json: Typescript

  • uno.config.ts: UnoCSS

  • vercel.json: Vercel config

CI/CD Based On Github Actions and Coolify

Dokcer ci/cd .github/workflows/docker-deploy.yml add some variables and secrets in repo settings

# secrets
COOLIFY_WEBHOOK: # coolify deploy webhook
COOLIFY_TOKEN: # coolify auth token

Host ci/cd .github/workflows/host-deploy.yml add some variables and secrets in repo settings

# variables
APP_NAME: # app name used to deployed subpath
# secrets
REMOTE_HOST: # ip address of the remote server
REMOTE_USER: # user access to the remote server
PRIVATE_KEY: # private key access to the remote server with pubkey authentication

vue3-template's People

Contributors

evandoz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.