Coder Social home page Coder Social logo

janhavisinghh / patta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pariyatti/mobile-app

0.0 0.0 0.0 1.09 MB

The Pariyatti mobile app (written in Flutter).

License: GNU Affero General Public License v3.0

Kotlin 1.01% Swift 1.00% Objective-C 0.09% Dart 97.89%

patta's Introduction

patta [m.]: leaf; alms bowl; attained

Codemagic build status

The Pariyatti mobile app.

Design

Dev Setup: Android

  1. Install Java: sudo apt-get install openjdk-14-jdk or sudo apt-get install openjdk-11-jdk
  2. Install Android Studio: https://developer.android.com/studio
    • Install Android SDK Tools (obsolete) in Tools > SDK Manager
    • Install Android SDK Command-line Tools in Tools > SDK Manager
    • Install the Android Studio Flutter Plugin
    • (Optional) Configure udev to collect logs from a hardware device attached by USB:
      • sudo apt-get install adb && sudo usermod -aG plugdev $LOGNAME
  3. Install Flutter: https://flutter.dev/docs/get-started/install
    • run flutter doctor and follow any remaining instructions

Dev Setup: iOS

  1. Install Java:
    • Download JDK 14: https://jdk.java.net/14/
    • cd ~/Downloads && tar xzf tar xzf openjdk-14.0.2_osx-x64_bin.tar.gz
    • sudo mv jdk-14.0.2.jdk /Library/Java/JavaVirtualMachines/.
    • echo 'export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home' >> ~/.zshrc # or .bash_profile
  2. Install Xcode
  3. Install Flutter: https://flutter.dev/docs/get-started/install
    • run flutter precache and flutter doctor and follow any remaining instructions

Local Build Process

Common steps

# Copy example config file to provide configuration secrets
cp config/app_config.sample.json config/app_config.json

# Fill in values of secrets/keys inside config/app_config.json
# (At the moment, the app doesn't require any.)

# Grab dependencies
flutter pub get

# Generate code for part-files. This generated code is used to 
# parse/deserialize JSON and db data into model objects. 
flutter pub run build_runner build

Run the tests

# runs against a connected device
flutter test --machine

Run debug build with sandbox servers

# Target sandbox environment
# This uses a `main` specific to the sand[box] server
flutter run --target lib/main_sand.dart

Run debug build with production servers

# Target production environment
# This uses a `main` specific to the prod[uction] server
flutter run --target lib/main_prod.dart

๐ŸŒ„ Everything below this point is for project admins. If this is your first time building patta, you can stop here. :) ๐ŸŒ„


Branch Policy

  1. master is for release builds. Merging changes into master causes a build in CodeMagic which publishes to the Play Store.
  2. development is for debug builds. These are not published to the Play Store but are automatically emailed to developers. Do version bumps in the development branch only.
  3. Feature Branches are used for all active development. Branch off of the development branch either in the pariyatti/patta repo or in your own personal repo. When you are finished a User Story, submit a PR to the development branch. Stories should be thoroughly tested before they are merged into master.
Promotion:

[feature] ==> [development] ==> [master]
    |      |         |       |      |
   dev     PR   debug/test   PR  release

Run release build with production servers (signed APK)

In order of preference:

  1. Use a build from CodeMagic. Avoid locally signed release builds.

  2. If for some reason CodeMagic isn't available: Get the keystore.jks and keystore.properties files from the Vault, copy them locally, and build locally.

# Create these files:
/android/keystore.jks
/android/keystore.properties

# Build + Run signed Android app with production environment:
flutter run --release --target lib/main_prod.dart
  1. Do it all by hand:
# Generate Android signing keystore from these instructions
# https://flutter.dev/docs/deployment/android#create-a-keystore
# Make sure to name the file "keystore.jks" and put it right inside the `/android` directory

# Copy sample properties file
cp android/keystore.sample.properties android/keystore.properties

# Fill in the key-alias, store-password and key-password as per your
# keystore inside the copied keystore.properties file

# Run signed Android app with production environment
flutter run --release --target lib/main_prod.dart

CI / CD Builds

Ask Steven Deobald or Varun Barad for an account if you cannot see the app:

https://codemagic.io/app/5ea7faa6ab38b5000ac85f7b

We have two builds:

  1. Sandbox, which emails builds to developers
  2. Production, which publishes signed release builds to App/Play Stores

Managing Tracks

We should only ever have one published track in the Play Store. At this stage, our only track is the Internal track. When the first public release is ready, this will change to the Production track. Both of these tracks use the same signed release build targetting the production kosa server. The only difference is that the Production track is publicly visible.

When we're ready for our first public release, we will need to change Publish => Google Play => Track to Production and Build => Trigger on Push to false (public builds will be manual).

Flutter - Outstanding Questions

If you have answers to these questions, please move them to the top and put the answer in a sub-bullet.

  • What is the delete(card)..where() double-dot syntax in Moor?

    • This is not Moor-specific but rather a feature of Dart. The double-dot returns you the previous instance so you can keep operating on one object rather than chaining methods over previous methods' return values. For instance: A.b()..c() runs b() on the instance A but it also runs c() on the instance A, instead of on the return value of b() as A.b().c() would.
  • What's the Right Way to do i18n?

  • Why are the emulators broken and can we fix them?

  • Philsophical: What's the deal with State vs. StatefulWidget?

  • Could the HomeScreen state switch be a tiny object unto itself?

  • How does the factory keyword work?

  • If Santu comments on the *Card.dart files, are they readable to a newbie?

  • Can Moor Converters move into multiple files?

patta's People

Contributors

varunbarad avatar deobald avatar namanshergill avatar ishijo avatar jhetvi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.