Giter Site home page Giter Site logo

binarapps / expo-ts-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kacgrzes/expo-template

10.0 2.0 2.0 11.19 MB

Template for expo apps with typescript support

Shell 0.22% JavaScript 7.78% TypeScript 92.01%
expo expo-starter expo-template react react-native react-native-navigation react-native-starter react-native-template

expo-ts-template's Introduction

Logo

MIT License MIT License MIT License MIT License runs with Expo Go

@binarapps/expo-ts-template

This is a template to be used with react native and expo. It includes all the necessary stuff to start working with expo framework. It has the most popular packages included, so it's easier to start coding the app itself without all the necessary boilerplate setup.

Documentation

Check out our documentation page, it contains:

  • Bootstraping project - tutorial how to easy setup from scrath
  • Deploying app
  • Tutorials
    • How to manage environment variables
    • Use jotai as state management tool

Why to use?

We know there are a lot of project starters for react native, but we have some good features:

  • Fully works with EXPO GO
    • Good for start the project and later you can switch to expo-dev-client
  • Fully works on WEB
    • If you want to develop apps both on web and mobile this starter is good choice for you
  • Code generators (create new screen / create new component)
  • Fully + Strong typed
  • App deployment documentation (currently in progress, but it will be added in near future)

How it looks?

Check this recording of how it look like:

expo-ts-template binarapps

How to use?

We have prepared a detailed documentation for how to run project with this template - Bootstrap docs

It's great for production project, but if you want to just test it, you can follow the quick steps (on the bottom).

Quick steps:

  • npx create-expo-app --template=@binarapps/expo-ts-template name_of_your_app
  • cd name_of_your_app
  • yarn bootstrap - the cli will ask you some questinos about your app (you can fill all this data later)

What's inside?

MIT License MIT License MIT License

Implemented custom features

  • generators:
    • create screen - yarn generate:screen
    • create component - yarn generate:component
  • support of multiple environments
    • production, staging, qa
  • eas configuration
    • update, build, submit
  • verifying code on pull request - pipelines
    • when creating pull request on github, there are tests, linters and types checks. If there will be some error you will be notified that something is wrong.
  • custom fonts
    • wait to load fonts and all the assets
  • dark / light theme support
    • color scheme detection (dark / light mode toggle)
  • navigation
    • screen tracking hook
    • state persistence on development mode
    • prevent go back (to be used on forms for example)
    • strong types, prevent issues in future
  • auth flow ready for implementation details
    • using expo-secure-store module to save user token
    • right now it has simple signIn/signOut flow
  • animations with reanimated and moti

Implemented libraries

  • TypeScript
    • app is fully typed
  • Expo v49
  • React Navigation v6
  • Prettier and eslint
    • code formatting
    • code checking
  • Babel-module-resolver
    • unified imports
  • jest and @testing-library/react-native
    • unit tests
  • i18next
    • translations
    • language detection
  • @gorhom/bottom-sheet
  • Expo-notifications
    • You can read how to configure them here
  • Reactotron
    • used for debugging
  • Reanimated v2
  • Axios + React query
    • Fetching data from backend

What is planned in the future?

  • add some state management tool - in progress
  • write docs (app deployment, app setup and more) - in progress
  • tutorial on how to use features
    • navigation
    • deeplinking
    • auth flows
    • components
    • react query
    • api calls
    • state management tool
  • Add desings (figma) and redesing whole app
  • Updating expo versions (in future)
  • Deploy app to appstore and playstore
    • Create sample app and document the process of deployment
  • Improve mock server logic
  • add commit lint
  • add script that display last update information (eas update)

Implementations to add

How to contribute?

Contributions are always welcome!

See CONTRIBUTING.md for ways to get started.

Please adhere to this project's code of conduct.

How to run locally?

Clone the project

  git clone https://github.com/binarapps/expo-ts-template.git

Go to the project directory

  cd expo-ts-template

Install dependencies

  yarn

Start the expo server

  yarn start

Adding jotai as state management tool

This starter doesn't go with any state management tool, but we have created separate branch with jotai setup, maybe in the future we will add more tools support.

To use jotai with this starter you can check docs: Jotai docs

License

MIT

Feedback

If you have any feedback, please reach out to me at [email protected]

Contributors

Similar packages

Outdated (not maintained anymore)

expo-ts-template's People

Contributors

andrzejzab avatar kacgrzes avatar karol-andracki avatar lukasz-patalan avatar mario688 avatar mateuszrostkowski avatar matiswierczynski avatar mszalowski avatar sworzen1 avatar vercia avatar zagoorland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

expo-ts-template's Issues

💡 [REQUEST] - Add feature flags

Start Date

No response

Implementation PR

No response

Reference Issues

#41

Summary

Create a custom Feature flag component or integrate a library that provides that.

Basic Example

Feature flag component should allow to dynamically enable/disable features in the mobile application.

Drawbacks

Drawbacks depend on a chosen solution.

Unresolved questions

No response

💡 [REQUEST] - Setup CI/CD

Start Date

No response

Implementation PR

No response

Reference Issues

Sub of #41

Summary

Based on TODO.md:5 make some configuration or write in documentation guide on how to configure CI/CD on bitrise or anywhere.

Basic Example

We already have github actions and eas preconfigured. We could wrap them up all together to trigger builds on new versions or pull requests.

Drawbacks

Most likely we are not able to have one generic solution as clients might require different based on pricings. So it might be better to have written just guides in the documentation on how to setup repo + actions + CD.

Unresolved questions

No response

Remove native-base

Right now we are using native base and maintainers of the native base are abandoning the support for this library.

That means we need to find other alternative and use it in the template.

🐛 [BUG] - ref not passing to Box component

Description

ref prop is not passed to Box component.

Reproduction URL

#55

Reproduction steps

1. Pass ref to Box
2. It's just not working

Screenshots

No response

Logs

No response

Browsers

No response

OS

Windows, Linux, Mac

💡 [REQUEST] - Add simple gitlab pipelines

Start Date

No response

Implementation PR

No response

Reference Issues

No response

Summary

Add basic setup of gitlab pipelines:

  • Install modules
  • Run tests and linters on merge request

Basic Example

stages:
  - dotenv
  - test

before_script:
  - yarn

## Running tests and linters
lint_test:
  image: node:16
  stage: test
  script:
    - echo "Running linters"
    - yarn lint
    - yarn tsc
    - echo "Running tests"
    - yarn test:final
    - echo "Linters and tests passed correctly"
  rules:

    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"
      when: always
    - when: never
  cache:
    untracked: true
    key: ${CI_COMMIT_REF_SLUG}

Drawbacks

We will need to maintain this script after making some changes.

Unresolved questions

No response

💡 [REQUEST] - Handle offline mode

Start Date

No response

Implementation PR

No response

Reference Issues

#41

Summary

Investigate most common scenarios to handle when app is out of the internet connection.

Basic Example

Display an alert that the app turned offline.

Drawbacks

Unresolved questions

No response

💡 [REQUEST] - Implement Code Obfuscation for App Store and Google Play Store Builds

Start Date

No response

Implementation PR

No response

Reference Issues

No response

Summary

Background:
To enhance the security of our React Native application, especially before deploying it to the App Store and Google Play Store, it's important to implement code obfuscation techniques. This will make it more difficult for attackers to reverse-engineer our application.

Request:
Implement code obfuscation for both Android and iOS builds of the application. This should make our app's code more resilient against decompiling attempts and improve overall security.

Basic Example

https://github.com/javascript-obfuscator/react-native-obfuscating-transformer

Drawbacks

nd

Unresolved questions

No response

💡 [REQUEST] - Add storybook

Start Date

No response

Implementation PR

No response

Reference Issues

#41

Summary

As documentation describes:
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and documentation. It’s open source and free.

Basic Example

From documentation:

// Button.stories.ts|tsx

import type { Meta, StoryObj } from '@storybook/react';

import { Button } from './Button';

const meta: Meta<typeof Button> = {
  component: Button,
};

export default meta;
type Story = StoryObj<typeof Button>;

/*
 *👇 Render functions are a framework specific feature to allow you control on how the component renders.
 * See https://storybook.js.org/docs/react/api/csf
 * to learn how to use render functions.
 */
export const Primary: Story = {
  render: () => <Button primary label="Button" />,
};

Drawbacks

  • Additional layer of complexity.
  • Requires additional work on a new components

Unresolved questions

No response

Project bootstrap documentation

Currently we have great bootstrap script, but it's not documented at all. We need to create some instructions for developers to help them creating projects faster.

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.