Devlog 9
finally done. literally coding until my fingers are numb. completed the entire crm frontend and the desktop wrapper is fully functional. no more mock gaps or missing files.
here is the breakdown of what happened:
frontend modules (crmfrontend):
- finished the pharmacy inventory page (pharmacyinventory.tsx). it handles full batch tracking, manufacturing/expiry dates, cost/selling price margins, gst calculation (5%, 12%, 18%), and hsn codes. also threw in reorder level alerts when stock drops below threshold.
- built out pharmacybilling.tsx from scratch. doctors write rx, pharmacist pulls it, builds the bill with automatic gst and prints receipt.
- made pharmacycustomers.tsx to track loyalty points, lifetime spend, and outstanding balances. has a quick reminder trigger.
- wrote pharmacyprescriptions.tsx to handle the incoming doctor prescription queues. pharmacists can do complete or partial dispensing if we are short on stock.
- added pharmacypurchase.tsx for restock orders and supplier inventory ingestion.
- built pharmacyreports.tsx for tracking medicine usage patterns and monthly sales dashboards.
- all routes are auth-locked in app.tsx using role-based routing policies (doctor, pharmacist, receptionist, admin, super-admin).
- styling is built using vanilla tailwind classes alongside shadcn UI components like dialogs, tables, and dropdown menus for layout consistency.
- data fetching is managed using tanstack react-query to cache active lists and handles state mutators for adding/editing items.
- toast notifications via sonner trigger real-time updates for pharmacy sales completions and out of stock warnings.
- integrated standard currency formatters to display indian rupee values properly in all tables.
desktop wrapper (auracaredesktop):
- spun up electron setup. main.js manages window dimensions (1400x900 min, resizable) and ipc communication channels.
- preload.js sets up contextbridge and ipcrenderer exposing window controls safely without opening nodeintegration.
- connection strategy:
- in dev, package.json uses concurrently and wait-on to launch the frontend dev server on port 8080 and then point the electron browser window loadurl to localhost:8080.
- for prod, we run electron-builder which bundles our assets. npm build script builds the react frontend, copies dist to desktop/frontend-dist, and main.js loads it locally via loadfile.
- configured cross-platform packaging target options for windows (nsis installer, portable executables), mac (dmg, zip), and linux (appimage, deb) in package.json.
- added native OS window hooks for minimized, maximized, and close events so client-side buttons in the custom titlebar work.
- added shell handler for opening external web links in native browser instead of electron window.
- assets folder holds local icons configured for specific OS packing rules (ico, icns, png).
how it connects:
- the desktop shell is just a container running our react client, which talks to the node/express backend via api client calls to VITE_API_URL.
- ipc communication checks the app version and process platform.
- window actions (minimize, maximize, close) are wired back to the ipcMain handler.
- if backend is unreachable, the API services default to local mock fallback data so the app does not freeze.
- auth tokens are saved in localstorage inside the web view which carries over across app launches.
took way too long to align the dist copy paths in the build script. had a dumb bug where frontend-dist was missing and loading a blank screen, but fixed the cp target path. compilation is completely green now. going to collapse.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.