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

Update README instructions for version .71.x setup #169

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
Comment on lines -3 to -4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have actually split this line into two steps for better understanding and easy to follow contribution guideline.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a sample contributing guideline for references -> https://github.com/github/docs/blob/main/CONTRIBUTING.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have gone through this sample guideline document, and it seems that the points mentioned there are already covered in the three points I proposed below. These points will be easy to follow for any new contributors.

What do you recommend? Should I elaborate the contribution guideline or keep it concise & easy to follow steps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one need to resolve?

Thank you for your interest in contributing to our project! We welcome all contributions, whether it's a bug fix, feature suggestion, or documentation improvement.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think keeping this, will be appreciate the aspiring contributors as it will help them feel more welcome to this project.


Before you start contributing, please take a moment to read the following guidelines:

1. Initiate a discussion with the repository owners, either by creating a `GitHub Issue` or using any other communication method, to discuss your intended changes before making any modifications.
2. Maintain a `Fork` copy of the code base as a developer and it would be easy to contribute if the developer has a `Clone` copy in local development workspace.
3. Commit your changes with clear messages and open a `Pull Request` from your forked repository to the original one for contribution.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Expand Down
119 changes: 89 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,120 @@

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fbf9f8e1bb7b4d2cbb1ca569014ed45b)](https://app.codacy.com/app/shehand/Go-social?utm_source=github.com&utm_medium=referral&utm_content=shehand/Go-social&utm_campaign=Badge_Grade_Dashboard) [![Build Status](https://travis-ci.org/shehand/Go-social.svg?branch=master)](https://travis-ci.org/shehand/Go-social) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/scorelab/go-social)

Today's community use mobile phones to make their life easier, and community-based mobile applications are famous among them. There are several kinds of community-based applications in use, and most of them relate to a specific domain. But core components have similar features. Addressing this issue and saving development time by introducing a common app template with customizable components for community-based mobile applications is the main purpose of this project.
Go-social is a customizable React Native app template designed for community-based mobile applications. The template provides a common foundation for building such applications, saving development time and allowing developers to focus on adding unique features and functionality specific to their community.

## Setup the project
## Getting Started

> NOTE: If you have not yet installed react-native, use [this link](https://facebook.github.io/react-native/docs/getting-started) to install and configure react-native. **Make sure to use react-native cli rather than using expo cli**.
To get started, you'll need to have the following softwares installed on your machine:

## Configure Go-social
- [`Node.js`](https://nodejs.org/en/)
- [`React Native CLI`](https://reactnative.dev/docs/environment-setup)
- [`VSCode`](https://code.visualstudio.com/) and [`Android Studio`](https://developer.android.com/studio) (for Android development)
- [`Xcode`](https://developer.apple.com/xcode/) (for iOS development)

- Clone the project
Once you have these installed, follow these steps:

`git clone https://github.com/scorelab/Go-social.git`
1. Clone the repository to your machine:

- Change the directory to the project folder
```sh
git clone https://github.com/scorelab/Go-social.git
```

`cd Go-social`
2. Navigate to the project directory:

- Install the node modules with the following command
```sh
cd Go-social
```

`npm install`
3. Install all dependencies:

### Configure the config.example.js file (IMPORTANT)
```sh
npm install
# Or
yarn install
```

> Open the project in any text editor you use. Open the `config.example.js` file in the `config` folder and follow the following steps.
Before using the app, you'll need to configure your app.

- Use [this link](https://console.firebase.google.com/) to **create a Firebase** project for the Go-social application. It is free for everyone. Please use the web app instead of the Android or iOS app.
## Go-social app Configuration ~[IMPORTANT!]

- Update the **Sign-in method** of Firebase [project](https://firebase.google.com/docs/auth/android/password-auth#before_you_begin) that you want to use as **Enabled**
To configure your app, follow these steps:

- Create a **Firebase Database** and Update the Ruleset of the real-time database to **Read/Write Allow**.
#### A. Firebase Setup:

- Use [this link](https://cloud.google.com/maps-platform/) to **generate Google Map Api key** for the map view in G-social. This is not necessary. You can use the given api key. But it is not guaranteed that the given key will always work. It is better to have your own key. Enable all maps, routes, places in your key.
1. Go to the [Firebase Console](https://console.firebase.google.com/) and create a new project for the Go-social application. This is free for everyone. It's recommended to use the **Web App** instead of the Android or iOS app.

- Now you need a **Facebook app id** if you want to enable Facebook login for Go-social. Use [this link](https://developers.facebook.com/) for that and make sure to enable both email/password and Facebook sign-in method in Firebase.
2. To enable `Authentication` and `Storage` for your app, activate them in the Firebase console `Build` section after creating and registering the app.
3. Enable `Sign-in methods` Email/Password and Facebook in the Authentication section of your Firebase app.
4. Create a `Firebase Realtime Database` and update its ruleset to allow read and write access.
5. Update the Firebase configuration object in `config/config.js` with app-specific config details obtained from the Firebase console app settings.

So place your Firebase details and Google map API key in **config.example.js** file and **rename it** to **config.js**.
ajaman190 marked this conversation as resolved.
Show resolved Hide resolved
#### B. Google Maps Setup:

- To make Google map and Facebook login to work, you have to follow these extra steps.\*
1. Generate a `Google Maps API Key` using this [Link](https://mapsplatform.google.com/) for Go-social's map view, or use the provided key (not guaranteed to always work). Ensure the key has all maps, routes, and places enabled
2. After obtaining your Google Maps API key, replace the example key with your own.
> - For Android open `android/app/src/main/AndroidManifest.xml` and replace

1. Find the file name `AndroidManifest.xml` which is located in `android/app/src/main` path. Place your **Google map API key** in there.
```sh
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDmwJddIPTcALyZtj7p9mFFlkMvpMkati8"
/>
```

> Ex : <meta-data
> - For IOS open `ios/Go_social/AppDelegate.m` and replace

android:name="com.google.android.geo.API_KEY"
android:value=**"AIzaSyDmwJddIPTcALyZtj7p9mFFlkMvpMkati8"**/>
```sh
[GMSServices provideAPIKey:@"AIzaSyDmwJddIPTcALyZtj7p9mFFlkMvpMkati8"];
```

1. Find the file name as `strings.xml` located in `android/app/src/main/res/values`. Place your **Facebook app id** in there.
#### C. Facebook Authentication Setup:

> Ex: <string name="facebook_app_id">**2349388348405699**</string>
1. To enable `Facebook login` for Go-social, obtain a Facebook app id using the provided [link](https://developers.facebook.com/) and enable both email/password and Facebook sign-in method in Firebase.
2. After setting up Facebook authentication, use your Facebook App ID and App Secret to enable the "Facebook" `Sign-in method` in Firebase.
3. Update the following file in your repository: `Example app_id: 2349388348405699`
> - For Android open `android/app/src/main/res/values/strings.xml` and replace

So now you are ready to run Go-social.
```sh
<string name="facebook_app_id">YOUR_APP_ID</string>
<string name="fb_login_protocol_scheme">fb1234</string>
<string name="facebook_client_token">PLACE_YOUR_CLIENT_TOKEN_HERE</string>
```

## Run Go-social
> - For iOS open `ios/Go_social/info.plist` and replace

- Run the app
```sh
...
<string>fb{YOUR_APP_ID}</string>
...
<key>FacebookAppID</key>
<string>{YOUR_APP_ID}</string>
<key>FacebookDisplayName</key>
<string>{YOUR_APP_NAME}</string>
<key>FacebookClientToken</key>
<string>{YOUR_CLIENT_TOKEN_HERE}</string>
...
```

`npx react-native run-android`
### Run Go-social

Then enable the remote Js debugging.
Now you are ready to run Go-social
(for android)

```sh
npx react-native run-android
# Or
yarn react-native run-android
```

(for iOS)

```sh
npx react-native run-ios
# Or
yarn react-native run-ios
```

## Contributing

Contributions to this project are welcome! To contribute, follow our [Contribution Guidelines](https://github.com/scorelab/Go-social/blob/14e5dfcdfb59888efc318bb4835e3577d5d09532/.github/CONTRIBUTING.md)
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation 'com.facebook.android:facebook-android-sdk:11.1.0'

// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:31.2.3')
Expand Down
21 changes: 19 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<!-- <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>



<application
android:name=".MainApplication"
Expand All @@ -26,10 +28,25 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDmwJddIPTcALyZtj7p9mFFlkMvpMkati8"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
</application>

</manifest>
2 changes: 2 additions & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<resources>
<string name="app_name">Go_social</string>
<string name="facebook_app_id">2349388348405699</string>
<string name="fb_login_protocol_scheme">fb1234</string>
<string name="facebook_client_token">PLACE_YOUR_CLIENT_TOKEN_HERE</string>
</resources>