Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-documentation-outdated #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 194 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,210 @@
# elly
# Elly-Mobile App Contribution Guide

Elly App is a new mobile app which is capable of spotting elephants for elephant conservation purposes.
Welcome to the **Elly-Mobile App** contribution guide! The Elly App is a mobile application developed to spot elephants for conservation purposes. We appreciate your interest in contributing to this project and helping us make a positive impact on elephant conservation.

### Contributing to Elly-Mobile APP
> **Note:** Please ensure that you follow this guide carefully to set up your development environment and contribute effectively.

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
---

1. Fork the [https://github.com/scorelab/elly.git].
## Table of Contents

2. Generate a debug.keystore using `keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000`. (Keystore name: “debug.keystore”, Keystore password: “android”, Key alias: “androiddebugkey”, Key password: “android”, CN: “CN=Android Debug,O=Android,C=US”). (read guide: [https://rnavagamuwa.com/programming/android-programming/android-generate-release-debug-keystores/])
1. [Introduction](#introduction)
2. [Prerequisites](#prerequisites)
3. [Setup Instructions](#setup-instructions)
- [Forking the Repository](#forking-the-repository)
- [Generating the Debug Keystore](#generating-the-debug-keystore)
- [Firebase Project Setup](#firebase-project-setup)
- [Configuring the Project](#configuring-the-project)
4. [Running the Application](#running-the-application)
5. [Pull Request Process](#pull-request-process)
6. [Environment Information](#environment-information)
7. [Additional Contribution Guidelines](#additional-contribution-guidelines)
8. [Support and Contact](#support-and-contact)

3. Place the copy of debug.keystore in MobileApp/android/app/.
---

4. Generate the key fingerprints using `keytool -list -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android`.
## 📖 Introduction

5. Create a firebase project, add an android app to project settings, add sha1 to the project, download the google-services.json file and place in the MobileApp/android/app/. (read guide: [https://invertase.io/oss/react-native-firebase/quick-start/android-firebase-credentials]).
Elly-Mobile App is a new mobile application aimed at spotting elephants to aid conservation efforts. As a contributor, you will be helping develop and maintain features that are critical for elephant conservation. Your contributions are vital to the success of this project and the broader conservation mission.

6. Add a config.js file in the MobileApp/src/config/config.js. Content of the file should looks like sampleConfig.js. Extract those client ids from google-services.json. If you are testing with the debug.keystore you only need to add the client id related to debug sha1 in devAndroidClientID. And use it in MobileApp/src/components/GoogleLogin/GoogleLogin.js file's 3rd and 12th line.
---

7. Create a gradle.properties file in **MobileApp/android/** and paste the content in the MobileApp/android/app/samplegradle.properties.
## 🛠 Prerequisites

8. Run `npx install`, `react-native run-android`, `react-native start`
Before getting started, please ensure you have the following installed and configured on your development machine:

### Pull Request Process
- **Node.js:** Version 10.15.2 or higher
- **npm:** Version 6.12.0 or higher
- **React Native CLI:** Version 2.0.1
- **Android Studio:** For Android development
- **Java Development Kit (JDK):** Required for Android builds
- **Git:** For version control and repository management

1. Ensure any install or build dependencies are removed.
2. Submit changes as a pull request.
---

### Environment Info
#### System:
OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Memory: 309.14 MB / 7.55 GB
Shell: 5.0.3 - /bin/bash
#### Binaries:
Node: 10.15.2 - /usr/bin/node
npm: 6.12.0 - /usr/local/bin/npm
#### npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
#### npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
## 🔧 Setup Instructions

### Forking the Repository

#### NOTE: Do not change the .gitignore file.
1. Fork the repository from our [GitHub organization](https://github.com/scorelab/elly.git).
2. Clone your fork locally:

```bash
git clone https://github.com/<your-username>/elly.git
cd elly
```

### Generating the Debug Keystore

Generate a `debug.keystore` using the following command:

```bash
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
```

> **Important:**
> - **Keystore Name:** `debug.keystore`
> - **Keystore Password:** `android`
> - **Key Alias:** `androiddebugkey`
> - **Key Password:** `android`
> - **CN:** `CN=Android Debug,O=Android,C=US`

For more detailed guidance, refer to the [Android Debug Keystore Guide](https://rnavagamuwa.com/programming/android-programming/android-generate-release-debug-keystores/).

Place a copy of the generated `debug.keystore` in the following directory:

```
MobileApp/android/app/
```

### Firebase Project Setup

1. **Create a Firebase Project:**
Go to the [Firebase Console](https://console.firebase.google.com/) and create a new project.

2. **Add an Android App to Your Project:**
In your project settings, add an Android application.

3. **Add SHA1 Fingerprints:**
Generate and add the SHA1 fingerprint of your debug keystore using the command below:

```bash
keytool -list -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android
```

4. **Download Configuration File:**
Download the `google-services.json` file from your Firebase project settings and place it in:

```
MobileApp/android/app/
```

For more detailed instructions, see the [Firebase Credentials Guide](https://invertase.io/oss/react-native-firebase/quick-start/android-firebase-credentials).

### Configuring the Project

1. **Add the Configuration File:**
Create a `config.js` file at the following location:

```
MobileApp/src/config/config.js
```

The content of this file should match the structure provided in `sampleConfig.js`. Extract the necessary client IDs from `google-services.json`.

2. **Setup Google Client ID for Debug:**
If testing with the `debug.keystore`, ensure that you add the client ID corresponding to the debug SHA1 fingerprint to the `devAndroidClientID` property in `config.js`. This client ID is then referenced in `MobileApp/src/components/GoogleLogin/GoogleLogin.js` (specifically on the 3rd and 12th lines).

3. **Gradle Properties:**
Create a `gradle.properties` file in:

```
MobileApp/android/
```

and copy the content from `MobileApp/android/app/samplegradle.properties`.

---

## 🚀 Running the Application

1. **Install Dependencies:**

```bash
npx install
```

2. **Run the Android Application:**

```bash
react-native run-android
```

3. **Start the React Native Packager:**

```bash
react-native start
```

> **Tip:** Ensure that you do not modify the `.gitignore` file.

---

## 🔄 Pull Request Process

1. **Clean Up:**
Remove any install or build dependencies from your changes.

2. **Submit Your Changes:**
Submit your changes as a pull request to the main repository. Please follow our commit message guidelines and ensure your code adheres to the project’s coding style.

3. **Review Process:**
Your pull request will be reviewed by the team. Please be responsive to feedback and ready to make necessary revisions.

---

## ⚙️ Environment Information

- **System:**
- OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
- CPU: (4) x64 Intel® Core™ i5-7200U CPU @ 2.50GHz
- Memory: 309.14 MB / 7.55 GB
- Shell: 5.0.3 - /bin/bash

- **Binaries:**
- Node: 10.15.2 - `/usr/bin/node`
- npm: 6.12.0 - `/usr/local/bin/npm`

- **npm Packages:**
- react: 16.9.0 => 16.9.0
- react-native: 0.61.2 => 0.61.2

---

## 🚨 Troubleshooting
-**Build Failures:**

-Ensure debug.keystore and google-services.json are in the correct directories.

-Run npx react-native clean to clear cached files.

-**Firebase Errors:**

-Verify SHA-1 fingerprints in Firebase Console match your keystore.

-Confirm config.js uses the correct client ID.


---

## 📞 Support and Contact

If you encounter any issues or have questions, please contact the maintainers or open an issue on the [GitHub repository](https://github.com/c2siorg/elly).

Thank you for contributing to the Elly-Mobile App and helping us further the mission of elephant conservation!

---

*This document is maintained by the Elly-Mobile App team and is subject to updates.*

Happy coding!