Giter Site home page Giter Site logo

productmanagerdemo's Introduction

Product Manager Demo

This repository is a demo app based on my article on Expo + React Native Firebase integration - it uses Expo Development Client and Config Plugins to integrate native Firebase into Expo app. Read the article for more details.

This repo was recently updated from Expo SDK 36 to 44, after two years. There's still lots of old code, which may not follow current best practices. This README might not be fully up-to-date too.

Yet another React Native CRUD app, written in TypeScript for demo purposes. Features:

  • View product list
  • View product details
  • Add, edit and delete products
  • Language/i18n support
  • Google (Firebase) Analytics integration
  • User accounts (Firebase auth). Sign in and Sign up support.
  • Display to users their own products.

See also Technical Features

Written to show:

  • Expo Dev Client and config plugins
  • Expo and React Native Firebase integration
  • Learn how to CRUD in React Native

For details on the Expo stuff, refer to their docs: Dev Clients/Builds, Config Plugins, React Native Firebase.

Screenshot

Requirements

  • Expo CLI 5.x or newer
  • Created Firebase project with Firestore database (unless you use built-in fake API)
  • (Recommended) Yarn

Installation

  1. Clone Repo
  2. yarn install
  3. Set the ios.bundleIdentifier and android.package in app.json to your custom values, you'll need them in the next step.
  4. Create a Firebase project and download Google Services config files
    • Put google-services.json in the root directory See docs here for Android
    • Put GoogleService-Info.plist in the root directory. See docs here for iOS
  5. Run yarn android or yarn ios. It will build the Expo project, run the bundler and start the app in simulator.

Running

package.json contains a few run scripts:

  • start - Runs just Metro bundler for Expo Dev Client (expo start --dev-client)
  • android - Builds Android project and runs it (Requires Android SDK) (expo run:android)
  • ios - Builds iOS project and runs it (Requires Xcode) (expo run:ios)

Switching API

By default, the Firestore API is selected. To use the in-memory Fake API, open src/api/index.ts and then

const Api = new FakeApi();
//const Api = new FirestoreProductsApi();

uncomment the first line, and comment out the second one, as shown above.

Used libraries and frameworks

  • React Native
  • Expo SDK 44 - semi-managed worflow - uses prebuild and config plugins
  • React Navigation
  • Native-base - for UI components
  • Redux
  • Redux Saga
  • Firestore database
  • React Native Firebase (Firestore, Analytics, Auth) - for native builds
  • i18n-js for language support

Technical features

  • Two implementations of data management API: Firebase Firestore and simple in-memory dictionary based API for demo purposes. Interfaces needed to create custom implementation are provided.
  • Support for event-driven APIs (for example Firestore onSnapshot())
  • Expo Dev Client + prebuilding / config plugins - uses React Native Firebase with Expo

File structure

  • index.js - React Native main file
  • App.tsx - Expo main file. Redirects to src/app.tsx
  • firebase_credentials.json - For Expo users - credentials to Firebase JS SDK
  • src - App source code
  • src/App.tsx - Main App component
  • src/api - Product API interfaces and implementations
    • Firestore - Firestore API implementation
    • Fake - FakeApi - simple dictionary based in-memory API impl.
  • src/components - React components
  • src/core - Redux implementation files
    • actions - Redux Action definitions
    • constants - names and type names for actions
    • reducers
    • sagas - Side effects for actions.
      • products.saga.ts - Connects Redux actions and store with API
  • src/hooks - custom React hooks
  • src/i18n - Internalization / language support files
  • src/navigation - React-navigation route and screen configuration
  • src/screens - Navigation Screen component definitions
  • src/utils - Common utility code
  • __tests__ - Unit tests for project

TODO / Not yet implemented

  • Information message boxes is spamming too much about state but I think it's OK for demo purposes

productmanagerdemo's People

Contributors

barthap avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ravendano014

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.