Skip to content

wipdevtest/ionic-angular-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ionic Reference Application

A reference implementation of a mobile application using Ionic Angular and containerized infrastructure. This project demonstrates best practices for mobile app development with a focus on automated builds and deployments.

Features

  • Ionic Angular: Built with the latest Ionic and Angular frameworks
  • Docker Integration: Complete containerized development environment
  • CI/CD Pipeline: Automated build and deployment with Fastlane
  • Best Practices: Following industry best practices for mobile development
  • Documentation: Comprehensive documentation for reference

Requirements

  • Docker & Docker Compose
  • Node.js (for development outside Docker)
  • Xcode (for iOS final builds)
  • Android Studio (optional, for Android development outside Docker)

Quick Start

Using Docker (Recommended)

To start the development environment:

docker-compose up -d

This will start the Ionic development server on port 8100. Access it at http://localhost:8100

To build Android APK:

docker-compose exec android-builder bash -c "cd /app && fastlane android debug"

Local Development

If you prefer to develop locally:

npm install
ionic serve

Development Workflow

Project Structure

The project follows the standard Ionic Angular structure with additional configuration for containerized development:

  • src/ - Application source code
  • docker-compose.yml - Docker Compose configuration
  • Dockerfile - Docker container definition
  • fastlane/ - Fastlane configuration for automated builds and deployments

Docker Integration

The Docker setup includes:

  1. Development Container: Provides a consistent development environment with all required tools
  2. Android Builder Container: For building Android APKs and AABs
  3. iOS Integration: For integrating with local iOS builds using Fastlane

Android Development

Android development can be done completely within Docker containers. The Android container includes:

  • Android SDK
  • Gradle build system
  • Fastlane for automated builds

For running with an Android emulator on your Mac:

# First, start the emulator on your Mac
./start-host-emulator.sh

# Then run the app in Docker connected to your Mac's emulator
./run-android.sh

See the Android Emulator Integration Guide for detailed instructions.

iOS Development

iOS builds require macOS, so final iOS builds are done outside the container:

  1. Develop and test in Docker
  2. For final builds and deployment to TestFlight/App Store:
    npx cap sync ios
    cd ios/App
    fastlane ios beta # or fastlane ios release

Deployment

Android

# Deploy to Google Play internal testing
docker-compose exec android-builder bash -c "cd /app && fastlane android beta"

# Deploy to Google Play production
docker-compose exec android-builder bash -c "cd /app && fastlane android production"

iOS

# Deploy to TestFlight
fastlane ios beta

# Deploy to App Store
fastlane ios release

Best Practices Implemented

  1. Dockerized Development Environment: Ensures consistency across development environments
  2. Multi-stage Builds: Optimized Docker image sizes
  3. Automated Deployment: Using Fastlane for consistent deployment process
  4. Code Organization: Following Angular best practices
  5. Mobile UI/UX: Using Ionic components and patterns correctly

ADB Integration with Android Studio

Manual Setup

To connect Android Studio with the containerized ADB:

  1. Stop the ADB server in Android Studio
  2. Run the Docker container with ADB exposed (already configured in docker-compose.yml)
  3. In Android Studio, go to Preferences > Android SDK > SDK Tools and set ADB location to:
    tcp:localhost:5037
    

Automated Setup

Use the provided script to automatically start the Docker container and launch Android Studio:

./start-android-dev.sh

This script will:

  1. Stop any running ADB server on your host
  2. Start the Docker container with docker compose up android-build
  3. Configure ADB connectivity between the container and host
  4. Launch Android Studio automatically

For detailed instructions on configuring Android Studio to work with the Docker container, see the Android Studio Integration Guide. ./start-android-dev.sh


This script will:
1. Stop any running ADB server on your host
2. Start the Docker container with `docker compose up android-build`
3. Configure ADB connectivity between the container and host
4. Launch Android Studio automatically

## Troubleshooting

### Common Issues

- **Port conflicts**: If ports are already in use, modify the `docker-compose.yml` file to use different ports
- **Docker connection issues**: Ensure Docker is running with sufficient resources allocated
- **iOS build failures**: Make sure you have the latest Xcode installed and necessary certificates

## License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published