Skip to content
Snippets Groups Projects

enh: convert every graphql requests to Hasura relay API

Merged poka requested to merge enh/hasura-relay-api into develop
Files
32
+ 99
84
# Building from source
# Building from Source
Cesium² is an Angular App (Angular with Ionic).
Cesium² is an Angular app built with Ionic. This article will guide you through setting up your environment and building the application.
This article will explain how to install your environment, then build the application.
## Installation Tools and Getting the Sources
## Installation tools, and get sources
1. Install [NVM](https://github.com/nvm-sh/nvm)
1. Install [NVM](https://github.com/nvm-sh/nvm)
2. Install Node v18 (e.g. v18.19.0)
2. Install Node v18 (e.g., v18.19.0):
```bash
nvm install 18.19.0
```
3. Install global dependency:
```bash
```bash
nvm install 18.19.0
npm install -g @ionic/cli @angular/cli
```
```
 
3. Install global dependencies:
 
 
```bash
 
npm install -g @ionic/cli @angular/cli
 
```
 
 
4. Get the sources by cloning the repository:
 
 
```bash
 
git clone ...
 
```
4. Get sources (clone the repo) : `git clone ...`
### Optional: Install Additional Tools
### Install additional tools (optional)
```bash
```bash
sudo apt-get install chromium-browser docker.io
sudo apt-get install chromium-browser docker.io
```
```
## Web build
## Web Build
### For development and test
### Development and Testing
1. Install project's dependencies:
1. Install the project's dependencies:
```bash
cd cesium
npm install
```
2. Check environment configuration:
```bash
 
cd cesium
 
npm install
 
```
 
2. Check the environment configuration:
- Edit the file `src/environment/environment.ts`
- Edit the file `src/environment/environment.ts`
3. Start the app
3. Start the app:
```bash
cd cesium
```bash
npm start
cd cesium
```
npm start
 
```
 
By default, the app should be accessible at [http://localhost:4200](http://localhost:4200)
By default, the app should be accessible at [http://localhost:4200](http://localhost:4200)
To change the default port, use this command instead:
To change the default port, use this command instead:
```bash
cd cesium
ng serve --port [port]
```
### Web build for production
```bash
 
cd cesium
 
ng serve --port [port]
 
```
1. Check environment configuration:
### Production Web Build
 
1. Check the environment configuration:
- Edit the file `src/environment/environment-prod.ts`
- Edit the file `src/environment/environment-prod.ts`
2. Create the release:
2. Create the release:
```bash
npm run build:prod
```
## Android build
```bash
 
npm run build:prod
 
```
 
 
## Android Build
 
 
### Debug APK for Development and Testing
### Build a debug APK, for development and test
1. Install the Android build environment:
1. Install the android build environment:
```bash
```bash
cd sumaris-app/scripts
cd sumaris-app/scripts
./env-android.sh
./env-android.sh
```
```
2. Create a debug APK file:
2. Create a debug APK file:
```bash
cd sumaris-app/scripts
./build-android.sh
```
### Build a release APK, for production
```bash
 
cd sumaris-app/scripts
 
./build-android.sh
 
```
1. Check environment configuration:
### Release APK for Production
 
1. Check the environment configuration:
- Edit the file `src/environment/environment-prod.ts`
- Edit the file `src/environment/environment-prod.ts`
2. Create a release APK file:
2. Create a release APK file:
```bash
cd sumaris-app/scripts
./release-android.sh
```
## Useful links
```bash
 
cd sumaris-app/scripts
 
./release-android.sh
 
```
- Ionic 4 colors: https://www.joshmorony.com/a-primer-on-css-4-variables-for-ionic-4/
## Useful Links
- Migration to Ionic 4 tips: https://www.joshmorony.com/my-method-for-upgrading-from-ionic-3-to-ionic-4/
- Signing Android APK: See doc at
- [Ionic 4 Colors](https://www.joshmorony.com/a-primer-on-css-4-variables-for-ionic-4/)
https://www.c-sharpcorner.com/article/create-ionic-4-release-build-for-android/
- [Migration to Ionic 4 Tips](https://www.joshmorony.com/my-method-for-upgrading-from-ionic-3-to-ionic-4/)
 
- [Signing Android APK](https://www.c-sharpcorner.com/article/create-ionic-4-release-build-for-android/)
## Troubleshooting
## Troubleshooting
### Error on datasource, or angular material table
### Error on Datasource or Angular Material Table
- Checkout the project https://github.com/e-is/angular4-material-table
1. Check out the project:
```bash
git clone https://github.com/e-is/angular4-material-table.git
```bash
cd angular4-material-table
git clone https://github.com/e-is/angular4-material-table.git
```
cd angular4-material-table
- Build the project:
```
```bash
npm install
2. Build the project:
npm run build
cp package*.json ./dist
```bash
```
npm install
- Link to your local NPM repo:
npm run build
```bash
cp package*.json ./dist
cd dist
```
npm link
```
3. Link to your local NPM repo:
- Use it from Sumaris project:
```bash
```bash
cd <sumaris_app_root>
cd dist
npm link angular4-material-table
npm link
```
```
 
 
4. Use it from the Sumaris project:
 
 
```bash
 
cd <sumaris_app_root>
 
npm link angular4-material-table
 
```
Loading