mzehir / react-mui-core

Home Page:https://react-mui-core.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-mui-core

It is a front-end starter project created using React JS, Material UI, React Hook Form.

Directory structure

Overview

Project src structure directories.

src/
├─ assets/
│  ├─ logo.svg
├─ components/
|  ├─ ...
├─ contexts/
│  ├─ ApiContext.js
│  ├─ AuthContext.js
│  ├─ AuthContextHelperMethods.js
│  ├─ LanguageContext.js
│  ├─ LanguageContextHelperMethods.js
│  ├─ ThemeContext.js
├─ guard/
│  ├─ AuthGuard.js
├─ hooks/
│  ├─ ApiUseContext.js
│  ├─ AuthUseContext.js
│  ├─ LanguageUseContext.js
│  ├─ ThemeUseContext.js
├─ i18n/
│  ├─ locale/
|  |  ├─ en.json
|  |  ├─ tr.json
│  ├─ i18n.js
├─ layouts/
│  ├─ AuthLayout.js
│  ├─ DefaultLayout.js
├─ models/
│  ├─ api/
|  |  ├─ ...
│  ├─ form/
|  |  ├─ ...
├─ pages/
|  ├─ ...
├─ redux/
│  ├─ actions/
|  |  ├─ generalAppConfigAction.js
│  ├─ reducers/
|  |  ├─ generalAppConfigReducer.js
│  ├─ slices/
|  |  ├─ generalAppConfigSlice.js
│  ├─ store/
|  |  ├─ store.js
├─ router/
│  ├─ Router.js
├─ service/
│  ├─ firebase/
|  |  ├─ index.js
│  ├─ axios.js
│  ├─ axiosHelperMethods.js
├─ theme/
│  ├─ breakpoints.js
│  ├─ components.js
│  ├─ index.js
│  ├─ shadows.js
│  ├─ typography.js
│  ├─ variants.js
├─ utils/
│  ├─ config/
|  |  ├─ config.js
│  ├─ constants/
|  |  ├─ appConstants/
|  |  |  ├─ ...
|  |  ├─ apiConstant.js
|  |  ├─ languageConstant.js
|  |  ├─ locationStateKey.js
|  |  ├─ resizeWindowConstant.js
|  |  ├─ routerConstant.js
|  |  ├─ themeConstant.js
│  ├─ helper/
|  |  ├─ localizationProviderHelper.js
|  |  ├─ localStorageOperations.js
|  |  ├─ moment.js
|  |  ├─ other.js
|  |  ├─ sessionStorage.js
├─ validations/
|  ├─ ...
├─ vendor/
│  ├─ perfect-scrollbar
├─ App.js
├─ AppTheme.js
├─ index.js

Features

Packages used dependencies

  • @craco/craco: A tool used to customize the configuration of React applications.
  • @mui/lab: Experimental components of Material-UI.
  • axios: Library for making HTTP requests.
  • date-fns: Lightweight library for date and time operations.
  • deepmerge: Library used for merging objects.
  • firebase: Library for Firebase connection and usage.
  • i18next: Translation library used for multi-language support.
  • jss: JavaScript CSS parser used for style definitions.
  • jwt-decode: Library for decoding JSON Web Tokens (JWT).
  • moment: Library for date and time manipulation.
  • react-dom: Library for rendering React applications to the DOM.
  • react-feather: Library for using Feather icons in React projects.
  • react-i18next: React integration for the i18next translation library.
  • web-vitals: Library for measuring web performance.
  • yup: Library used for schema validation.

Packages used devDependencies

  • @babel/preset-env: Default environment preset used by Babel to transform JavaScript code for a specific environment.
  • craco-alias: Used to add additional Babel and Webpack configuration to Create React App projects, especially for defining folder aliases.
  • prettier: Used to automatically format and style your code.

API Layers and Context Structures

  1. API Context (ApiContext) Within the project, a specialized API Context structure is used for backend requests and responses. This layer facilitates communication between various components of the application and the backend.

  2. Authentication Context (AuthContext) Processes such as register, login, resetPassword, user authentication status, and distinguishing between authenticated and guest users are managed within the AuthContext.

  3. Theme Context (ThemeContext) The application supports the ability for users to change their preferred theme. This preference is managed within the ThemeContext. Users can dynamically switch between different themes at any time.

  4. Language Context (LanguageContext) The application features support for multiple languages. Users can change their language preference using the LanguageContext. This allows the application to display content in the user's selected language.

  5. AuthGuard AuthGuard serves as an intermediary layer to differentiate between authenticated and guest users. It grants access permissions to specific pages, enhancing security within the application.

These API layers and context structures effectively manage crucial features of the project, including backend integration, user session management, theme preferences, and language options.

Installation

Clone the repo:

git clone https://github.com/mzehir/react-mui-core.git
cd react-mui-core

Install the dependencies:

npm install

Set the environment variables:

cp .env.example .env

# open .env and modify the environment variables (if needed)

Commands

Running locally:

npm run start

About

https://react-mui-core.vercel.app


Languages

Language:JavaScript 99.7%Language:HTML 0.3%