All Projects → benoitvallon → React Native Nw React Calculator

benoitvallon / React Native Nw React Calculator

Licence: mit
Mobile, desktop and website Apps with the same code

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
CSS
56736 projects
java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to React Native Nw React Calculator

TemporaryContacts
Android/iOS mobile application for adding contacts that are automatically deleted after a set or default interval and are synced with main address book
Stars: ✭ 15 (-99.71%)
Mutual labels:  ios-app, android-app
flippingCards
iOS & Android flashcards app for learning German words faster 🃏
Stars: ✭ 23 (-99.55%)
Mutual labels:  ios-app, android-app
lndr-mobile
LNDR mobile app in React Native
Stars: ✭ 14 (-99.73%)
Mutual labels:  ios-app, android-app
Ionic-ElastiChat-with-Images
Ionic Magic Chat with Angular Elastic, Autolinker.js and more!
Stars: ✭ 66 (-98.71%)
Mutual labels:  ios-app, android-app
Vueflux
♻️ Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux
Stars: ✭ 315 (-93.84%)
Mutual labels:  architecture, flux
Monthly-App-Challenge-2022
Retos mensuales de la comunidad MoureDev para crear pequeñas aplicaciones en base a requisitos
Stars: ✭ 153 (-97.01%)
Mutual labels:  ios-app, android-app
flutter-Anniversary
一款界面优美,功能简洁的纪念日APP
Stars: ✭ 57 (-98.89%)
Mutual labels:  ios-app, android-app
rn-sip-app
React Native SIP App
Stars: ✭ 51 (-99%)
Mutual labels:  ios-app, android-app
Flutter One App
🎊Flutter 仿「ONE·一个」APP,兼容Android、iOS双平台,Flutter的练手学习,覆盖了各种基本控件使用、下拉刷新上拉加载、HTML解析、音乐播放、图片预览下载、权限申请等,使用Android Studio的FlutterJsonBeanFactory插件完成JSON转Dart实体
Stars: ✭ 316 (-93.82%)
Mutual labels:  android-app, ios-app
Kunidirectional
The goal of this sample app is to show how we can implement unidirectional data flow architecture based on Flux and Redux on Android... using Kotlin 😉
Stars: ✭ 303 (-94.08%)
Mutual labels:  architecture, flux
SwiftUI-Flux
🚀 This is a tiny experimental application using SwiftUI with Flux architecture.
Stars: ✭ 52 (-98.98%)
Mutual labels:  flux, architecture
Bangumi
💫 An unofficial bgm.tv app client for Android and iOS, built with React Native. 类似专门做ACG的豆瓣, 已适配 iOS/Android, mobile/Pad, light/dark theme, 并加入了很多独有的增强功能
Stars: ✭ 409 (-92.01%)
Mutual labels:  android-app, ios-app
InstaSmart
A Flutter app to plan and beautify your Instagram feed
Stars: ✭ 18 (-99.65%)
Mutual labels:  ios-app, android-app
Movies-PagingLibrary-Arch-Components
Sample to practice PagingLibrary & RX
Stars: ✭ 92 (-98.2%)
Mutual labels:  architecture, android-app
justBreathe
A minimal meditation app made with Flutter
Stars: ✭ 47 (-99.08%)
Mutual labels:  ios-app, android-app
been-pwned
App that leverages the haveibeenpwned.com API by Troy Hunt. This app is available in the App Stores and is used in several of my talks as well as my book Xamarin.Forms Essentials.
Stars: ✭ 19 (-99.63%)
Mutual labels:  ios-app, android-app
anonaddy
Mobile app for AnonAddy.com.
Stars: ✭ 50 (-99.02%)
Mutual labels:  ios-app, android-app
mobile-app
This project aims to build a modern mobile web-app based on the framework Ionic to improve the functionality of http://mobile.leitstelle122.at/.
Stars: ✭ 22 (-99.57%)
Mutual labels:  ios-app, android-app
Aawazein
A News Application 🗞️ built under 24 hours ⏰. It is built 🚧 with React Native ⚛️. 🚀 and 3 cups of Chai ☕
Stars: ✭ 28 (-99.45%)
Mutual labels:  ios-app, android-app
Furniture app flutter
watch it on YouTube
Stars: ✭ 322 (-93.71%)
Mutual labels:  android-app, ios-app

Mobile, desktop and website Apps with the same code

Build Status Dependency Status devDependency Status

This project shows how the source code can be architectured to run on multiple devices. As of now, it is able to run as:

  • iOS & Android Apps (based on react-native)
  • a Desktop App based on NW or based on Electron
  • a Website App in any browser (based on react)

A demo for the Website App is available here.

Screenshots

Mobile Apps (iOS & Android)

Mobile Apps

Desktop Apps (NW & Electron)

Desktop App

Website App

Website App

Libraries/tools

This project uses libraries and tools like:

  • es6 syntax and babel
  • react for the Website App and Desktop App,
  • react-native for the iOS & Android Apps
  • NW to package the Desktop App
  • Electron to package the Desktop App
  • flux to organize the data flow management
  • css-loader to integrate the styles in the builds
  • grunt to create the builds
  • webpack to help during the development phase with hot reloading

Basic philosophy

All the code is contained in the src directory, especially the 3 main entry files that are used for the builds:

  • index.ios.js & index.android.js are the ones used to build the iOS & Android Apps
  • index.js is the one used to build the Website App and Desktop App as the code is strictly the same.

Flux architecture actions/stores

All the flux architecture is share to 100% to all the different builds. This means that all the logic and data management code is done only once and reuse everywhere. This allows us to have an easy tests suite as well and to ensure that our code is working properly on all the devices.

Components

The real interest of the project is in how the components have been structured to shared most of their logic and only redefined what is specific to every device.

Basically, every component has a main Class which inherits a base Class containing all the logic. Then, the main component import a different Render function which has been selected during the build. The file extension .ios.js, .android.js or .js is used by the build tool to import only the right file.

The .native.js files contain code that is shared between both mobile platforms (iOS & Android). Currently, the .ios.js and .android.js files compose this .native.js file since all code is shared right now. However, if a component needed to be different for platform specific reasons, that code would be included in the corresponding platform specific files.

At the end, every component is defined by 6 files. If we look at the screen component, here is its structure.

Screen.js
├── ScreenBase.js
├── ScreenRender.ios.js (specific to iOS build
├── ScreenRender.android.js (specific to Android build)
├── ScreenRender.native.js (shared mobile app code - iOS & Android)
└── ScreenRender.js (used during Website and Desktop build)

And here is the main Class file which composes the files.

'use strict';

import Base from './ScreenBase';
import Render from './ScreenRender';

export default class Screen extends Base {
  constructor (props) {
    super(props);
  }

  render () {
    return Render.call(this, this.props, this.state);
  }
}

What's next

Here are some thoughts about what can come next:

  • Make the Website App Isomorphic/Universal

Thank you Robert for your awesome design

I want to thank Robert O'Dowd who kindly authorized me the reuse his very beautiful design. The original design made by Robert was part of his project called "Simplifycation" visible here.

How to build/run the projects

General requirements before running any specific project

  • npm install to install all the dependencies, React and React Native among others.

With some versions of npm (>=v3.3.10 <=v3.6.0)

Some builds from npm included bugs while npm install. So if you are using a npm version within the range form 3.3.10 to 3.6.0 included, you must run npm install twice. Those versions including npm v3.3.12 are the ones bundled by default with node from version v5.1.0 to v5.5.0.

  • npm install npm
  • npm install npm run it twice, because of the packages won't be installed after the first run #10985

The Mobile Apps (iOS & Android)

Requirements for React Native

iOS

  • OS X
  • Xcode 6.3 or higher is recommended (Xcode only runs on Mac).
  • Homebrew is the recommended way to install node, watchman, and flow.
  • brew install node
  • brew install watchman. We recommend installing watchman, otherwise you might hit a node file watching bug.
  • brew install flow. If you want to use flow.

Android

Running the Mobile Apps

iOS

  • Open iosApp.xcodeproj and hit run in Xcode.
  • Hit cmd+R in your iOS simulator to reload the app and see your change!

Android

Congratulations! You've just successfully run the project as an iOS or Android App.

The Website App

Requirements for React

There isn't any additional requirements since you already installed the deps with npm install.

Quick start

Congratulations! You've just successfully run the project as a Website App.

The Desktop App

You can either run the project with NW or electron.

Requirements for NW

To run the project, you are supposed to run something like:

/path/to/nw .

On OSX, the executable binary is in a hidden directory within the .app file. The easier solution to install it is to download the app on http://nwjs.io/ then copying it to your application folder. You will now be able to run:

/Applications/nwjs.app/Contents/MacOS/nwjs .

You can also setup an alias to call the binary.

alias nw="/Applications/nwjs.app/Contents/MacOS/nwjs"

Quick start with NW

  • npm run build to build the project (at least the first time)
  • npm run serve-nw to launch the desktop app and enable livereload

Congratulations! You've just successfully run the project as a Desktop App.

Quick start with Electron

  • npm run build to build the project (at least the first time)
  • npm run serve-electron to launch the desktop app and enable livereload

Congratulations! You've just successfully run the project as a Desktop App.

Run the tests

To run the tests, simply run:

npm test

Tests

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].