UNPKG

create-nova-expo-template

Version:

A template for creating a new React Native app using Expo and TypeScript, with a focus on performance and best practices.

227 lines (193 loc) • 10.1 kB
# šŸš€ **Expo Template** This is a React Native template built with Expo 57. It provides a modern and responsive foundation for building mobile applications. It includes: - Navigation (Auth/Main stacks) - Theming and styling - API integration - State management - Localization using i18n - Reusable components - Utility functions - Custom hooks - Scripts for easing development tasks - Building tool (EAS) - An overall ready-for-integration template with an atomic design system. ## šŸ“‹ Table of Contents - [✨ Features](#-features) - [šŸ› ļø Installation](#ļø-installation) - [āš™ļø Prerequisites](#ļø-prerequisites) - [šŸ“š Usage](#-usage) - [šŸ“ø Screenshots](#-screenshots) - [šŸ—ļø Project Structure](#ļø-project-structure) - [šŸ“‹ Changelog](#-changelog) - [šŸ¤ Contributing](#-contributing) - [šŸ“„ License](#-license) ## ✨ Features - **[React Native](https://reactnative.dev/)**: A framework for building native apps using React. - **[Expo](https://expo.dev/)**: A framework and platform for universal React applications. - **[TypeScript](https://www.typescriptlang.org/)**: A strongly typed programming language that builds on JavaScript. - **[React Navigation](https://reactnavigation.org/)**: Routing and navigation for React Native apps. - **[Redux Toolkit](https://redux-toolkit.js.org/)**: A toolset for efficient Redux development. - **[RTK Query](https://redux-toolkit.js.org/rtk-query/overview)**: Powerful data fetching and caching tool. - **[React Toastify](https://fkhadra.github.io/react-toastify/)**: Easy-to-use toast notifications. - **[React-i18next](https://react.i18next.com/)**: Internationalization for React Native. - **[Day.js](https://day.js.org/)**: A lightweight JavaScript date library. - **[Flashlist](https://shopify.github.io/flash-list/)**: A performant list component for React Native. - **[React Hook Form](https://react-hook-form.com/)**: Performant, flexible, and extensible forms with easy-to-use validation. - **[Atomic Design System](https://bradfrost.com/blog/post/atomic-web-design/)**: A methodology for creating design systems. - **[Husky](https://typicode.github.io/husky/)** (optional): Git hooks made easy. - **[ESLint](https://eslint.org/)** (optional): A tool for identifying and fixing problems in JavaScript code. - **[Sentry](https://sentry.io/)** (optional): Error monitoring software. - **Reusable Components**: Modular and reusable components for easy customization. - **State Management**: Integrated state management using Redux or context. ## šŸ› ļø Installation To get started with this project, follow these steps: 1. Install the Template: ```bash npx create-nova-expo-template ``` 2. Navigate to the project directory: ```bash cd <project-name> ``` 3. Run the project: ```bash npm start ``` ### āš™ļø Prerequisites Ensure you have the following installed: - **Node.js**: v16.14.0 or higher (currently using v20.17.0) - **npm**: v8.5.0 or higher (currently using v10.8.2) ## šŸ“š Usage To start the development server, run: ```bash npm start ``` To build the project for production, run: ```bash expo build ``` To preview the production build, run: ```bash expo start --no-dev --minify ``` ## šŸ“ø Screenshots Here are some screenshots of the application: ![Screenshot 1](screenshots/landing.jpg) ![Screenshot 2](screenshots/login.jpg) ![Screenshot 3](screenshots/app.jpg) ![Screenshot 4](screenshots/modal.jpg) ![Screenshot 5](screenshots/actionsheet.jpg) ![Screenshot 6](screenshots/darkmode.jpg) ![Screenshot 7](screenshots/flashlist.jpg) ## šŸ—ļø Project Structure ``` your-app-name/ # Your new Expo app ā”œā”€ā”€ šŸ“„ app.json # Expo app configuration ā”œā”€ā”€ šŸ“„ eas.json # EAS Build configuration ā”œā”€ā”€ šŸ“„ expo-env.d.ts # Expo environment types ā”œā”€ā”€ šŸ“„ package.json # Project dependencies ā”œā”€ā”€ šŸ“„ tsconfig.json # TypeScript configuration │ ā”œā”€ā”€ šŸ“ @types/ # Global TypeScript definitions │ ā”œā”€ā”€ šŸ“„ static-files.d.ts # Static file types │ └── šŸ“„ TranslationKeyEnum.ts # Translation key enums │ ā”œā”€ā”€ šŸ“ apis/ # API layer │ ā”œā”€ā”€ šŸ“„ Domain.ts # API domain configuration │ ā”œā”€ā”€ šŸ“„ index.ts # API exports │ ā”œā”€ā”€ šŸ“„ tagTypes.ts # RTK Query tag types │ ā”œā”€ā”€ šŸ“ @types/ # API type definitions │ ā”œā”€ā”€ šŸ“ middlewares/ # API middlewares │ └── šŸ“ services/ # API service endpoints │ ā”œā”€ā”€ šŸ“ app/ # App routing (Expo Router) │ ā”œā”€ā”€ šŸ“„ _layout.tsx # Root layout │ ā”œā”€ā”€ šŸ“„ +not-found.tsx # 404 page │ ā”œā”€ā”€ šŸ“„ index.tsx # Home/Landing page │ ā”œā”€ā”€ šŸ“ (auth)/ # Authentication stack │ │ ā”œā”€ā”€ šŸ“„ _layout.tsx # Auth layout │ │ ā”œā”€ā”€ šŸ“ forgotPassword/ # Password reset screens │ │ ā”œā”€ā”€ šŸ“ login/ # Login screens │ │ ā”œā”€ā”€ šŸ“ signup/ # Registration screens │ │ └── šŸ“ welcome/ # Welcome/onboarding │ └── šŸ“ (main)/ # Main app stack │ ā”œā”€ā”€ šŸ“„ _layout.tsx # Main layout │ ā”œā”€ā”€ šŸ“ (tabs)/ # Tab navigation │ ā”œā”€ā”€ šŸ“ screen1/ # Feature screens │ ā”œā”€ā”€ šŸ“ screen2/ │ └── šŸ“ screen3/ │ ā”œā”€ā”€ šŸ“ assets/ # Static assets │ ā”œā”€ā”€ šŸ“ fonts/ # Custom fonts │ ā”œā”€ā”€ šŸ“ icons/ # Icon components │ ā”œā”€ā”€ šŸ“ images/ # Image assets │ └── šŸ“ svgs/ # SVG components │ ā”œā”€ā”€ šŸ“ components/ # UI Components (Atomic Design) │ ā”œā”€ā”€ šŸ“ atoms/ # Basic building blocks │ │ ā”œā”€ā”€ šŸ“ Button/ # Button component │ │ ā”œā”€ā”€ šŸ“ Input/ # Input component │ │ ā”œā”€ā”€ šŸ“ Text/ # Text component │ │ └── šŸ“„ index.ts # Atom exports │ ā”œā”€ā”€ šŸ“ molecules/ # Component combinations │ │ ā”œā”€ā”€ šŸ“ common/ # Shared molecules │ │ └── šŸ“ scoped/ # Feature-specific molecules │ ā”œā”€ā”€ šŸ“ organisms/ # Complex components │ │ ā”œā”€ā”€ šŸ“ common/ # Shared organisms │ │ └── šŸ“ scoped/ # Feature-specific organisms │ ā”œā”€ā”€ šŸ“ templates/ # Page templates │ └── šŸ“ wrappers/ # Higher-order components │ ā”œā”€ā”€ šŸ“ constants/ # App constants │ ā”œā”€ā”€ šŸ“„ Colors.ts # Color palette │ ā”œā”€ā”€ šŸ“„ FontFamily.ts # Font definitions │ ā”œā”€ā”€ šŸ“„ GlobalStyles.ts # Global styles │ ā”œā”€ā”€ šŸ“„ Metrics.ts # Screen dimensions │ └── šŸ“„ TranslationConfig.ts # i18n configuration │ ā”œā”€ā”€ šŸ“ hooks/ # Custom React hooks │ ā”œā”€ā”€ šŸ“„ useBiometricLogin.tsx # Biometric authentication │ ā”œā”€ā”€ šŸ“„ useColorScheme.ts # Theme management │ ā”œā”€ā”€ šŸ“„ useFetchTranslation.ts # Localization hook │ └── šŸ“„ useThemeColor.ts # Color theme hook │ ā”œā”€ā”€ šŸ“ locale/ # Internationalization │ ā”œā”€ā”€ šŸ“„ ar.json # Arabic translations │ ā”œā”€ā”€ šŸ“„ en.json # English translations │ └── šŸ“„ index.ts # i18n exports │ ā”œā”€ā”€ šŸ“ redux/ # State management │ ā”œā”€ā”€ šŸ“„ index.ts # Store configuration │ ā”œā”€ā”€ šŸ“„ appReducer.ts # App state slice │ └── šŸ“„ authReducer.ts # Auth state slice │ ā”œā”€ā”€ šŸ“ scripts/ # Development scripts │ ā”œā”€ā”€ šŸ“„ generate-svg.js # SVG component generator │ ā”œā”€ā”€ šŸ“„ removeLogs.js # Production log removal │ ā”œā”€ā”€ šŸ“„ sync-translations.js # Translation sync │ └── šŸ“„ translate.js # Auto-translation tool │ ā”œā”€ā”€ šŸ“ styles/ # Global styles │ └── šŸ“ utils/ # Utility functions ā”œā”€ā”€ šŸ“„ debounce.ts # Debounce utility ā”œā”€ā”€ šŸ“„ handleErrors.ts # Error handling ā”œā”€ā”€ šŸ“„ loginHandler.ts # Authentication helpers └── šŸ“„ showSuccessMsg.ts # Success messaging ``` ### šŸ“‚ Key Directories Explained - **`app/`**: Uses Expo Router for file-based routing with layout components - **`components/`**: Follows Atomic Design methodology (atoms → molecules → organisms → templates) - **`apis/`**: Centralized API layer with RTK Query for data fetching and caching - **`redux/`**: State management using Redux Toolkit with separate slices - **`hooks/`**: Custom React hooks for reusable logic - **`constants/`**: App-wide constants including colors, fonts, and metrics - **`locale/`**: Multi-language support with JSON translation files - **`utils/`**: Helper functions and utilities - **`scripts/`**: Development automation scripts ## šŸ“‹ Changelog See the [CHANGELOG](CHANGELOG.md) for a history of changes to this project. ## šŸ¤ Contributing Contributions are welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first. ## šŸ“„ License This project is licensed under the MIT License.