- Next.js 14
- React.js 18
- Recoil - for State management.
- Tailwind CSS - for Styling
- React Table
Visit : https://om-pharmacy-app.vercel.app
==Tested on Node JS - 20.16.0==
npm install
If there are any conflicts, use the --force option.
npm run dev
Email : johndoe@mclernons.ie | Passwod : 12345678
📦src
┣ 📂app
┃ ┣ 📂(auth)
┃ ┃ ┗ 📂signin
┃ ┣ 📂manage-stock
┃ ┃ ┣ 📂[productId]
┃ ┣ 📜globals.css
┣ 📂atoms
┣ 📂components
┣ 📂Data
┗ 📜utils.ts
The tree above represents a short description of the folder structure used.
- atoms contain the state stores for recoil js.
- the main app directory is the Main Menu or home page.
- All the styles and extra classes are in the
globals.cssfile. tailwind.config.tscontains custom classes and definitions for colors and media query sizes. Although never used, it also contains some of the font styles.- The
EditableTable.tsxandCell.tsxmake up the in-place table editing feature. It uses thecontentEditableattribute of HTML throughreact-contenteditable. - The user authentication is stored on
sessionStorageand the state is managed centrally using Recoil. The Sign In and Sign Out both the methods are provided. - The app has a search bar with debouncing to optimize performance and avoid unnecessary re-renders. Implemented with
lodash.debounceto delay the search while the user is typing. It can be found in./src/app/manage-stock/page.tsxand./src/components/SearchBar.tsx. - A Custom modal is implemented with a backdrop to handle actions such as updating stock or confirming actions. It can be found in
./src/components/Modal.tsx - Custom Tab components are added in
./src/components/Tabs.tsxto be used in the Stock Management Page.
- Add unit testing for components.
- Reducing repititve code logic in table rendering and input handling.
- SearchBar filtering needs more validation, along with other state management functions such as user authenticaion and table inputs ( content-editable can be easily susceptible to XSS attacks).
- Inline styling needs to be reduced.... too much of repition for flexbox and a few other stylings.
- Needs more error handling to avoid edge cases in tables and authentication.