Skip to content

Commit

Permalink
ASA Mobile: Capacitor Skeleton (#4214)
Browse files Browse the repository at this point in the history
- Adds a capacitor app using react/vite that renders a basic `FBAMap` with pmtiles layers as well as a header and set of tabs.
- Application code is mostly copied from web
  • Loading branch information
conbrad authored Jan 23, 2025
1 parent 5b0a7f8 commit 7dbdfdf
Show file tree
Hide file tree
Showing 54 changed files with 9,620 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,11 @@ renv
# Node Version Management
web/.nvmrc
node_modules


# expo mobile dev
.expo
build
Pods
.xcode.env.local
*.xcuserstate
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sonar.test.exclusions=*.feature
sonar.tests.inclusions=**/*.test.tsx

# Exclude duplication in fba tests due to many similar calculation numbers, ignore sample code as it's temporary, ignore sfms entrypoint, ignore util tests, ignore temporary fwi folder
sonar.cpd.exclusions=api/app/tests/fba_calc/*.py, api/app/weather_models/wind_direction_sample.py, web/src/features/moreCast2/util.test.ts, web/src/features/moreCast2/components/gridComponentRenderer.test.tsx, web/src/utils/fwi
sonar.cpd.exclusions=api/app/tests/fba_calc/*.py, api/app/weather_models/wind_direction_sample.py, web/src/features/moreCast2/util.test.ts, web/src/features/moreCast2/components/gridComponentRenderer.test.tsx, web/src/utils/fwi, mobile/asa-go/src/*

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
24 changes: 24 additions & 0 deletions mobile/asa-go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
31 changes: 31 additions & 0 deletions mobile/asa-go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ASA Go

Capacitor app using react/vite.

## Building

1. `yarn install`
2. `yarn build`

## Setup live reload

1. Install ionic CLI and native run for live reload with: `npm install -g @ionic/cli native-run`

### Building/Running iOS

1. Make sure xcode is installed with `xcode-select --install`
2. Go to `mobile/asa-go/ios`
3. Install/update cocoapods with `gem install cocoapods`
4. Go to `mobile/asa-go`
5. Run `yarn cap sync` to synchronize app with native platforms
6. Build and run with live reload: `ionic cap run ios -l --external`

### Building/Running Android

1. Install Android Studio (Jetbrains Toolbox recommended: https://www.jetbrains.com/toolbox-app/)
2. Find where the Android SDK is installed
- With Jetbrains Toolbox it should be /Users/<user>/Library/Android/sdk/
- Set `$ANDROID_HOME` to the path of the Android SDK
3. Go to `mobile/asa-go`
4. Run `yarn cap sync` to synchronize app with native platforms
5. Build and run with live reload: `ionic cap run android -l --external`
9 changes: 9 additions & 0 deletions mobile/asa-go/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'asa-go',
webDir: 'dist'
};

export default config;
28 changes: 28 additions & 0 deletions mobile/asa-go/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions mobile/asa-go/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>ASA Go</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions mobile/asa-go/ionic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "asa-go",
"integrations": {
"capacitor": {}
},
"type": "react-vite"
}
13 changes: 13 additions & 0 deletions mobile/asa-go/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
App/build
App/Pods
App/output
App/App/public
DerivedData
xcuserdata

# Cordova plugins for Capacitor
capacitor-cordova-ios-plugins

# Generated Config files
App/App/capacitor.config.json
App/App/config.xml
Loading

0 comments on commit 7dbdfdf

Please sign in to comment.