An opinionated expo-starter for building robust cross-platform apps blazingly fast with expo-router! This project purpose is for creating a minimum viable product (MVP) in a single day.
-
Expo
-
expo-image
-
zustand - state management
-
nativewind - Tailwind CSS for React Native
-
axios - Promise based HTTP client
-
i18next - Internationalization-framework
-
@shopify/flash-list - React Native flash list component
-
OneSignal - Push Notification delivery
-
Lottie - Animated Splash Screen
I have no qualms with the Expo Push service, it has been reliable and easy to work with. However, in considering the goal of this template future needs and growth, I've decided to use OneSignal for several key reasons:
- Unlimited API Push: OneSignal offers unlimited push notifications. This is critical as our user base grows, ensuring we can maintain efficient and reliable communication with our users without worrying about hitting a cap.
- Richer Analytics: OneSignal provides comprehensive analytics, giving us more detailed insights into how our users interact with notifications. This can help us refine our engagement strategies and understand our users better.
- Advanced Features: Beyond push notifications, OneSignal offers capabilities for in-app messages, emails, and SMS. This makes it a more holistic communication tool that can support our multi-channel engagement strategy.
- Scalability and Versatility: OneSignal is designed to handle large volumes of notifications and works independently of the Expo ecosystem. This gives us the flexibility to migrate away from Expo in the future if needed, without having to change our notification system.
-
src
- source code for the application. -
src/components
- contains reusable components. -
src/screens
- contains the application's screens. -
src/assets
- contains the application's assets (all the assets stored here will be bundled into the app). -
src/config
- contains the application's config files. -
src/constants
- contains the application's constants. -
src/context
- contains the application's theme. -
src/locales
- contains the application's local files (i18n, i18next, expo-localization). -
src/store
- contains the application's zustand store for state managment. -
src/utils
- contains the application's utils for helper functions.
-
Clone the repository.
-
Install the dependencies using
yarn install
. -
Start the expo server using
yarn start
.
- If you don't have a OneSignal account register]
- Create and App and get OneSignal App ID, available in Settings > Keys & IDs
- Add the OneSignal App ID in root/app.json and load it inside _layout.tsx via expo-constants or
- Load App ID explicitly inside _layout.tsx (src/app/_layout.tsx)
- To handle push notification user logic you can check out OneSignal documentation.
The OneSignal implementation in this Expo project provided by onesignal-expo-plugin
You can create awesome animated Splash Screen. You simple need the Lottie json file to be imported and you are good to go!
- Create a .env file in the root.
- Define env variables inside the .env file
- Use env variables everywhere by import env-loader
import ENV from '_utils/env-loader';
const env_weather_api_key = ENV.WEATHER_API_KEY;
That's it! Nice and simple way of dealing with environment variables.
-
Init Expo-router project with TypeScript. -
Create a src/ folder structure. -
Add Nativewind. -
Load Google fonts. -
Prettier. -
i18next. -
Implement One Signal notifications. -
Load ENV variables in a simple way -
Home page with a carousel and two example lists with Shopify flashlist. -
Create a detail page when clicking on an element on the carousel or list item. -
Animated Splash Screen with Lottie Animations -
Add Login Screen/ Register modal.@kewinzaq1
- Dark/light theme.
- Settings screen with light/dark toggle switch and language selector.
-
Tutorial screens.
-
Create an example axios weather call and store it in zustand for creating a universal header component.
-
Create another tab with universal elements.
-
Re-usable components (Logo, Cards, etc.)
-
Instead of simple axios calls using react-query. If you have any opinion about this feel free to open a discussion.
-
Create a universal library for handling expo-icons. -> Create a universal component which can handle all the icon libs within one component.
-
E-commerce components/pages
-
Subscription implementation with RevenueCat
If you have any suggestions on how to make this expo-starter better, feel free to create a discussion about it.
This project is licensed under the terms of the MIT license.