Coder Social home page Coder Social logo

aaronksaunders / starter-nuxt-ionic-tailwind-firebase Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 430 KB

Nuxt 3 Ionic Tailwind Firebase Minimal Starter

Home Page: https://youtu.be/TNzgPdkr9HM

Vue 43.97% TypeScript 12.17% Swift 33.65% Ruby 10.21%
capacitorjs firebase firebase-auth ionic-framework mobile-app mobile-development nuxt nuxtjs tailwindcss

starter-nuxt-ionic-tailwind-firebase's Introduction

Nuxt 3 Ionic Tailwind Firebase Minimal Starter

Look at the Nuxt 3 documentation to learn more.

changes package.json for using ionic extension and build apps for mobile devices

  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi generate",
    "ionic:build": "npm run build",
    "ionic:serve": "npm run dev"
  },

changes nuxt.config.ts for using ionic extension and build apps for mobile devices, you must set ssr:false and auth:false for vurefire

export default defineNuxtConfig({
  modules: ["@nuxtjs/ionic", "@nuxtjs/tailwindcss", "nuxt-vuefire"],
  ssr: false,
  vuefire: {
    auth: false,
    config: {
      apiKey: process.env.FIREBASE_API_KEY,
      projectId: process.env.FIREBASE_PROJECT_ID,
      appId: process.env.FIREBASE_APP_ID,
    },
  },
  ionic: {
    css: {
      utilities: true,
    },
  },
});

changes capacitor.config.ts for using ionic extension and build apps for mobile devices, you must set webDir to dist

import { CapacitorConfig } from '@capacitor/cli'

const config: CapacitorConfig = {
  appId: 'io.ionic.starter',
  appName: 'nuxt-ionic-playground',
  webDir: 'dist',
  bundledWebRuntime: false,
}

export default config

Resolving Firebase Issue

Due to the firebase issue on Capacitor, I wrote my own getAuth composable that must be used when running on device

import {
  indexedDBLocalPersistence,
  initializeAuth,
} from "firebase/auth";
import { getApp } from "firebase/app";
export const useFbAuth = () => {
  let auth;
  console.log("use persistence");
  auth = initializeAuth(getApp(), {
    persistence: indexedDBLocalPersistence,
  });
  return auth;
};

starter-nuxt-ionic-tailwind-firebase's People

Contributors

aaronksaunders avatar

Stargazers

 avatar

Watchers

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