ViMaSter / gdqreminder-mobile

Android app using Vue + Capacitor to keep track of GamesDoneQuick events
https://play.google.com/store/apps/details?id=ke.mahn.gdqreminder
GNU General Public License v3.0
4 stars 0 forks source link
capacitor typescript vscode vue

GDQ Reminder Mobile App

Local Development

  1. Install Visual Studio Code
  2. Install recommended Visual Studio Code extensions
  3. Clone this repository
  4. Run inside your clone of this repository:
    nvm install && nvm use && npm install && npm run dev
  5. Open a browser with CORS disabled. Example for Chrome:

    --disable-web-security --user-data-dir="/tmp/google"

  6. Visit http://localhost:4437

[!IMPORTANT]
The mobile app uses native HTTP requests which allows accessing CORS-protected content without any restrictions. The only way to mimic this behavior in a browser is to disable CORS.

On-Device Development

  1. Install Android Studio using default settings
  2. Pair your device with Android Studio
  3. Complete all steps for Local Development
  4. Run npm run launch


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.

Faking a running marathon

Appending #date= followed by a string compatible for the new Date() constructor can be used to fake a current point in time. Per real 1 second, 20 minutes will pass in the app.

Example: #date=2024-01-18%2000:00:00 would result in the middle of AGDQ2024.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Playwright

# run once:
npx playwright install

# run to execute tests
npm run test:e2e

Lint with ESLint

npm run lint

This project is tested with Browserstack.