π¦ This comprehensive reacts project aims to create a stock store application. The user can register to the store, log in, add the desired product to their inventory, buy or sell it, and keep track of the most current status of it instantly from the dashboard. The user can choose to use the application in dark mode or light mode.
- SmartStock Management App (folder)
|
|
SOLUTION
βββ public
| βββ assets
βββ src
| βββ apiCall
| β βββ apiCall.js
| βββ app
| β βββ store.jsx
| βββ assets
| βββ components
| βββ app
| β βββ store.jsx
| βββ assets
| β βββ [images]
| βββ components
| β βββ Cards
| β β βββ BrandCard.jsx
| β β βββ FirmCard.jsx
| β βββ Commons
| β β βββ AuthHeader.jsx
| β β βββ AuthImage.jsx
| β β βββ DataTable.jsx
| β β βββ MyButton.jsx
| β β βββ MyTextfield.jsx
| β β βββ PageHeader.jsx
| β β βββ SelectControl.jsx
| β β βββ StockModal.jsx
| β βββ Dashboard
| β β βββ Charts.jsx
| β β βββ KpiCards.jsx
| β βββ Forms
| β β βββ BrandForm.jsx
| β β βββ FirmForm.jsx
| β β βββ LoginForm.jsx
| β β βββ ProductForm.jsx
| β β βββ PurchaseForm.jsx
| β β βββ RegisterForm.jsx
| β β βββ SaleForm.jsx
| β βββ Modals
| β β βββ BrandModal.jsx
| β β βββ FirmModal.jsx
| β β βββ ProductModal.jsx
| β β βββ PurchaseModal.jsx
| β β βββ SaleModal.jsx
| β βββ Navigatons
| β β βββ MenuListItems.jsx
| β β βββ WeatherCard.jsx
| β βββ Start
| β β βββ Footer.jsx
| β β βββ StartNavbar.jsx
| β βββ Tables
| β β βββ ProductTable.jsx
| β β βββ PurchaseTable.jsx
| β β βββ SaleTable.jsx
| βββ features
| β βββ authSlice.jsx
| β βββ stockSlice.jsx
| βββ helper
| β βββ FormFields.js
| β βββ ToastNotify.jsj
| βββ hooks
| β βββ useAuthCall.jsx
| β βββ useAxios.jsx
| β βββ useStockCalls.jsx
| βββ pages
| β βββ About.jsx
| β βββ Brands.jsx
| β βββ Dashboard.jsx
| β βββ Firms.jsx
| β βββ Home.jsx
| β βββ Imprint.jsx
| β βββ Login.jsx
| β βββ Products.jsx
| β βββ Purchases.jsx
| β βββ Register.jsx
| β βββ Sales.jsx
| β βββ StartPage.jsx
| βββ router
| | βββ AppRouter.jsx
| | βββ PrivateRouter.jsx
| βββ styles
| β βββ globalStyle.js
| | βββ theme.js
| βββ App.jsx
| βββ frontend.env
| βββ index.css
| βββ main.jsx
βββ .gitignore
βββ index.html
βββ LICENSE
βββ package.json
βββ pnpm-lock-yaml
βββ postcss.config.js
βββ README.md
βββ tailwind.config.js
βββ vercel.json
βββ vite.config.js
- MUI and MUI icons
- axios
- redux/redux toolkit
- react-toastify
- react-router-dom
- mui x data grid
import { createStore } from 'redux';
import { persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage'; // defaults to localStorage
for web
import rootReducer from './reducers';
const persistConfig = {
key: 'root',
storage,
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
const store = createStore(persistedReducer);
- Use the
persistStore
function to createpersistor
;
import { persistStore } from 'redux-persist';
const persistor = persistStore(store);
import { PersistGate } from "redux-persist/integration/react";
import store, { persistor } from "./app/store";
// ... normal setup, create store and persistor, import components etc.
const App = () => {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<RootComponent />
</PersistGate>
</Provider>
);
};
<Router>
<Routes>
<Route path="/" element={<StartPage />} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
<Route path="/about" element={<About />} />
<Route path="/imprint" element={<Imprint />} />
<Route path="/stock" element={<PrivateRouter />}>
<Route path="" element={<Dashboard />}>
<Route index element={<Home />} />
<Route path="/stock/purchases" element={<Purchases />} />
<Route path="/stock/sales" element={<Sales />} />
<Route path="/stock/products" element={<Products />} />
<Route path="/stock/firms" element={<Firms />} />
<Route path="/stock/brands" element={<Brands />} />
</Route>
</Route>
</Routes>
</Router>
import axios from 'axios';
const instance = axios.create({
baseURL: '<https://example.com/api>',
headers: {'Authorization': `Token ${token}`}
});