{"id":31282072,"url":"https://github.com/haxcod/inventory","last_synced_at":"2025-09-24T03:18:59.942Z","repository":{"id":315713154,"uuid":"1058200875","full_name":"haxcod/inventory","owner":"haxcod","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-20T07:15:50.000Z","size":333,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-20T09:14:51.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haxcod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T19:00:26.000Z","updated_at":"2025-09-20T07:15:54.000Z","dependencies_parsed_at":"2025-09-20T09:14:56.217Z","dependency_job_id":"7aba8b20-728b-4c34-a625-46c6bd989cce","html_url":"https://github.com/haxcod/inventory","commit_stats":null,"previous_names":["haxcod/inventory"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/haxcod/inventory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxcod%2Finventory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxcod%2Finventory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxcod%2Finventory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxcod%2Finventory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haxcod","download_url":"https://codeload.github.com/haxcod/inventory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxcod%2Finventory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276685170,"owners_count":25685958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-24T03:18:58.493Z","updated_at":"2025-09-24T03:18:59.936Z","avatar_url":"https://github.com/haxcod.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite Inventory Management System\n\nA full-stack inventory management system built with React (Vite) frontend and Express.js backend.\n\n## 🚀 Quick Start\n\n### Setup\n1. **Clone and setup:**\n   ```bash\n   git clone \u003cyour-repo\u003e\n   cd vite-inventory\n   node setup.js\n   ```\n\n2. **Or manual setup:**\n   ```bash\n   # Install dependencies\n   npm run install:all\n   \n   # Create environment files (see Environment Setup below)\n   \n   # Start development servers\n   npm run dev\n   ```\n\n### Environment Setup\n\nCreate these environment files:\n\n**client/.env:**\n```env\nVITE_API_BASE_URL=http://localhost:5000/api\nVITE_APP_NAME=Inventory Management System\nVITE_APP_VERSION=1.0.0\n```\n\n**server/.env:**\n```env\nMONGODB_URI=mongodb://localhost:27017/inventory_management\nJWT_SECRET=your-super-secret-jwt-key-change-this-in-production\nJWT_EXPIRES_IN=7d\nPORT=5000\nNODE_ENV=development\nFRONTEND_URL=http://localhost:5173\n```\n\n## 🏗️ Project Structure\n\n```\nvite-inventory/\n├── client/                 # React frontend (Vite)\n│   ├── src/\n│   │   ├── components/     # Reusable UI components\n│   │   ├── pages/         # Page components\n│   │   ├── context/       # React contexts\n│   │   ├── lib/           # API and utilities\n│   │   └── types/         # TypeScript types\n│   └── package.json\n├── server/                 # Express.js backend\n│   ├── controllers/       # Route controllers\n│   ├── models/           # MongoDB models\n│   ├── routes/           # API routes\n│   ├── middleware/       # Custom middleware\n│   └── services/         # Business logic\n└── package.json          # Root package.json\n```\n\n## 🛠️ Available Scripts\n\n### Root Level\n- `npm run dev` - Start both client and server in development mode\n- `npm run dev:client` - Start only the client\n- `npm run dev:server` - Start only the server\n- `npm run build` - Build the client for production\n- `npm run start` - Start the server in production mode\n- `npm run install:all` - Install dependencies for all packages\n\n### Client (React)\n- `npm run dev` - Start Vite dev server\n- `npm run build` - Build for production\n- `npm run preview` - Preview production build\n- `npm run lint` - Run ESLint\n\n### Server (Express)\n- `npm run dev` - Start with nodemon (auto-restart)\n- `npm start` - Start in production mode\n\n## 🌐 API Endpoints\n\n### Authentication\n- `POST /api/auth/register` - User registration\n- `POST /api/auth/login` - User login\n- `GET /api/auth/me` - Get current user\n- `PUT /api/auth/profile` - Update profile\n- `PUT /api/auth/change-password` - Change password\n- `POST /api/auth/logout` - Logout\n\n### Products\n- `GET /api/products` - Get all products\n- `GET /api/products/search` - Search products\n- `GET /api/products/low-stock` - Get low stock products\n- `GET /api/products/:id` - Get product by ID\n- `POST /api/products` - Create product\n- `PUT /api/products/:id` - Update product\n- `DELETE /api/products/:id` - Delete product\n\n### Branches\n- `GET /api/branches` - Get all branches\n- `GET /api/branches/search` - Search branches\n- `GET /api/branches/:id` - Get branch by ID\n- `POST /api/branches` - Create branch\n- `PUT /api/branches/:id` - Update branch\n- `DELETE /api/branches/:id` - Delete branch\n\n### Billing/Invoices\n- `GET /api/billing/invoices` - Get all invoices\n- `GET /api/billing/invoices/:id` - Get invoice by ID\n- `POST /api/billing/invoices` - Create invoice\n- `PUT /api/billing/invoices/:id` - Update invoice\n- `DELETE /api/billing/invoices/:id` - Delete invoice\n- `GET /api/billing/invoices/:id/pdf` - Generate PDF\n\n### Payments\n- `GET /api/payments` - Get all payments\n- `GET /api/payments/:id` - Get payment by ID\n- `POST /api/payments` - Create payment\n- `PUT /api/payments/:id` - Update payment\n- `DELETE /api/payments/:id` - Delete payment\n\n### Reports\n- `GET /api/reports/sales` - Sales report\n- `GET /api/reports/stock` - Stock report\n- `GET /api/reports/payments` - Payment report\n\n## 🗄️ Database Models\n\n### User\n- Authentication and user management\n- Roles: admin, user\n- Permissions system\n\n### Product\n- Product catalog management\n- Stock tracking\n- Category and brand management\n\n### Branch\n- Multi-location support\n- Branch-specific inventory\n\n### Invoice\n- Sales transactions\n- Customer information\n- Payment tracking\n\n### Payment\n- Payment processing\n- Multiple payment methods\n- Transaction history\n\n## 🔧 Configuration\n\n### Frontend (Vite)\n- React 19 with TypeScript\n- Tailwind CSS for styling\n- Axios for API calls\n- React Router for navigation\n- Zustand for state management\n\n### Backend (Express)\n- Express.js with ES modules\n- MongoDB with Mongoose\n- JWT authentication\n- CORS enabled\n- Rate limiting\n- Helmet for security\n\n## 🚀 Deployment\n\n### Development\n```bash\nnpm run dev\n```\n\n### Production\n```bash\n# Build client\nnpm run build\n\n# Start server\nnpm start\n```\n\n### Docker (Optional)\n```dockerfile\n# Add Dockerfile for containerized deployment\n```\n\n## 📝 Features\n\n- ✅ User authentication and authorization\n- ✅ Product inventory management\n- ✅ Multi-branch support\n- ✅ Invoice generation\n- ✅ Payment processing\n- ✅ Sales and stock reports\n- ✅ Responsive design\n- ✅ Real-time updates\n- ✅ Data validation\n- ✅ Error handling\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n1. **MongoDB Connection Error**\n   - Ensure MongoDB is running\n   - Check connection string in server/.env\n\n2. **Port Already in Use**\n   - Change PORT in server/.env\n   - Kill existing processes on ports 5000/5173\n\n3. **CORS Errors**\n   - Check FRONTEND_URL in server/.env\n   - Ensure client URL matches\n\n4. **Build Errors**\n   - Clear node_modules and reinstall\n   - Check Node.js version compatibility\n\n## 📄 License\n\nMIT License - see LICENSE file for details\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📞 Support\n\nFor support and questions, please open an issue in the repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxcod%2Finventory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaxcod%2Finventory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxcod%2Finventory/lists"}