GithubHelp home page GithubHelp logo

mjkodkks / nuxt3-vitesse-dkks Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 2.33 MB

clone of [vitesse] https://github.com/antfu/vitesse-nuxt3 for self-update, personal use on my future project

Home Page: https://vitesse-nuxt3-dkks.netlify.app

License: MIT License

Vue 67.23% TypeScript 24.93% CSS 0.44% Dockerfile 4.13% Shell 0.88% Batchfile 0.89% JavaScript 1.50%
nuxt nuxtjs vue boilerplate-template nuxt3-starter tailwindcss

nuxt3-vitesse-dkks's Introduction

Netlify Status

Vitesse for Nuxt 3 By DKKs ๐Ÿ‘‹๐Ÿป

๐Ÿ–ฅ DEMO ๐Ÿ–ฅ

Or try edit on Stackblitz

Or CodeSandbox

Open in CodeSandbox

Features

  • ๐Ÿ’š Nuxt 3 - SSR, ESR, File-based routing, components auto importing, modules, etc.

  • โšก๏ธ Vite - Instant HMR

  • ๐ŸŽจ TailwindCSS - A utility-first CSS framework packed.

  • ๐Ÿ˜ƒ Thousands of icons, one unified framework, powered by iconify

  • ๐Ÿ”ฅ The <script setup> syntax

  • ๐Ÿ State Management via Pinia, see ./stores/user.ts

  • ๐Ÿ“‘ Layout system

  • ๐Ÿ“ฅ APIs auto importing - for Composition API, VueUse and custom composables.

  • ๐ŸŽ Zero-config cloud functions and deploy

  • ๐Ÿฆพ TypeScript, of course

  • ๐Ÿฉป Nuxt Devtools npx nuxi@latest devtools enable

  • ๐Ÿ“ฑ Nuxtr Use nuxt commands with a few clicks.

  • ๐ŸŒ i18n Internationalization for Nuxt Applications. see ./locales

Plugins

Nuxt Modules

  • VueUse - collection of useful composition APIs.
  • ColorMode - dark and Light mode with auto detection made easy with Nuxt.
  • Pinia - intuitive, type safe, light and flexible Store for Vue.

IDE

We recommend using VS Code with Volar to get the best experience (You might want to disable Vetur if you have it).

  • Nuxtr An extension offering commands and tools to make your experience with Nuxt.js more pleasant.

Dev tools

Improve your DX, finding bugs, tracking data flow and pinia

Variations Original

GitHub Template

Create a repo from this template on GitHub.

for original Create a repo from this template on GitHub.

After fork this

Development

pnpm i
pnpm dev

Environment Variables and Multiple Environments.

For multiple environments can use .env and .env.prod or .env.whatever

example :

  1. create .env and .env.prod in root of project.
  • .env
WHAT_ENV="env_dev"
  • .env.prod
WHAT_ENV="env_prod"
  1. Add to nuxt.config.ts runtimeConfig -> public in this case will expose your env. for private or secret please read https://nuxt.com/docs/guide/going-further/runtime-config
  ...,
  runtimeConfig: {
    public: {
      WHAT_ENV: process.env.WHAT_ENV || 'env_dev'
    }
  },
  ...
  1. Use in project by composables.
<script setup lang="ts">
const config = useRuntimeConfig()
const whatEnv = config.public.WHAT_ENV
</script>

<template>
  <div> {{ whatEnv }} </div>
</template>
  1. run this command.
pnpm run start:dev
## equal (=)
nuxi dev --dotenv .env

or

pnpm run start:prod
## equal (=)
nuxi dev --dotenv .env.prod

Deployment

full documentation

Mode (ssr) nuxt.config.ts command multiple environment
SSR true pnpm build pnpm build --dotenv .env.prod
SPA false pnpm generate pnpm generate --dotenv .env.prod
SSG true pnpm generate pnpm generate --dotenv .env.prod

For SSR (server-side rendering)

pnpm build

For SPA (single page application)

  • nuxt.config.ts
{
    ... ,
    ssr: false,
    ... ,
}

then

pnpm generate

For SSG (static site generation)

  • nuxt.config.ts
{
    ... ,
    ssr: true,
    ... ,
}

then

pnpm generate

Docker

If you use Docker for standalone server

I already create Dockerfile and docker-compose.yml for easy deployment in (SSR Mode)

SPA, SSG please comment pnpm run build and uncomment RUN pnpm run generate

  • Dockerfile
# build the project
# RUN pnpm run build
# for spa and ssg
RUN pnpm run generate

easy to use via run ./deploy-prod.sh file (Linux or Mac OS). For windows ./deploy-prod.bat

or use inline command like this

docker-compose down && docker-compose up -d --build && docker image prune --force --filter "dangling=true"

I don't like pnpm ๐Ÿ˜ต

You can use npm or yarn to new package manager for this project ๐Ÿ‘ .

  1. search all 'pnpm' keyword in project then remove all code and config.

  2. try npm install && npm run dev or yarn install && yarn dev

  3. deploy for ssr npm run build or yarn build and for csr, ssg npm run generate or yarn generate

Update nuxt version by yourself ๐Ÿ“ˆ

npx nuxi upgrade --force

if version can't change

Update package.json (pnpm example)

pnpm update nuxt

then

npx nuxi upgrade --force

for clean your lock file and node_modules.

** Nuxt Version Here

latest version: Version

Clone to local

If you prefer to do it manually with the cleaner git history

npx degit mjkodkks/nuxt3-vitesse-dkks my-nuxt3-app
cd my-nuxt3-app
pnpm i # If you don't have pnpm installed, run: npm install -g pnpm

nuxt3-vitesse-dkks's People

Contributors

mjkodkks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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.