Skip to content

Latest commit

 

History

232 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuxTemplate

Landing

Nuxt + Typescript + Tailwind + Tauri Template

  • 📦 SSR
  • 🖼️ OG Tags
  • 🚀 PWA
  • ✋ Push Notification
  • 🌙 Light/Dark Mode
  • 🐋 Containerized
  • 🪄 CI/CD (Github Action)
  • 🎭 Authentication (OAuth 2.0)
  • ⚡️ API Route Caching
  • 📐 Analytics

Todo

  • Add Testing

External Dependencies

  • gitleaks

Clone Template

Clone the template

bunx giget@latest gh:shba007/nuxtemplate#<branch> <project>

Change Placeholder Value

In docker-compose.yml

  • name
  • image
  • port

In package.json change the following

  • name
  • description
  • docker:build
  • docker:start

In nuxt.config.ts change the following

  • site
    • url
    • name
  • pwa
    • manifest
      • name
      • short_name
      • description
      • theme_color
      • background_color

In tailwind.config.ts change the following

  • fontFamily
    • head
    • body
  • colors
    • light
    • dark
    • primary
    • success
    • warning
    • alert

In src-tauri/Cargo.toml change the following

  • name
  • description
  • repository

In src-tauri/tauri.conf.json change the following

  • productName
  • identifier
  • app
    • windows
      • title

In .github\workflows\deploy.yml change the following

In github registry add Repo or Org Vars following

  • Vars
    • USERNAME
    • GH_PAT
    • TAURI_SIGNING_PRIVATE_KEY: Content of ./src-tauri/app-sign.key
    • TAURI_SIGNING_PRIVATE_KEY_PASSWORD: Key password (leave empty if none)

Change the Icons and Screenshots

dir public/pwa

Generate Logo

bun tauri icon ./public/logo.svg

Reinitialize Android

rm -rf src-tauri/gen/android bun tauri android init

Signing Config

cd src-tauri/gen/android

keytool -genkey -v -keystore release-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias release-key

cat ./release-keystore.jks | base64

goto src-tauri/gen/android/app/build.gradle.kts

import java.io.FileInputStream

defaultConfig {
...
}
signingConfigs {
    create("release") {
        val keystorePropertiesFile = rootProject.file("keystore.properties")
        val keystoreProperties = Properties()
        if (keystorePropertiesFile.exists()) {
            keystoreProperties.load(FileInputStream(keystorePropertiesFile))
        }

        keyAlias = keystoreProperties["keyAlias"] as String
        keyPassword = keystoreProperties["password"] as String
        storeFile = file(keystoreProperties["storeFile"] as String)
        storePassword = keystoreProperties["password"] as String
    }
}

getByName("release") {
    isMinifyEnabled = true
    signingConfig = signingConfigs.getByName("release")
...
}

put release-keystore.jks, keystore.properties into src-tauri/gen/android

Desktop Updater Signing Config

1. Generate Keypair

bun x tauri signer generate -w ./src-tauri/app-sign.key

2. Configure src-tauri/tauri.conf.json

{
  "bundle": {
    "createUpdaterArtifacts": true
  },
  "plugins": {
    "updater": {
      "pubkey": "YOUR_PUBLIC_KEY_HERE",
      "endpoints": ["https://github.com/<OWNER>/<REPO>/releases/latest/download/latest.json"]
    }
  }
}

Development Server

Start the development server on http://localhost:3000:

How to Deploy

  1. Initialize Swarm on the Manager Node
docker swarm init --advertise-addr <MANAGER-IP>
  1. Join Worker Nodes to the Swarm
docker swarm join --token <WORKER-TOKEN> <MANAGER-IP>:2377
  1. Check Node Status
docker node ls
  1. Create a docker volume
docker volume create \
  --name nuxtemplate_static \
  --driver local \
  --opt type=none \
  --opt device=~/shba007/nuxtemplate/static \
  --opt o=bind
  1. Use Docker Stack to deploy multi-container application
upload static into /root/nuxtemplate
  1. Scale service
docker service scale nuxtemplate_app=2
  1. Verify
docker service ls
docker service ps nuxtemplate_app

License

Published under the MIT license.

About

Nuxt + Typescript + Tailwind + Tauri Template

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages