Skip to content

veris-amoghbanta/re-start

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

re-start 🌐 πŸ“± πŸ’»

PRs Welcome

re-start (1).png

Aim of this

  • Target multiple platforms (Android, iOS, Web, Windows[UWP] and Electron[macOS, Ubuntu, Windows]) with react native' APIs and a single codebase.
  • Follow best practices while doing the above.
  • Cut out the time and effort it takes to setup the project (based on create-react-app).
  • Achieve 'Write once use everywhere' with react-native (though react strictly says 'Learn once use anywhere').
  • Mitigate git cloning or manual upgrading of boiler plates, which is possible because this project is a react-native template. πŸŽ‰

Structure of the project:

  • This project comprises of several templates that are curated keeping in mind the various use cases of initiating a new project. Based on your requirements and preferences, you can choose a templates that suits your you case the best.
Template Name Description Installation Command Version
re-base The most basic version that runs on all platforms react-native init <Your Project Name> --template re-base npm version
re-dux re-base with redux wired out of the box react-native init <Your Project Name> --template re-dux npm version
re-route re-base with react-router wired out of the box react-native init <Your Project Name> --template re-route npm version
re-start re-base combined with redux and react-router react-native init <Your Project Name> --template re-start npm version

Usage

Pre-requisites:

Node.js & npm on your system(follow this)
react-native CLI (npm install -g react-native-cli)

All you have to do is:

  • Create a new react-native project using react-native-cli and specify this project as a template:
react-native init <Your Project Name> --template <Template Name>
  • Since react-native-template does'nt support adding dev dependencies and custom scripts to package.json, so I have created a custom script to do that.
node scripts/additionalDependencies.js

Notes:

  • If the above script fails due to some reason, you can do it manually by copying the contents of devDependencies.json to your package.json's devDependencies object and adding following to the scripts object.
"web": "node scripts/start.js",
"build": "node scripts/build.js"
  • react-native-web currently (20th of July, 2017) supports React/ReactDOM 15.4, 15.5, or 15.6, so make sure you do not upgrade if you want support for web.
  • make sure that the version of react-native-windows is same as your react-native version, if you are targeting windows support.

Run the project on a specific platform:

Android

react-native run-android

iOS

react-native run-ios

Web

npm/yarn run web

Windows

react-native windows react-native run-windows

Desktop (Electron)

npm/yarn run electron

Build for production:

Android/iOS

This will help

Web

npm/yarn run build (this will build your production ready bundle)


Some very useful cross platform compatible libraries:


Progress:

  • support for web (react-native-web)
  • support for Windows (react-native-windows)
  • Support for electron
  • Compatibility with React 16
  • Add Docs and FAQs
  • Configure Travis and Greenkeeper
  • Interactive CLI to create templates and components

Running demo on Web, Android, iOS, Windows(Universal) and Electron:


Contributors

Thanks goes to these wonderful people (emoji key):


Amogh Banta

πŸ’» 🎨 πŸ“– πŸ› πŸ€” ⚠️

JesΓΊs LeganΓ©s-Combarro

πŸ’» πŸ€” πŸ› ⚠️ πŸ‘€ πŸ“–

Ankit Popli

πŸ‘€ πŸ€” πŸ›

Christopher Hein

πŸ“– πŸ›

DuncanMacWeb

πŸ’»

Full list of contributors can be found here.

Companies that contribute to re-start's development:

LICENSE

MIT

About

react-native template to target multiple platforms 🌐 πŸ“± πŸ’» with single codebase.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 86.5%
  • HTML 13.5%