All Projects → dooboolab → dooboo-expo

dooboolab / dooboo-expo

Licence: MIT license
Complete boilerplate for react-native app with expo. Contains typescript, router, test, localization, navigation, hook and etc.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to dooboo-expo

React Native Examples
A repo that contain React Native examples most related to tutorials I publish
Stars: ✭ 222 (+326.92%)
Mutual labels:  expo
tasit-apps
Native mobile Ethereum dapps for mainstream users
Stars: ✭ 35 (-32.69%)
Mutual labels:  expo
markets-react
📈 Check the stock market, from your phone!
Stars: ✭ 47 (-9.62%)
Mutual labels:  expo
Galio
Galio is a beautifully designed, Free and Open Source React Native Framework
Stars: ✭ 2,772 (+5230.77%)
Mutual labels:  expo
react-native-expo-examples
Learn React Native (Expo CLI) by examples.
Stars: ✭ 167 (+221.15%)
Mutual labels:  expo
expo-file-manager
A file manager app made with React Native & Expo
Stars: ✭ 110 (+111.54%)
Mutual labels:  expo
React Native Youtube Iframe
A wrapper of the Youtube-iframe API built for react native.
Stars: ✭ 221 (+325%)
Mutual labels:  expo
freecbt
✨🐙 A GPL Licensed Cognitive Behavioral Therapy app for iOS and Android
Stars: ✭ 49 (-5.77%)
Mutual labels:  expo
expo-video-player
Customizable Video Player controls for Expo
Stars: ✭ 174 (+234.62%)
Mutual labels:  expo
expo-push-notification-helper
💬🔥This package helps you make expo push notification for React Native easy to use.
Stars: ✭ 32 (-38.46%)
Mutual labels:  expo
Pillar Valley
👾A cross-platform video game built with Expo, three.js, and Firebase! 🎮🕹
Stars: ✭ 242 (+365.38%)
Mutual labels:  expo
Rn Pdf Reader Js
📄 PDF reader in JavaScript only for Expo - Android & iOS capable
Stars: ✭ 254 (+388.46%)
Mutual labels:  expo
4noobs-mobile
App mobile do 4Noobs
Stars: ✭ 69 (+32.69%)
Mutual labels:  expo
Use Expo
Complementary hooks for Expo
Stars: ✭ 233 (+348.08%)
Mutual labels:  expo
react-native-qrimage-decoder
QR image decoder for React Native
Stars: ✭ 13 (-75%)
Mutual labels:  expo
React Native
📓 Storybook for React Native!
Stars: ✭ 222 (+326.92%)
Mutual labels:  expo
react-native-todo
Todo-List app using react-native SwipeView and redux.js with ES6 standards
Stars: ✭ 77 (+48.08%)
Mutual labels:  expo
hackerweb-native-2
HackerWeb 2: A read-only Hacker News client.
Stars: ✭ 51 (-1.92%)
Mutual labels:  expo
react-native-bottom-bar
Fully customizable BottomBar with unique design shape for React Native.
Stars: ✭ 74 (+42.31%)
Mutual labels:  expo
photos
"Fx Fotos" is an opensource gallery app in react native with the same smoothness and features of Google Photos and Apple Photos. It is backend gnostic and connects to decentralized backends like "box", "Dfinity", "Filecoin" and "Crust".
Stars: ✭ 620 (+1092.31%)
Mutual labels:  expo

ANNOUNCEMENT

DO NOT MODIFY OR CHANGE THE CODE BEFORE CONFIRMED BY DOOBOOLAB. THIS REPOSITORY IS USED IN DOOBOO-CLI.

Expo TS Boilerplate

CI codecov

Specification

Gain points

1. Sample of context-api with `react-hook` (`useContext`).
2. Know how to structure react native app with typescript.
3. Know how to navigate between screens with `react-navigation`.
4. Know how to write test code with `testing-library`.
5. Know how to `lint` your project with `eslint` for both `ts` and maybe some `js`.
6. Know how to localize your project.

INSTALL

npm install && npm start
// or
yarn && yarn start

Structures

app/
├─ .doobooo // necessary if using dooboo-cli
├─ .expo
├─ assets
│  └─ icons // app icons
│  └─ images // app images like background images
├─ node_modules/
├─ src/
│  └─ apis
│  └─ components
│     └─ navigations
│     └─ screen
│     └─ shared
│  └─ contexts
│  └─ utils
│  └─ App.tsx
├─ test/
├─ .buckconfig
├─ .flowconfig
├─ .gitattributes
├─ .gitignore
├─ .watchmanconfig
├─ app.json
├─ babel.config.js
├─ index.js
├─ jest.config.js
├─ package.json
├─ README.md
├─ STRINGS.js
├─ tsconfig.json
└─ tslint.json

Running the project

Running the project is as simple as running

npm run start

This runs the start script specified in our package.json, and will spawn off a server which reloads the page as we save our files. Typically the server runs at http://localhost:8080, but should be automatically opened for you.

Testing the project

Testing is also just a command away:

npm test

Result

> jest -u

 PASS  src/components/shared/__tests__/Button.test.tsx
 PASS  src/components/screen/__tests__/Intro.test.tsx
 › 2 snapshots written.

Snapshot Summary
 › 2 snapshots written in 1 test suite.

Test Suites: 2 passed, 2 total
Tests:       5 passed, 5 total
Snapshots:   2 added, 4 passed, 6 total
Time:        3.055s, estimated 6s
Ran all test suites

Writing tests with Jest

We've created test examples with jest-ts in src/components/screen/__tests__ and src/components/shared/__tests__. Since react is component oriented, we've designed to focus on writing test in same level of directory with component. You can simply run npm test to test if it succeeds and look more closer opening the source.

Localization

We've defined Localization strings in STRINGS.js which is in root dir. We used react-native-localization pacakage for this one.

import * as Localization from 'expo-localization';
import i18n from 'i18n-js';

const en = {
  HELLO: 'Hello',
  LOGIN: 'Login',
  EMAIL: 'Email',
  PASSWORD: 'Password',
  SIGNUP: 'SIGN UP',
  FORGOT_PW: 'Forgot password?',
  NAVIGATE: 'Navigate',
  CHANGE_THEME: 'Change theme',
};

const ko = {
  HELLO: '안녕하세요',
  LOGIN: '로그인',
  EMAIL: '이메일',
  PASSWORD: '패스워드',
  SIGNUP: '회원가입',
  FORGOT_PW: '비밀번호를 잊어버리셨나요?',
  NAVIGATE: '이동하기',
  CHANGE_THEME: '테마변경',
};

i18n.fallbacks = true;
i18n.translations = { en, ko };
i18n.locale = Localization.locale;

export const getString = (param: string, mapObj?: object) => {
  if (mapObj) {
    i18n.t(param, mapObj);
  }
  return i18n.t(param);
};

Fixed jest setup by adding following in jestSetup.

import { NativeModules } from 'react-native';

/**
 * monkey patching the locale to avoid the error:
 * Something went wrong initializing the native ReactLocalization module
 * https://gist.github.com/MoOx/08b465c3eac9e36e683929532472d1e0
 */

NativeModules.ReactLocalization = {
  language: 'en_US',
};

Vscode prettier and eslint setup

"eslint.enable": true,
"eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
],
// prettier extension setting
"editor.formatOnSave": true,
"[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"prettier.arrowParens": "always",
"prettier.jsxSingleQuote": true

Expo

46

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].