How wilfierd/isd-2025-optistock works
Project Type and Purpose
• This is a full-stack inventory/stock management web application (“Opistock”)
• Frontend: React single-page app in /client
• Backend: Node.js API server (likely Express) in the project root (app.js, setupdb.js, schema.sql)
• Database: Relational DB (initialized via schema.sql and setupdb.js)
High-Level File Structure Analysis
• Top level:
• app.js – main entry for API server
• setupdb.js + schema.sql – DB initialization and schema
• .env – server-side environment variables (e.g., DB credentials)
• /client: React app
• src/components – UI components (Dashboard, Materials, QRCodeScanner, etc.)
• src/hooks & src/contexts – state & data logic
• src/services/api.js + setupProxy.js – HTTP layer to backend
• public – static HTML/CSS assets
• Config & dependency files: package.json, .gitignore, .env.development
Key Architectural Insights from README
• Single npm workspace: one command (npm run dev) likely runs both server and client (via concurrently or nodemon)
• Uses environment variables to configure DB connection
• Follows typical 3-tier pattern (UI ↔ API ↔ DB)
Elements
• From UI to API endpoints (GET /materials, POST /requests, etc.)
• From API to DB (SQL reads/writes)
• From API to any third-party service (notifications)
• Blue for UI components
• Green for server modules
• Orange for persistence layer