• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    JavaScript
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Robust React Native boilerplate to kickstart your new app ⚡

Project Structure

This project is a React Native boilerplate that provides an architecture optimized for building solid cross-platform mobile applications through separation of concerns between the UI and business logic to help you kickstart your new app

When starting new apps I found myself repeatedly setting up my project with same packages over and over again so I decided to automate this process

This boilerplate consists of various elements and best practices I learned while going though apps written by various talented developers in the React Native Community ⚡

While this mostly consists of how I organize my projects but can be easily extended to suit any workflow 😄

If you're new to React Native feel free to checkout this repo I made where I keep all the learning resources I find: Learn React Native

If you face any issue then please checkout the Known Issues section below, but if the issue persists then feel free to open a issue so we can solve it together 😃

Feel free to leave a ⭐ as motivation if this was useful to you 😄

Index

Content:

- React Native (0.62.2) + Hermes
- TypeScript Integration (Optional)
- Clean Directory Layout
- ESLint
- Packages:
    - Redux (Thunk)
    - React Navigation (Hooks)
    - React Native Reanimated
    - React Native Vector Icons
    - React Native Gesture Handler

Project Structure:

Project Structure

TypeScript Support

Recently I've been using a lot of TypeScript and I think it's fantastic 😃 Addition of TypeScript to this boilerplate was a much requested feature from a lot of reddit users of r/react-native

To add TypeScript support please run yarn typescript:add command which should excecute the scripts/add-typescript/script.sh script and installs all the TypeScript dependencies with types for React, React Native, React Navigation and also add a tsconfig.json and jest.config.js

If yarn typescript:add fails then kindly apply the changes as mentioned in the docs 😓

Note: This feature is only tested on Linux and MacOSX

Using the boilerplate:

Make sure to remove the existing git history and initialize the project with your own

rm -rf .git/
git init
git add .
git commit -m 'project init'
git remote add origin <your remote repo>
git push -u origin master

Rename the project:

Rename the project with the name and bundle identifier of your choosing Note: it is advised to do so in a new branch

git checkout -b rename
yarn rename <new_name> -b <bundle_identifier>

Removing Redux:

I personally like Redux for state management for larger apps but sometimes if the app is relatively smaller then I stick to using context api or simple useState or useReducer

Checkout this great light weight Redux like implementation using just the React Context api: No-Redux

If you like to use other great solutions such as MobX, RxJS then feel free to remove redux by using yarn redux:remove

Note: you will have to configure the project files accordingly 😅

Running the project

Assuming you have all the requirements installed, you can setup and run the project by running:

  • yarn install to install the dependencies

  • use the following steps for your platform

Android

Run the following command while the simulator is open or a device is connected via adb.

yarn android

iOS

Run the following commands to install pods and run the app on iPhone 6 simulator (device can be changed via package.json scripts)

yarn cocoapods
yarn ios

Updates

The boilerplate will follow latest React Native releases as soon as libraries and tools used here are compatible. I will personally try update this as I use this boilerplate in production 😄

Known Issues:

Cocoapods install fails

yarn cocoapods might fail for some users, if this happens then try deleting Podlock.file and re-running the yarn cocoapods command 😄

If the error persists then please check your cocoapods version using pod --version . It should be >= 1.7.5 . If not then please run sudo gem install cocoapods 😃

More Repositories

1

system-design

Learn how to design systems at scale and prepare for system design interviews
31,424
star
2

fullstack-starterkit

GraphQL first full-stack starter kit with Node, React. Powered by TypeScript
TypeScript
1,168
star
3

learn-go

Master the fundamentals and advanced features of the Go programming language
Go
877
star
4

Proximity

An Open Source social media that does not use your data against you
TypeScript
358
star
5

portfolio

My portfolio website with built-in blogs and courses support
MDX
285
star
6

HyperTrade

Ready to deploy, distributed cryptocurrency trading bot
Go
256
star
7

tutorials

This repository contains all the code snippets from articles and videos
Go
107
star
8

roadmaps

Roadmaps for AWS, DevOps, and Frontend
95
star
9

delhi-metro-app

Delhi metro app with React Native TypeScript
TypeScript
18
star
10

preview-environments

Quickly create temporary preview environments
TypeScript
14
star
11

uno

Classic UNO card game implemented with React and Python using Socket.IO for realtime multiplayer functionality.
TypeScript
14
star
12

KCards

An app that helps you leave your paper based business cards behind
13
star
13

s3-explorer

AWS S3 bucket explorer
Go
9
star
14

webdrop

Share files with people nearby instantly and securely. Open Source and Peer2Peer.
TypeScript
9
star
15

scale-etl

Partition, Transform, Load, and Search large CSV files
Go
8
star
16

digital-card

My personal digital card in the terminal!
JavaScript
7
star
17

cloudflare-workers-typescript

Cloudflare Workers TypeScript setup with esbuild
TypeScript
6
star
18

flask-postgres

Python
2
star
19

okteto-demo

Demo for okteto
Go
2
star