Follow these steps to set up and run the Dynamic Layer React Native project.
-
Visual Studio Code
- Download and install the latest version of Visual Studio Code
- Recommended extensions:
- React Native Tools
- ESLint
- Prettier
-
Node.js
- Install the latest LTS version of Node.js
- Verify installation by running:
node --version npm --version
-
Git
- Install Git for version control
- Verify installation:
git --version
-
Clone the Repository
git clone https://github.com/dynamiclayer/dynamic-layer-react-native.git cd dynamic-layer-react-native
-
Install Dependencies Using npm:
npm install
Or using yarn:
yarn install
-
Start the Development Server Using npm:
npm start
Or using yarn:
yarn start
-
Running on Different Platforms
- Press
a
to run on Android emulator/device - Press
i
to run on iOS simulator (macOS only) - Press
w
to run in web browser
- Press
- The development server will start at
http://localhost:19002
- Use the Expo Go app on your mobile device to test the app by scanning the QR code
- Make sure your development machine and mobile device are on the same network
If you encounter any issues:
-
Clear the Metro bundler cache:
npm start --reset-cache
-
Make sure all dependencies are properly installed:
rm -rf node_modules npm install
-
Verify that your development environment is properly set up according to the prerequisites
The project follows a modular architecture with the following structure:
src/
├── animations/ # Custom animation components
├── components/ # Reusable UI components
├── config/ # Configuration files
├── navigation/ # Navigation setup
├── screens/ # Application screens
└── style.js # Global styles
Located in src/components/
, the app includes several reusable components:
CustomButton.js
CustomButtonDock.js
CustomButtonIcon.js
CustomCard.js
CustomInput.js
NotificationBadge.js
CustomTabNavigator.js
- Custom bottom tab navigationCustomTopNavigation.js
- Custom top navigation bar
The app's navigation is managed through src/navigation/AppNavigator.js
, which sets up the routing structure. It utilizes React Navigation for seamless screen transitions.
The application screens are organized in src/screens/
with two main directories:
Main/
- Primary application screensPreviewScreens/
- Preview and demonstration screens
The assets/
directory contains:
- Icons (organized by category in
icons/
) - Images and placeholder content
- SVG components in
icons/svg_js/
You can customize the app's appearance and behavior through:
- Global styles in
src/style.js
To add a new screen as a tab in the bottom navigation:
-
Create your screen component in
src/screens/Main/
:// src/screens/Main/NewScreen.js import React from "react"; import { View, Text } from "react-native"; import { CustomButton } from "../../components/common/CustomButton"; export const NewScreen = () => { return ( <View> <Text>New Screen</Text> <CustomButton text="Click Me" onPress={() => {}} /> </View> ); };
-
Add the screen to the tab configuration in
src/navigation/AppNavigator.js
:import HomeScreen from "../screens/Main/HomeScreen"; import ProfileScreen from "../screens/Main/ProfileScreen"; import ButtonScreen from "../screens/PreviewScreens/buttonScreen"; const tabScreens = [ { name: "Home", component: HomeScreen, icon: HomeIcon, notifications: 0 }, { name: "Templates", component: ProfileScreen, icon: TemplatesIcon, notifications: 5 }, { name: "NewTab", component: NewScreen, icon: YourIcon, notifications: 0 }, ]; function MainTabScreen() { return <CustomTabNavigator type="md" screens={tabScreens} />; }
-
Create your screen component in
src/screens/Main/
orsrc/screens/PreviewScreens/
:import React from "react"; import { View, Text } from "react-native"; import { CustomButton } from "../../components/common/CustomButton"; export const NewScreen = () => { return ( <View> <Text>New Screen</Text> <CustomButton text="Click Me" onPress={() => {}} /> </View> ); };
-
Add the screen to the MainStack navigator in
src/navigation/AppNavigator.js
:<MainStack.Navigator screenOptions={defaultScreenOptions}> <MainStack.Screen name="MainTabs" component={MainTabScreen} options={{ headerShown: false }} /> <MainStack.Screen name="NewScreen" component={NewScreen} options={{ title: "New Screen" }} /> </MainStack.Navigator>
-
Using Navigation:
import { useNavigation } from "@react-navigation/native"; const MyComponent = () => { const navigation = useNavigation(); return ( <CustomButton title="Go to Screen" onPress={() => navigation.navigate("ScreenName")} /> ); };