npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@20052507/dab-enterprise-bws

v1.0.1

Published

DAB Enterprise Ltd - Business Web Solution (BWS)

Downloads

24

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.md

Prerequisites

Before running this application, ensure you have the following installed:

  1. Node.js (v14 or higher) - Download here
  2. MySQL Server (v5.7 or higher) - Download here
  3. 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-project

Install dependencies:

npm install

Start the backend server:

npm start

The backend will run on http://localhost:5000

3. Frontend Setup

Navigate to the frontend project directory:

cd frontend-project

Install dependencies:

npm install

Start the frontend development server:

npm start

The 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 login
  • POST /api/auth/logout - User logout
  • GET /api/auth/check - Check authentication status

Products

  • GET /api/products - Get all products
  • GET /api/products/:id - Get product by ID
  • POST /api/products - Create new product
  • PUT /api/products/:id - Update product
  • DELETE /api/products/:id - Delete product

Sales

  • GET /api/sales - Get all sales
  • GET /api/sales/:id - Get sale by ID
  • POST /api/sales - Create new sale
  • PUT /api/sales/:id - Update sale
  • DELETE /api/sales/:id - Delete sale
  • GET /api/sales/report/daily - Get daily sales report
  • GET /api/sales/report/daily/details - Get daily sales details

Stock Status

  • GET /api/stock - Get all stock status
  • GET /api/stock/:id - Get stock status by product ID
  • GET /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

  1. Start the MySQL server
  2. Start the backend server (cd backend-project && npm start)
  3. Start the frontend server (cd frontend-project && npm start)
  4. Open http://localhost:3000 in your browser
  5. Login with default credentials (admin / Admin@123)
  6. 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_db can be created

Project Removal

After the assessment, to permanently remove the project:

  1. Stop both backend and frontend servers
  2. Delete the project folder: FirstName_LastName_National_Practical_Exam_2026
  3. 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