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
Markdown
# š **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:







## šļø 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.