Skip to content

SubhamKarmakar24/snapshot

Repository files navigation

Snapshot

A cross-platform social media app* for the users to upload their snaps, follow other people of their interests, comment on others snaps and like them for the rest of the world to see.

*(currently configured for Android. iOS configuration requires XCode configuration. The code requires no changes in iOS).


Initial Beta Release v0.0.1 can be found here.

Stacks/Libraries used :

  • React Native - v0.66.4
  • React Navigation - v6.0.6
  • React Native Vector Icons - v9.0.0
  • Redux - v4.1.2
  • React Redux - v7.2.6
  • Firebase by Google - v14.2.2
    • Firebase Analytics
    • Firebase Auth
    • Firestore Database
    • Cloud Storage
    • Cloud Functions
  • Node - v16.0.0

Immediate To - Dos :


Setting up the development environment :

  • Fork this repository.
  • Clone the forked repository into your local drive.
  • Navigate to the directory snapshot/frontend.
  • While inside the frontend directory, open a terminal (ensure path points to frontend directory) and run npm install or npm i.
  • Head over to Firebase Console and login to your account.
  • After you have logged in to Firebase, in the Firebase Console, add a project.
  • You will be asked to give a name to your app, then hit Continue.
  • Enable Google Analytics and hit Continue again.
  • Now in the Console, add an Android App.
  • Enter your projects details. The "Android package name" must match the local projects package name which can be found inside of the manifest tag within the /android/app/src/main/AndroidManifest.xml file within the project.
  • The Debug Signing Certificate is optional to use Firebase with the app, but is required for Dynamic Links, Invites and Phone Authentication. To generate a certificate run cd android && ./gradlew signingReport. This generates two variant keys. Copy both 'SHA1' and 'SHA-256' keys that belong to the debugAndroidTest variant key option. Then, those keys can be added to the 'SHA certificate fingerprints' on the app in Firebase console.
  • Download the google-services.json file and place it inside of the project at the following location: /android/app/google-services.json.
  • Go to the Firebase Console once again and select Authentication in the left pane. Go to the Sign-in method tab and enable Email/Password and hit Save.
  • Select Firestore Database from the left pane. Select Create Database and choose start in test mode(Ensure that during the development process, the database always remains in test mode, since it is configured to block database access after 30 days). Choose a location that is nearest to you in the list of locations.
  • Select Storage in the left pane and see if it is showing you the storage bucket or not. If not, then setup the storage bucket.

Running the app in Web, Android or iOS :

  • Open a terminal inside the frontend folder.
  • Run npm run android.
  • If an Android device is connected with USB Debugging enabled, the app will start in the physical device else it will run in the emulator.
  • For setting up React Native or an emulator, follow this guide.

I have also created the Firebase Cloud Functions that is required for updating the Likes count in the app. The code is present in the backend folder, which can be run using npm install followed by firebase deploy in the terminal opened in the backend directory. But for the functions to deploy, you need a Blaze plan of Firebase. Although it won't charge you unless you exceed the quota, it still needs a billing account to provide you the Cloud services for free.



Read the CONTRIBUTING.md and CODE_OF_CONDUCT.md before contributing to this project.


License :

MIT License

Copyright (c) 2022 Subham Karmakar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.




A huge thanks to Simcoder's Youtube channel which helped me in building the bare bones of this app, upon which the future versions and extra features would be implemented.