- Introduction
Currently App is deployed on Vercel. You can check Live demo here https://dynamicwebapps.vercel.app/ Overview
This project is a dynamic React application framework developed to demonstrate key front-end engineering capabilities, such as dynamic component loading, responsive UI design, and state management using Redux. The framework allows for the dynamic configuration of menus, components, and inter-component communication, providing a scalable architecture suitable for complex web applications.
Key Features
-
Dynamic Menu Configuration: Load and update menus dynamically based on external configuration files.
-
Component Versioning: Dynamically load and render different versions of components based on configuration.
-
State Management: Centralized state management using Redux to facilitate inter-component communication.
-
Responsive UI Design: Leveraging Material-UI (MUI) for a consistent and responsive user interface. . Project Structure
-
Project Structure
DynamicAppBackup/
│
├── public/
│ ├── favicon.ico
│ ├── index.html
│ ├── menuConfig.json
│ ├── manifest.json
│ └── robots.txt
│
├── src/
│ ├── components/
│ │ ├── Forms/
│ │ │ ├── RegistrationFormV1.tsx
│ │ │ ├── RegistrationFormV2.tsx
│ │ ├── Layouts/
│ │ │ ├── CommonMenu.tsx
│ │ │ ├── Layout.tsx
│ │ ├── FlowDiagrams/
│ │ │ ├── FlowDiagramV1.tsx
│ │ │ ├── FlowDiagramV2.tsx
│ │ └── SharedFormsData.tsx
│ │
│ ├── config/
│ │ ├── componentConfig.json
│ │ └── react_flow/
│ │ ├── reactFlowEdgesV1.ts
│ │ ├── reactFlowEdgesV2.ts
│ │ ├── reactFlowNodesV1.ts
│ │ └── reactFlowNodesV2.ts
│ │
│ ├── pages/
│ │ ├── Home.tsx
│ │ └── FlowDiagrams.tsx
│ │
│ ├── store/
│ │ ├── appSlice.ts
│ │ ├── index.ts
│ │ └── menuSlice.ts
│ │
│ ├── index.tsx
│ ├── App.tsx
│ └── index.css
│
├── package.json
├── package-lock.json
└── README.md
- Setup Instructions
Prerequisites
ReactJs, Redux Toolkit, React Router DOM, Material UI
Clone the repository:
bash Copy code git clone https://github.com/iamshahidameen/project-enterprise-core cd DynamicAppBackup Install dependencies:
bash Copy code npm install Start the development server:
bash Copy code npm start The application will be accessible at http://localhost:3000.
Building for Production To create a production build, run:
bash Copy code npm run build This will create an optimized build in the build/ directory.
- Architectural Overview React Components Layout Component: The Layout.tsx component manages the overall structure of the application, including the AppBar, Drawer, and routing via React Router's Outlet. CommonMenu Component: The CommonMenu.tsx component dynamically loads and updates the navigation menu based on external configuration (menuConfig.json). Form Components: The RegistrationFormV1.tsx and RegistrationFormV2.tsx components demonstrate dynamic component versioning. Redux Store menuSlice.ts: Manages the state of the menu items. The state is updated based on the external configuration loaded in the CommonMenu component. appSlice.ts: Manages the overall application state and can be extended to handle more complex state interactions as the application scales. Configuration menuConfig.json: Defines the structure and content of the navigation menu. The menu items are loaded dynamically into the CommonMenu component. componentConfig.json: This configuration file would define the component versions to be loaded dynamically.
- Key Features and Implementation Dynamic Menu Configuration The application’s menu is dynamically loaded from the menuConfig.json file. The CommonMenu.tsx component fetches this configuration and updates the Redux state, which in turn updates the displayed menu.
Component Versioning Component versioning is demonstrated through the RegistrationFormV1.tsx and RegistrationFormV2.tsx components. Based on the componentConfig.json, the appropriate version of a component is loaded and rendered dynamically.
Inter-Component Communication Redux is used to manage the global state, ensuring that different components can communicate without direct coupling. This architecture allows for scalable inter-component communication essential for complex applications.
Responsive UI Design The application uses Material-UI for creating responsive, consistent, and accessible UIs. The Layout.tsx component ensures that the application adapts to different screen sizes and provides a seamless user experience.
- Future Improvements
There are few areas which needs imidiate improvements, so I will work on that later
Code Splitting
To improve the performance of the application, I can implement code-splitting using React.lazy and Suspense for dynamically loaded components.
Enhanced Error Handling
Expanding the error handling mechanisms in CommonMenu.tsx and other components to provide better user feedback in case of configuration load failures.
Extending Redux As the application grows, we can use Redux middleware like redux-saga or redux-thunk for managing complex asynchronous logic.
8 Conclusion This dynamic React framework demonstrates advanced front-end engineering capabilities, focusing on flexibility, scalability, and maintainability. It is designed to be extended and adapted to various complex application requirements.
For any further questions or contributions, please refer to the contact details provided in the project’s README or reach out via [iamshahidameen@gmail.com].