Skip to content

Commit

Permalink
use capacitor
Browse files Browse the repository at this point in the history
  • Loading branch information
bastyen committed Mar 25, 2022
1 parent 9decf8e commit 2e01472
Show file tree
Hide file tree
Showing 154 changed files with 18,261 additions and 24,491 deletions.
17 changes: 17 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": ["Page", "Component"]
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
}
51 changes: 18 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

*~
*.sw[mnpcod]
*.log
.tmp
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*

.idea/
.ionic/
.sourcemaps/
.sass-cache/
.tmp/
.versions/
coverage/
www/
node_modules/
tmp/
temp/
platforms/
plugins/
plugins/android.json
plugins/ios.json
$RECYCLE.BIN/

.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
$RECYCLE.BIN/

cypress/videos
cypress/screenshots

ios/
android/

.angular/
*.log
log.txt
npm-debug.log*

config/
/.angular
/.idea
/.ionic
/.sass-cache
/.sourcemaps
/.versions
/.vscode
/coverage
/dist
/node_modules
/platforms
/plugins
/www
105 changes: 11 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Mobile application of _Geotrek Rando_ (http://geotrek.fr).
# INSTALLATION

```
npm install -g @ionic/[email protected]
npm install -g [email protected]
npm install -g [email protected]
git clone [email protected]:GeotrekCE/Geotrek-mobile.git
cd Geotrek-mobile
npm install
Expand All @@ -16,119 +13,39 @@ npm install
[iOS environment setup](https://ionicframework.com/docs/installation/ios)\
[Android environment setup](https://ionicframework.com/docs/installation/android)

# RUN THE APP

_Minimum requirements : Fill in 'onlineBaseUrl' in 'src/environments/environment.ts'_ with your personal api url (the one you can create [here](https://geotrek.readthedocs.io/en/master/synchronization.html#geotrek-mobile-app-v3) and configure [here](https://github.com/GeotrekCE/Geotrek-rando/blob/master/docs/http-server.md))
# BUILD RELEASE APP

## BROWSER
_Minimum requirements : Fill in 'onlineBaseUrl' in 'src/environments/environment.prod.ts'_ with your personal api url

```
ionic serve
npx ionic build --configuration production
```

## iOS

```
ionic cordova run ios
npx cap add ios
```

## Android

```
ionic cordova run android
```

# BUILD RELEASE APP

_Minimum requirements : Fill in 'onlineBaseUrl' in 'src/environments/environment.prod.ts'_ with your personal api url

## iOS

```
npm run build:ios
```

## Android

```
npm run build:android
npx cap add android
```

# CUSTOMIZATION OPTIONS

## config.xml

App id

```
<widget id="io.geotrek.starter" ...>
```

App name

```
<name>Geotrek Starter</name>
```

## src/environments/environment.ts & environment.prod.ts

You can overwrite a lot of options inside these files
AppName (header of the app) , availableLanguage, api url, map options and more

_environment.ts will be use for development
environment.prod.ts will be use for release app_

## src/assets/i18n

You can find all the internationalization ressources here (by default Fr and En)

## src/assets/map/icons/

Local icons to display on the map, like departure or parking icon
capacitor.config.ts

## src/theme/variables.scss
src/environments/environment.ts & environment.prod.ts

Colors that will be used
_The most important point here is the primary color to customize your application_
src/theme/variables.scss

## icons and splashscreen

- The source image for icons should ideally be at least 1024×1024px and located in resources/icon.png

- The source image for splash screens should ideally be at least 2732×2732px and located in resources/splash.png. For best results, the splash screen's artwork should roughly fit within a square (1200×1200px) at the center of the image.

Then you have to run

```
ionic cordova resources
```
src/assets/i18n/

## Firebase Analytics Configuration
src/assets/map/icons/

To use Firebase analytics, you had to create a Firebase App

- Then store google-services.json and GoogleService-Info.plist in ./Analytics/

- Set true to useFirebase variable in environment files

## Remove Firebase Analytics

To build the app without Firebase you had to

- Remove these plugins

```
ionic cordova plugin rm cordova-plugin-firebase-analytics
ionic cordova plugin rm cordova-android-play-services-gradle-release
ionic cordova plugin rm cordova-support-android-plugin
```

- In config.xml, remove these resource file lines

```
<resource-file src="analytics/google-services.json" target="app/google-services.json" />
<resource-file src="analytics/GoogleService-Info.plist" />
```
resources/

# End-to-end testing

Expand Down
Loading

0 comments on commit 2e01472

Please sign in to comment.