Skip to content

ViMaSter/gdqreminder-mobile

Repository files navigation

GDQ Reminder Mobile App

Local Development

  1. Install Visual Studio Code
  2. Install recommended Visual Studio Code extensions
  3. Clone this repository
  4. Inside your local clone of this repository run nvm install && nvm use && npm install && npm run dev
  5. Open a browser with CORS disabled

    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

Type-Check, Compile and Minify for Production

npm run build

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.