Skip to content

Speckle LCA is a web app intended for early phase design, that connects to Speckle and allows to generat LCA metrics using different LCA providers such as LCAbyg or One Click LCA.

Notifications You must be signed in to change notification settings

linkarkitektur/SpeckleLCA

Repository files navigation

Link IO Speckle LCA App

This template should help get you started developing with Vue 3 in Vite.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit

Lint with ESLint

npm run lint

Firebase Integration Notes

Firebase CLI

Recommended to install Firebase CLI globally:

npm install -g firebase-tools

Firebase Project

Create a new Firebase project in the Firebase console. Add a web app to the project. Copy the Firebase config object from the Firebase console and paste it into src/firebase/config.ts.

Enabling Firebase Features

Enable the minimum following Firebase features in the Firebase console:

  • Authentication
  • Cloud Firestore
  • Cloud Storage
  • Hosting

Initialization

Run the following commands to initialize Firebase in the project:

firebase login
firebase init

Unless you have a specific reason to change the default settings, select the following options:

  • Authentication
  • Firestore
  • Storage
  • Hosting
  • Functions (optional)
  • Emulators (optional)

Sensitive Files

Placeholder recommended .gitignore for repo. Remove as needed:

# Firebase files
.src/firebase/config.ts
.firebase.json
.functions
.firebaserc
.firebase
*-debug.log
.runtimeconfig.json

Sentry Integration Notes

During debug, and posibbly, if not presumeably, there are certain client-side errors that will not be caught by Sentry.

This is because Sentry is not initialized until the app is mounted. To catch these errors, you can use the following code snippet:

window.addEventListener('error', (event) => {
  Sentry.captureException(event.error)
})

Additionally, you can use the following code snippet to catch errors that occur during initialization:

window.addEventListener('unhandledrejection', (event) => {
  Sentry.captureException(event.reason)
})

Finally, browser extensions may interfere with Sentry's ability to capture errors. If you are using an ad blocker, or Brave Shields, for example, you may need to disable it to ensure that Sentry can capture errors.

About

Speckle LCA is a web app intended for early phase design, that connects to Speckle and allows to generat LCA metrics using different LCA providers such as LCAbyg or One Click LCA.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages