{"_id":"@20052507/dab-enterprise-bws","name":"@20052507/dab-enterprise-bws","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@20052507/dab-enterprise-bws","version":"1.0.1","description":"DAB Enterprise Ltd - Business Web Solution (BWS)","main":"backend-project/server.js","scripts":{"start":"node backend-project/server.js","start-frontend":"cd frontend-project && npm start","install-all":"cd backend-project && npm install && cd ../frontend-project && npm install"},"keywords":["dab-enterprise","bws","sales-management"],"license":"ISC","_id":"@20052507/dab-enterprise-bws@1.0.1","_nodeVersion":"24.11.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-kShtZx9G1X8Y8wm0IHm/r8xYgDxAoySUHFYF5RqdX7nvlZ38A/RrtZy9UBLtlZogpqfVCTcRYn9PFTyogMqYEg==","shasum":"0b2e2035fa64b76d76b508a224fea4f3b89cf25f","tarball":"https://registry.npmjs.org/@20052507/dab-enterprise-bws/-/dab-enterprise-bws-1.0.1.tgz","fileCount":29,"unpackedSize":82288,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCFvw9EjvgsOKxvNJx1uZrKUJ+IeIrUG7sGgKaDgtvi0gIgB9Ysn+NOcFyU2X5A8bPPvQC1etkqB+upCd96kvtBCDs="}]},"_npmUser":{"name":"20052507","email":"ishimwekevin199@gmail.com"},"directories":{},"maintainers":[{"name":"20052507","email":"ishimwekevin199@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dab-enterprise-bws_1.0.1_1780534072609_0.7473623063594117"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T00:47:52.512Z","1.0.1":"2026-06-04T00:47:52.758Z","modified":"2026-06-04T00:47:52.900Z"},"maintainers":[{"name":"20052507","email":"ishimwekevin199@gmail.com"}],"description":"DAB Enterprise Ltd - Business Web Solution (BWS)","keywords":["dab-enterprise","bws","sales-management"],"license":"ISC","readme":"# DAB Enterprise Ltd - Business Web Solution (BWS)\n\nA comprehensive full-stack web application for managing products, sales, and inventory for DAB Enterprise Ltd located in Kigali City, Rwanda.\n\n## Project Overview\n\nThis project addresses the inefficiencies of the manual paper-based system by providing a modern web-based solution for:\n- Product management\n- Sales tracking\n- Stock status monitoring\n- Report generation\n- User authentication\n\n## Technology Stack\n\n### Backend\n- **Node.js** - JavaScript runtime\n- **Express.js** - Web framework\n- **MySQL** - Database\n- **bcryptjs** - Password encryption\n- **express-session** - Session management\n- **cors** - Cross-Origin Resource Sharing\n- **mysql2** - MySQL driver\n\n### Frontend\n- **React.js** - UI framework\n- **Tailwind CSS** - Styling\n- **Axios** - HTTP client\n- **React Router** - Navigation\n\n## Project Structure\n\n```\nFirstName_LastName_National_Practical_Exam_2026/\n├── backend-project/\n│   ├── config/\n│   │   └── database.js\n│   ├── controllers/\n│   │   ├── authController.js\n│   │   ├── productController.js\n│   │   ├── salesController.js\n│   │   └── stockController.js\n│   ├── middleware/\n│   │   └── authMiddleware.js\n│   ├── routes/\n│   │   ├── authRoutes.js\n│   │   ├── productRoutes.js\n│   │   ├── salesRoutes.js\n│   │   └── stockRoutes.js\n│   ├── server.js\n│   └── package.json\n├── frontend-project/\n│   ├── public/\n│   │   └── index.html\n│   ├── src/\n│   │   ├── components/\n│   │   │   └── Navbar.js\n│   │   ├── pages/\n│   │   │   ├── Login.js\n│   │   │   ├── Dashboard.js\n│   │   │   ├── Products.js\n│   │   │   ├── Sales.js\n│   │   │   ├── Stock.js\n│   │   │   └── Reports.js\n│   │   ├── App.js\n│   │   ├── index.js\n│   │   └── index.css\n│   ├── tailwind.config.js\n│   ├── postcss.config.js\n│   └── package.json\n├── ERD_DFD_Documentation.md\n└── README.md\n```\n\n## Prerequisites\n\nBefore running this application, ensure you have the following installed:\n\n1. **Node.js** (v14 or higher) - [Download here](https://nodejs.org/)\n2. **MySQL Server** (v5.7 or higher) - [Download here](https://dev.mysql.com/downloads/mysql/)\n3. **npm** (comes with Node.js)\n\n## Installation Instructions\n\n### 1. Database Setup\n\nThe application automatically creates the database and tables on first run. However, ensure MySQL is running with the following default configuration:\n\n- **Host**: localhost\n- **User**: root\n- **Password**: (empty)\n\nIf your MySQL has a different password, update the configuration in `backend-project/config/database.js` and `backend-project/server.js`.\n\n### 2. Backend Setup\n\nNavigate to the backend project directory:\n\n```bash\ncd backend-project\n```\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nStart the backend server:\n\n```bash\nnpm start\n```\n\nThe backend will run on `http://localhost:5000`\n\n### 3. Frontend Setup\n\nNavigate to the frontend project directory:\n\n```bash\ncd frontend-project\n```\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nStart the frontend development server:\n\n```bash\nnpm start\n```\n\nThe frontend will run on `http://localhost:3000`\n\n## Default Login Credentials\n\nThe application creates a default admin user on first run:\n\n- **Username**: admin\n- **Password**: Admin@123\n\n**Important**: Change this password after first login for security.\n\n## Features\n\n### 1. Authentication\n- Session-based login system\n- Password encryption using bcrypt\n- Secure session management\n\n### 2. Product Management\n- Add new products\n- View all products\n- Edit product details\n- Delete products\n- Automatic total price calculation\n\n### 3. Sales Management\n- Record new sales\n- View sales history\n- Edit sales records\n- Delete sales records\n- Automatic stock update on sale\n\n### 4. Stock Status\n- View current stock levels\n- Real-time stock monitoring\n- Low stock alerts\n- Out of stock indicators\n\n### 5. Reports\n- **Daily Sales Report**: View sales summary by date\n- **Stock Status Report**: Complete inventory overview\n- Print functionality for reports\n\n## API Endpoints\n\n### Authentication\n- `POST /api/auth/login` - User login\n- `POST /api/auth/logout` - User logout\n- `GET /api/auth/check` - Check authentication status\n\n### Products\n- `GET /api/products` - Get all products\n- `GET /api/products/:id` - Get product by ID\n- `POST /api/products` - Create new product\n- `PUT /api/products/:id` - Update product\n- `DELETE /api/products/:id` - Delete product\n\n### Sales\n- `GET /api/sales` - Get all sales\n- `GET /api/sales/:id` - Get sale by ID\n- `POST /api/sales` - Create new sale\n- `PUT /api/sales/:id` - Update sale\n- `DELETE /api/sales/:id` - Delete sale\n- `GET /api/sales/report/daily` - Get daily sales report\n- `GET /api/sales/report/daily/details` - Get daily sales details\n\n### Stock Status\n- `GET /api/stock` - Get all stock status\n- `GET /api/stock/:id` - Get stock status by product ID\n- `GET /api/stock/report/status` - Get stock status report\n\n## Database Schema\n\n### Users Table\n- UserID (PK)\n- Username\n- Password (encrypted)\n- CreatedAt\n\n### Products Table\n- ProductID (PK)\n- ProductName\n- Category\n- Quantity\n- UnitPrice\n- TotalPrice (computed)\n- CreatedAt\n\n### Sales Table\n- SalesID (PK)\n- ProductID (FK)\n- SoldQuantity\n- SoldUnitPrice\n- SoldTotalPrice (computed)\n- SalesDate\n- CreatedAt\n\n### StockStatus Table\n- StockID (PK)\n- ProductID (FK)\n- AvailableQuantity\n- SoldQuantity\n- RemainingQuantity (computed)\n- LastUpdated\n\n## ERD and DFD\n\nDetailed Entity Relationship Diagram (ERD) and Data Flow Diagram (DFD) are available in `ERD_DFD_Documentation.md`.\n\n## Usage\n\n1. Start the MySQL server\n2. Start the backend server (`cd backend-project && npm start`)\n3. Start the frontend server (`cd frontend-project && npm start`)\n4. Open `http://localhost:3000` in your browser\n5. Login with default credentials (admin / Admin@123)\n6. Navigate through the application using the menu bar\n\n## Security Features\n\n- Password encryption using bcrypt (10 salt rounds)\n- Session-based authentication\n- Protected API routes\n- CORS configuration\n- SQL injection prevention (parameterized queries)\n\n## Responsive Design\n\nThe application is fully responsive and works on:\n- Desktop computers\n- Tablets\n- Mobile devices\n\n## Troubleshooting\n\n### Backend won't start\n- Ensure MySQL is running\n- Check database credentials in `config/database.js`\n- Verify port 5000 is not in use\n\n### Frontend won't start\n- Ensure Node.js is installed\n- Check that dependencies are installed\n- Verify port 3000 is not in use\n\n### Database connection error\n- Verify MySQL server is running\n- Check username and password in database config\n- Ensure database `dab_enterprise_db` can be created\n\n## Project Removal\n\nAfter the assessment, to permanently remove the project:\n\n1. Stop both backend and frontend servers\n2. Delete the project folder: `FirstName_LastName_National_Practical_Exam_2026`\n3. Optionally, drop the database: `DROP DATABASE dab_enterprise_db;`\n\n**Note**: Always ask permission from the assessor before removing the project.\n\n## License\n\nThis project was created for educational assessment purposes.\n\n## Contact\n\nFor questions or issues related to this project, please contact the development team.\n\n---\n\n**Project completed for DAB Enterprise Ltd - National Practical Exam 2026**\n","readmeFilename":"README.md","_rev":"1-cf03155311c944c5c95c6aa5a4055e9e"}