StockManager is a comprehensive inventory management system built with Next.js & React. It allows businesses to track inventory, manage stock movements (in and out), and generate sales summaries. The application can run as a web application or as a desktop application via Electron.
- Inventory Management: Track current inventory levels with detailed information
- Stock In/Out Operations: Record incoming and outgoing stock movements
- Product Management: Add new products with detailed specifications
- Product Code Management: Maintain a database of product codes and specifications
- Sales Summary: View aggregated sales data and inventory status
- Responsive Design: Works on various screen sizes
- Dark/Light Theme: Toggle between dark and light modes based on user preference
- Intuitive Navigation: Simple button-based navigation to all system functions
- Filtering Capabilities: Filter data in tables by various criteria
- Next.js 15 - React framework with hybrid static & server rendering
- React 19 - JavaScript library for building user interfaces
- TypeScript - Typed superset of JavaScript
- Tailwind CSS - Utility-first CSS framework
- Supabase - Open source Firebase alternative with PostgreSQL database
- Custom database abstraction layer for inventory operations
stockmanager-web/
├── backend/ # Database operations and API secrets
├── electron/ # Electron main process files
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js app directory with all pages
│ │ ├── add-new-product/
│ │ ├── stock-in/
│ │ ├── stock-out/
│ │ ├── view-product-codes/
│ │ ├── view-sales-summary/
│ │ ├── view-stock/
│ │ ├── view-stock-in/
│ │ └── view-stock-out/
│ │ └── page.tsx # Home page
│ │ └── layout.tsx # Root layout
│ └── components/ # Reusable React components
├── out/ # Exported static files (generated)
└── dist/ # Packaged Electron app (generated)
View current inventory levels with filtering capabilities. Displays detailed information including:
- Product code, type, brand, color, and size
- Initial stock, purchased quantity, sold quantity, and current stock
- Ability to filter by any field
View all stock-in records with date, product information, quantities, and remarks.
View all stock-out records with date, product information, quantities, and remarks.
Maintain and view the product code database with full product specifications.
View aggregated sales data showing product information, quantities sold, current stock levels, and sales figures.
Record incoming stock with:
- Date of entry
- Product code and details
- Quantity received
- Remarks
Record outgoing stock with:
- Date of exit
- Product code and details
- Quantity dispatched
- Remarks
Add new products to the inventory system with:
- Product code
- Product type, brand, name, color, and size
- Initial quantity
- Node.js (version 16 or higher)
- npm or yarn package manager
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd stockmanager-web -
Install dependencies:
npm install
To run the application in development mode:
npm run devThis will start the Next.js development server on http://localhost:3000.
To build the application for web deployment:
npm run build
npm run startThis will create an optimized production build and start the server.
The application uses Supabase (PostgreSQL) with the following tables:
- 库存表 (Inventory Table): Stores current inventory levels and product information
- 入库表 (Stock In Table): Records all incoming stock transactions
- 出库表 (Stock Out Table): Records all outgoing stock transactions
- 货物编码表 (Product Code Table): Maintains the product code database
- 销售汇总 (Sales Summary Table): Aggregated sales data
Create a .env.local file in the root directory with your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
These values should also be configured in the API_Secret.ts file in the backend directory.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run export- Export as static files
The application can be deployed to any platform that supports Next.js, such as:
- Vercel (recommended)
- Netlify
- Traditional Node.js servers
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to Next.js team for the excellent React framework
- Tailwind CSS for the utility-first CSS framework
- Supabase for the easy-to-use backend solution
- Electron team for making cross-platform desktop apps possible with web technologies