|
1 | | -<h1 style="text-align: center;">React Native Lab</h1> |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | -**GITHUB** \ |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | -[](https://github.com/developer-sumit/react-native-lab/actions/workflows/publish.yml) |
13 | | - |
14 | | -**NPM** \ |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | -`react-native-lab` is a cli tool to set up a React Native project with some pre-defined configurations. This tool helps you quickly set up a React Native development environment, including installing necessary dependencies like JDK, Android Studio. |
20 | | - |
21 | | -This project is inspired by the simplicity and effectiveness of [create-next-app](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). |
22 | | - |
23 | | -<h2 style="text-align: center;">Table of Contents</h2> |
24 | | - |
25 | | -- 🚀 [Features](#features) |
26 | | -- 📸 [Screenshots](#screenshots) |
27 | | -- ⚙️ [Prerequisites](#prerequisites) |
28 | | -- 🏁 [Getting Started](#getting-started) |
29 | | -- 🛠️ [Common Issues](#common-issues) |
30 | | -- 🆘 [Getting Help](#getting-help) |
31 | | -- 🤝 [Contributing](#contributing) |
32 | | -- 📜 [License](#license) |
33 | | - |
34 | | -<h2 id="features" style="text-align: center;">🚀 Features</h2> |
35 | | - |
36 | | -1. **Installs JDK (OpenJDK)**: Automatically installs the necessary JDK for Android development. |
37 | | -1. **Installs Android Studio**: Sets up Android Studio, including the necessary SDKs and tools. |
38 | | -1. **Sets Environment Variables**: Configures system environment variables such as `ANDROID_HOME`, `ANDROID_SDK_ROOT`, and `JAVA_HOME`. |
39 | | -1. **Pre-built Templates**: Choose from a variety of pre-built templates to kickstart your React Native project. |
40 | | - |
41 | | - - `Blank` |
42 | | - - `Bottom Navigation` |
43 | | - - `Drawer Navigation` |
44 | | - - `Stack Navigation` |
45 | | -1. **Project Structure**: Creates an `src` folder for you want. |
46 | | -1. **Cross-Platform Support**: Works on `Windows`, `macOS`, and `Linux`. |
47 | | -1. **Environment Setup**: |
48 | | - - Sets up a `.env` file for managing environment variables. |
49 | | - - Offers choice between `react-native-config` and `react-native-dotenv` for handling environment variables. |
50 | | -1. **Alias Configuration**: Configures path aliases for cleaner and more manageable imports. |
51 | | -1. **NativeWind Integration**: Install and configure NativeWind for styling. |
52 | | -1. **React Native Version Selection**: Allows you to set up the project with your preferred React Native version. |
53 | | -1. **Console Remover**: Automatically removes console logs in production builds, enhancing security and slightly reducing app size. |
54 | | -1. **Custom Hooks**: Option to include a set of useful custom hooks: |
55 | | - - `useDebounce`: Delays invoking a function until after a wait period. |
56 | | - - `useThrottle`: Limits the rate at which a function can fire. |
57 | | - - `usePrevious`: Accesses the previous value of a state or prop. |
58 | | - - `useOrientation`: Detects and responds to device orientation changes. |
59 | | - - `useResponsiveLayout`: Provides responsive layout information based on screen size. |
60 | | - |
61 | | - |
62 | | - |
63 | | -<h2 id="screenshots" style="text-align: center;">📸 Screenshots</h2> |
64 | | - |
65 | | -Here are the available templates you can use with `react-native-lab`: |
66 | | - |
67 | | -<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; max-width: 500px;"> |
68 | | - <div style="text-align: center;"> |
69 | | - <h4>Blank Template</h4> |
70 | | - <img src="./images/blank-template.png" alt="Blank Template" style="width: 100%; border-radius: 10px;"> |
71 | | - </div> |
72 | | - <div style="text-align: center;"> |
73 | | - <h4>Navigation Template</h4> |
74 | | - <img src="./images/navigation-template.png" alt="Navigation Template" style="width: 100%; border-radius: 10px;"> |
75 | | - </div> |
76 | | -</div> |
77 | | - |
78 | | -<h2 id="prerequisites" style="text-align: center;">⚙️ Prerequisites</h2> |
79 | | - |
80 | | -- Node.js (v18 or higher) |
81 | | -- npm (v6 or higher) |
82 | | - |
83 | | -<h2 id="getting-started" style="text-align: center;">🏁 Getting Started</h2> |
84 | | - |
85 | | -To get started with `react-native-lab`, follow these steps: |
86 | | - |
87 | | -1. Ensure you have all the prerequisites installed on your system. |
88 | | -2. You can use `npx` to run the tool without installing it: |
89 | | - ```sh |
90 | | - npx react-native-lab@latest |
91 | | - ``` |
92 | | - |
93 | | -<h2 id="common-issues" style="text-align: center;">🛠️ Common Issues</h2> |
94 | | - |
95 | | -- **Installation Errors**: Ensure you have the correct versions of Node.js and npm installed. Try clearing the npm cache: |
96 | | - ```sh |
97 | | - npm cache clean --force |
98 | | - ``` |
99 | | -- **Permission Errors**: Run the command with elevated privileges (e.g., using `sudo` on macOS/Linux or running the terminal as an administrator on Windows). |
100 | | - |
101 | | -<h2 id="getting-help" style="text-align: center;">🆘 Getting Help</h2> |
| 1 | +<h1 style="text-align: center;">🧪 React Native Lab</h1> |
102 | 2 |
|
103 | | -If you need further assistance, you can: |
| 3 | +<div align="center"> |
104 | 4 |
|
105 | | -- Check the [GitHub Issues](https://github.com/developer-sumit/react-native-lab/issues) for similar problems. |
106 | | -- Open a new issue with detailed information about your problem. |
107 | | -- Reach out to the community for support. |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
108 | 13 |
|
109 | | -By following these steps, you should be able to resolve most issues and get your React Native project up and running smoothly. |
110 | | - |
111 | | -<h2 id="contributing" style="text-align: center;">🤝 Contributing</h2> |
112 | | - |
113 | | -Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. |
114 | | - |
115 | | -To contribute: |
116 | | - |
117 | | -1. Fork the repository. |
118 | | -2. Create a new branch (`git checkout -b feature`). |
119 | | -3. Make your changes. |
120 | | -4. Commit your changes (`git commit -m 'Add some feature'`). |
121 | | -5. Push to the branch (`git push origin feature`). |
122 | | -6. Open a pull request. |
123 | | - |
124 | | -Please make sure to follow the project's coding guidelines and standards. |
125 | | - |
126 | | -<h2 id="license" style="text-align: center;">📜 License</h2> |
127 | | - |
128 | | -This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
129 | | - |
130 | | -<h2 id="changelog" style="text-align: center;">📜 Changelog</h2> |
| 14 | +</div> |
131 | 15 |
|
132 | | -For a detailed list of changes and updates, please refer to the [Changelog](./CHANGELOG.md). |
| 16 | +<p align="center"> |
| 17 | + <b>The ultimate CLI to kickstart your React Native journey with professional-grade templates and tools.</b> |
| 18 | +</p> |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +`react-native-lab` automates the boring setup of React Native projects. We handle the configuration so you can start coding instantly. |
| 23 | + |
| 24 | +### 🚀 Quick Start |
| 25 | + |
| 26 | +```bash |
| 27 | +npx react-native-lab@latest |
| 28 | +``` |
| 29 | + |
| 30 | +### 💻 Usage Preview |
| 31 | + |
| 32 | +_No screenshots needed! Here is how the interactive CLI guides you:_ |
| 33 | + |
| 34 | +```text |
| 35 | +┌ React Native Lab |
| 36 | +│ |
| 37 | +◇ What is the name of your React Native project? |
| 38 | +│ MySuperApp |
| 39 | +│ |
| 40 | +◇ Do you want to create a "src" folder for your files? |
| 41 | +│ Yes |
| 42 | +│ |
| 43 | +◇ Which template would you like to use? |
| 44 | +│ Bottom Navigation |
| 45 | +│ |
| 46 | +◇ Checking for JDK installation... |
| 47 | +│ JDK is already installed. |
| 48 | +│ |
| 49 | +◇ Checking for Android Studio... |
| 50 | +│ Android Studio is already installed. |
| 51 | +│ |
| 52 | +◇ Would you like to enable additional customization? |
| 53 | +│ Yes |
| 54 | +│ |
| 55 | +◇ Which package manager would you like to use? |
| 56 | +│ npm |
| 57 | +│ |
| 58 | +◇ What should be the package name? |
| 59 | +│ com.mysuperapp.mobile |
| 60 | +│ |
| 61 | +◇ Would you like to install NativeWind for styling? |
| 62 | +│ Yes |
| 63 | +│ |
| 64 | +◇ Include automatic console log removal in production? |
| 65 | +│ Yes |
| 66 | +│ |
| 67 | +◇ Add GitHub Actions CI workflow? |
| 68 | +│ Yes |
| 69 | +│ |
| 70 | +└ Configuration complete! Starting setup... |
| 71 | +``` |
| 72 | + |
| 73 | +### ✨ Comprehensive Features |
| 74 | + |
| 75 | +We take care of the details so you don't have to. |
| 76 | + |
| 77 | +#### 🛠️ Smart Environment Setup |
| 78 | + |
| 79 | +- **Automatic JDK Install**: Checks and installs OpenJDK (Windows/Linux) if missing. |
| 80 | +- **Automatic Android Studio**: Downloads and configures Android Studio & SDKs (Windows/Linux). |
| 81 | +- **Environment Variables**: Automatically sets `JAVA_HOME`, `ANDROID_HOME`, and adds tools to `PATH`. |
| 82 | + |
| 83 | +#### 🎨 Templates & Design |
| 84 | + |
| 85 | +- **Multiple Layouts**: |
| 86 | + - **Blank**: A clean slate. |
| 87 | + - **Bottom Navigation**: Tab-based navigation pre-configured. |
| 88 | + - **Stack Navigation**: Standard stack navigation. |
| 89 | + - **Drawer Navigation**: Drawer menu implementation. |
| 90 | +- **NativeWind Support**: Optional integration of Tailwind CSS for React Native. |
| 91 | + |
| 92 | +#### ⚙️ Project Configuration |
| 93 | + |
| 94 | +- **Package Manager**: Support for `npm`, `yarn`, or `bun`. |
| 95 | +- **Custom Package Name**: Easily set your Bundle ID (e.g., `com.company.app`). |
| 96 | +- **React Native Version**: Choose between `latest` stable or a specific version. |
| 97 | +- **Project Structure**: Optional clean `src/` directory organization. |
| 98 | +- **Environment Secrets**: Choice of `react-native-config` or `react-native-dotenv`. |
| 99 | + |
| 100 | +#### 🧑💻 Developer Experience (DX) |
| 101 | + |
| 102 | +- **TypeScript First**: All code is typed by default. |
| 103 | +- **Path Aliases**: Pre-configured aliases like `@assets`, `@components`, `@screens`, `@utils`. |
| 104 | +- **Custom Hooks Library**: Optional inclusion of: |
| 105 | + - `useDebounce` |
| 106 | + - `useThrottle` |
| 107 | + - `usePrevious` |
| 108 | + - `useOrientation` |
| 109 | + - `useResponsiveLayout` |
| 110 | + |
| 111 | +#### 🚀 Production Readiness |
| 112 | + |
| 113 | +- **CI/CD Integration**: Automatically generates `.github/workflows/ci.yml` for linting and testing. |
| 114 | +- **Console Log Removal**: Production builds automatically strip simple `console.log` statements for security and speed. |
| 115 | +- **Git Initialization**: Auto-init Git repo and generate a tailored `.gitignore`. |
| 116 | + |
| 117 | +### 🤝 Contributing |
| 118 | + |
| 119 | +Contributions are welcome! Please open an issue or submit a pull request [here](https://github.com/developer-sumit/react-native-lab). |
| 120 | + |
| 121 | +### 📄 License |
| 122 | + |
| 123 | +MIT © [Sumit Singh Rathore](https://github.com/developer-sumit) |
0 commit comments