@20052507/dab-enterprise-bws
v1.0.1
Published
DAB Enterprise Ltd - Business Web Solution (BWS)
Downloads
24
Maintainers
Readme
DAB Enterprise Ltd - Business Web Solution (BWS)
A comprehensive full-stack web application for managing products, sales, and inventory for DAB Enterprise Ltd located in Kigali City, Rwanda.
Project Overview
This project addresses the inefficiencies of the manual paper-based system by providing a modern web-based solution for:
- Product management
- Sales tracking
- Stock status monitoring
- Report generation
- User authentication
Technology Stack
Backend
- Node.js - JavaScript runtime
- Express.js - Web framework
- MySQL - Database
- bcryptjs - Password encryption
- express-session - Session management
- cors - Cross-Origin Resource Sharing
- mysql2 - MySQL driver
Frontend
- React.js - UI framework
- Tailwind CSS - Styling
- Axios - HTTP client
- React Router - Navigation
Project Structure
FirstName_LastName_National_Practical_Exam_2026/
├── backend-project/
│ ├── config/
│ │ └── database.js
│ ├── controllers/
│ │ ├── authController.js
│ │ ├── productController.js
│ │ ├── salesController.js
│ │ └── stockController.js
│ ├── middleware/
│ │ └── authMiddleware.js
│ ├── routes/
│ │ ├── authRoutes.js
│ │ ├── productRoutes.js
│ │ ├── salesRoutes.js
│ │ └── stockRoutes.js
│ ├── server.js
│ └── package.json
├── frontend-project/
│ ├── public/
│ │ └── index.html
│ ├── src/
│ │ ├── components/
│ │ │ └── Navbar.js
│ │ ├── pages/
│ │ │ ├── Login.js
│ │ │ ├── Dashboard.js
│ │ │ ├── Products.js
│ │ │ ├── Sales.js
│ │ │ ├── Stock.js
│ │ │ └── Reports.js
│ │ ├── App.js
│ │ ├── index.js
│ │ └── index.css
│ ├── tailwind.config.js
│ ├── postcss.config.js
│ └── package.json
├── ERD_DFD_Documentation.md
└── README.mdPrerequisites
Before running this application, ensure you have the following installed:
- Node.js (v14 or higher) - Download here
- MySQL Server (v5.7 or higher) - Download here
- npm (comes with Node.js)
Installation Instructions
1. Database Setup
The application automatically creates the database and tables on first run. However, ensure MySQL is running with the following default configuration:
- Host: localhost
- User: root
- Password: (empty)
If your MySQL has a different password, update the configuration in backend-project/config/database.js and backend-project/server.js.
2. Backend Setup
Navigate to the backend project directory:
cd backend-projectInstall dependencies:
npm installStart the backend server:
npm startThe backend will run on http://localhost:5000
3. Frontend Setup
Navigate to the frontend project directory:
cd frontend-projectInstall dependencies:
npm installStart the frontend development server:
npm startThe frontend will run on http://localhost:3000
Default Login Credentials
The application creates a default admin user on first run:
- Username: admin
- Password: Admin@123
Important: Change this password after first login for security.
Features
1. Authentication
- Session-based login system
- Password encryption using bcrypt
- Secure session management
2. Product Management
- Add new products
- View all products
- Edit product details
- Delete products
- Automatic total price calculation
3. Sales Management
- Record new sales
- View sales history
- Edit sales records
- Delete sales records
- Automatic stock update on sale
4. Stock Status
- View current stock levels
- Real-time stock monitoring
- Low stock alerts
- Out of stock indicators
5. Reports
- Daily Sales Report: View sales summary by date
- Stock Status Report: Complete inventory overview
- Print functionality for reports
API Endpoints
Authentication
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/check- Check authentication status
Products
GET /api/products- Get all productsGET /api/products/:id- Get product by IDPOST /api/products- Create new productPUT /api/products/:id- Update productDELETE /api/products/:id- Delete product
Sales
GET /api/sales- Get all salesGET /api/sales/:id- Get sale by IDPOST /api/sales- Create new salePUT /api/sales/:id- Update saleDELETE /api/sales/:id- Delete saleGET /api/sales/report/daily- Get daily sales reportGET /api/sales/report/daily/details- Get daily sales details
Stock Status
GET /api/stock- Get all stock statusGET /api/stock/:id- Get stock status by product IDGET /api/stock/report/status- Get stock status report
Database Schema
Users Table
- UserID (PK)
- Username
- Password (encrypted)
- CreatedAt
Products Table
- ProductID (PK)
- ProductName
- Category
- Quantity
- UnitPrice
- TotalPrice (computed)
- CreatedAt
Sales Table
- SalesID (PK)
- ProductID (FK)
- SoldQuantity
- SoldUnitPrice
- SoldTotalPrice (computed)
- SalesDate
- CreatedAt
StockStatus Table
- StockID (PK)
- ProductID (FK)
- AvailableQuantity
- SoldQuantity
- RemainingQuantity (computed)
- LastUpdated
ERD and DFD
Detailed Entity Relationship Diagram (ERD) and Data Flow Diagram (DFD) are available in ERD_DFD_Documentation.md.
Usage
- Start the MySQL server
- Start the backend server (
cd backend-project && npm start) - Start the frontend server (
cd frontend-project && npm start) - Open
http://localhost:3000in your browser - Login with default credentials (admin / Admin@123)
- Navigate through the application using the menu bar
Security Features
- Password encryption using bcrypt (10 salt rounds)
- Session-based authentication
- Protected API routes
- CORS configuration
- SQL injection prevention (parameterized queries)
Responsive Design
The application is fully responsive and works on:
- Desktop computers
- Tablets
- Mobile devices
Troubleshooting
Backend won't start
- Ensure MySQL is running
- Check database credentials in
config/database.js - Verify port 5000 is not in use
Frontend won't start
- Ensure Node.js is installed
- Check that dependencies are installed
- Verify port 3000 is not in use
Database connection error
- Verify MySQL server is running
- Check username and password in database config
- Ensure database
dab_enterprise_dbcan be created
Project Removal
After the assessment, to permanently remove the project:
- Stop both backend and frontend servers
- Delete the project folder:
FirstName_LastName_National_Practical_Exam_2026 - Optionally, drop the database:
DROP DATABASE dab_enterprise_db;
Note: Always ask permission from the assessor before removing the project.
License
This project was created for educational assessment purposes.
Contact
For questions or issues related to this project, please contact the development team.
Project completed for DAB Enterprise Ltd - National Practical Exam 2026
