Skip to content

πŸ“¦ 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.

License

Notifications You must be signed in to change notification settings

karamanburak/smart-stock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

stock-management-app

SmartStock Live

Description

πŸ“¦ 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.

Project Skeleton

- 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

Outcome

SmartStock

Installed Packages

  • MUI and MUI icons
  • axios
  • redux/redux toolkit
  • react-toastify
  • react-router-dom
  • mui x data grid

Redux Persist

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);

  1. Use the persistStore function to create persistor;
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 Structure

<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>

Axios Instance ve Interceptors

import axios from 'axios';

const instance = axios.create({
  baseURL: '<https://example.com/api>',
  headers: {'Authorization': `Token ${token}`}
});

Postman Documentation

View Postman Documentation

About

πŸ“¦ 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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages