Skip to content

Commit

Permalink
Merge pull request #16 from NiketanG/v2
Browse files Browse the repository at this point in the history
v2
  • Loading branch information
NiketanG authored Feb 21, 2022
2 parents 0d530c0 + a100df5 commit f7acf26
Show file tree
Hide file tree
Showing 119 changed files with 10,352 additions and 15,626 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/node_modules/*
**/test/*
**/src/generated/*
**/android/*
**/ios/*
**/build/*
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["@react-native-community", "prettier"],
rules: {
"react-native/no-inline-styles": 0,
},
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
*.env
*.jks
google-services.json

# Android/IntelliJ
#
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn run type-check
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
yarn.lock
package-lock.json
android
ios
build
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useTabs": true,
"tabWidth": 4,
"singleQuote": false,
"jsxSingleQuote": false
}
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
24 changes: 2 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@ Setup Supabase Project and configure [`supabaseClient.ts`](src/app/utils/supabas

> Use the Database structure from [db_structure.sql](db_structure.sql) in Supabase.
Configure Cloudinary for Image Uploads.

> Enable Unsigned Uploads.
Set up Google Cloud Project and add Oauth Clients for Google Auth.
Enable Google Auth in Supabase ,and set up Google Cloud Project and add Oauth Clients in Supabase App Dashboard.

Set Environment Variables.

```
SUPABASE_KEY
SUPABASE_URL
CLOUDINARY_UPLOAD_PRESET
CLOUDINARY_CLOUD_NAME
GOOGLE_CLIENT_ID
```

Start metro bundler
Expand All @@ -50,19 +43,6 @@ or
npm run android
```

# To Do

- [x] Messaging
- [ ] Better Caching
- [ ] Filters for Posts
- [ ] Stories
- [ ] Better Navigation and State Persistence
- [ ] Video Posts
- [ ] Activity Tab
- [ ] Animations
- [ ] React Native Web support
- [ ] Testing on iOS

### Note

This is not a 1:1 Replica of Instagram and will never be. The aim of this project was to try and test out [Supabase](https://supabase.io/) and Mobx-State-Tree with React Native.
This is not a 1:1 Replica of Instagram and will never be. The aim of this project was to try and test out [Supabase](https://supabase.io/).
22 changes: 22 additions & 0 deletions ToDo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# To Do

- [ ] Group Chats
- [ ] Show unseen stories first
- [ ] Notifications using FCM: Need Supabase Functions
- [ ] Private Accounts
- [ ] Filters for Posts
- [ ] Video Posts
- [ ] Animations
- [ ] React Native Web support
- [ ] iOS Support

- [x] Comment Replies
- [x] Stories
- [x] Story Seen List
- [x] Migrate from MST & Replace custom hooks with useQuery
- [x] Notifications
- [x] Better Caching with Offline Support
- [x] Better Navigation and State Persistence
- [x] Activity Tab
- [x] Only allow swipe to messages/new story on home screen
- [x] Messaging
6 changes: 6 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services' // <- Add this line

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"


Expand Down Expand Up @@ -124,6 +126,7 @@ def enableHermes = project.ext.react.get("enableHermes", false);

android {
compileSdkVersion rootProject.ext.compileSdkVersion
ndkVersion '23.1.7779620' //version

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -132,6 +135,9 @@ android {

defaultConfig {
applicationId "com.nikketan.instaclone"

manifestPlaceholders = [appAuthRedirectScheme: 'com.nikketan.instaclone.auth']

minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand Down
47 changes: 0 additions & 47 deletions android/app/google-services.json

This file was deleted.

62 changes: 33 additions & 29 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nikketan.instaclone">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:name=".MainApplication"
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nikketan.instaclone">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

</manifest>
android:exported="true"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<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="com.nikketan.instaclone"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.facebook.react.bridge.JSIModulePackage; // <- add
import com.swmansion.reanimated.ReanimatedJSIModulePackage; // <- add
public class MainApplication extends MultiDexApplication implements ReactApplication {

private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
Expand Down
11 changes: 6 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

buildscript {
ext {
buildToolsVersion = "29.0.2"
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "23.1.7779620"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath 'com.google.gms:google-services:4.3.3'
classpath("com.android.tools.build:gradle:4.1.2")
classpath 'com.google.gms:google-services:4.3.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
79 changes: 0 additions & 79 deletions config-overrides.js

This file was deleted.

11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import "react-native-url-polyfill/auto";
import "react-native-get-random-values";

import { AppRegistry } from "react-native";
import App from "./src/app/App.native";
import { name as appName } from "./src/app.json";
import messaging from "@react-native-firebase/messaging";

import App from "./src/app/App";
import { name as appName } from "./app.json";

messaging().setBackgroundMessageHandler(async (remoteMessage) => {
console.log("Message handled in the background!", remoteMessage);
});

AppRegistry.registerComponent(appName, () => App);
Loading

0 comments on commit f7acf26

Please sign in to comment.