Skip to content

jkatumba/eduuka-app

Repository files navigation

E-Duuka web app

Description

E-Duuka is an easy to use point of sale web application targeting small to medium scale shops in Uganda.

Problem Statement

In Uganda, large supermarkets and retail chains commonly use established Point of Sale (POS) systems to manage inventory, sales, and reporting. These systems perform well in structured environments with dedicated hardware, trained staff, and consistent infrastructure.

However, the majority of retail businesses in Uganda are small to medium-scale shops including duukas, mini-supermarkets, pharmacies, hardware shops, and kiosks and operate under very different constraints. Most do not own dedicated POS hardware such as barcode scanners, receipt printers, or fixed terminals.

Proposed Solution

E-Duuka is a lightweight, web-based Point of Sale (POS) application designed to work using commonly available devices: a laptop with a webcam or a mobile phone for QR code scanning at the counter

Stakeholders

Shop Owners (Business Owners)

Shop owners and business owners are individuals who own and manage retail shops. Their primary interest is maintaining accurate records of stock and sales while reducing losses caused by theft, errors, or unverified transactions. They require clear visibility into daily, weekly, and monthly business performance using affordable systems that run on devices they already own, such as laptops or mobile phones. E-Duuka supports these needs by providing real-time inventory updates, separating sales from verification to improve accountability, enabling secure access to business data, and supporting data-driven decision making

Shop Attendants (Staff)

Shop attendants or staff are employees responsible for handling day-to-day sales at the counter. They need a fast and simple sales process that requires minimal training and reduces manual calculations and errors, especially during busy hours. E-Duuka serves them by offering a simple and intuitive sales interface optimized for speed, with QR code scanning using a laptop webcam or phone camera to make sales quicker and more accurate.

Finance (Verification Staff)

Finance or verification staff are responsible for reviewing recorded sales, verifying transactions, and ensuring accuracy before final approval. Their role requires the ability to verify sales independently and maintain a clear audit trail that shows who made and who verified each sale. E-Duuka supports this by providing a dedicated verification role with restricted permissions and enforcing a clear separation between sales entry and approval to improve transparency and internal controls.

System Administrator (Admin)

TThe system administrator is responsible for managing access to the system and assigning user roles within the shop. They require control over who can access the system, the ability to promote or demote staff roles, and a secure system configuration. E-Duuka provides administrative tools for managing users and roles while enforcing authentication and role-based access control to ensure secure operation.

Customers

Customers are indirect stakeholders who interact with the system during the sales process. Their main concern is receiving fast, accurate service with correct pricing and minimal delays at checkout. E-Duuka improves the customer experience by speeding up the sales process through QR-based transactions and reducing pricing and billing errors.

Uganda Revenue Authority (URA)

The Uganda Revenue Authority (URA), through initiatives such as EFRIS, is a regulatory stakeholder with an interest in the availability of reliable sales and inventory records for tax compliance and transparency. While E-Duuka is not integrated with URA systems, it aligns indirectly by maintaining structured, time-stamped digital sales records and improving the accuracy and consistency of transaction data, which can support proper record-keeping when required.

Developers and System Maintainers

Developers and system maintainers are responsible for building, maintaining, and improving the E-Duuka application. They require clear system requirements, user feedback, and a maintainable, scalable, and secure architecture. E-Duuka supports this through a modular design using modern web technologies, cloud-based database management, and clear role-based access control that simplifies development and maintenance.

Features

Authentication

The system provides user authentication to ensure that only authorized users can access the application. Each user must log in using valid credentials before interacting with any system functionality. Authentication is enforced across all protected pages, ensuring that sensitive business data such as sales records and inventory information is accessible only to authenticated users.

Role-based access

The system supports role-based access control to enforce separation of responsibilities within the shop. Three roles are defined: staff, finance, and administrator. Staff users are permitted to record sales, finance users are responsible for verifying sales records, and administrators manage user roles and system access. This role separation improves accountability and reduces the risk of unauthorized actions.

Inventory Management

The system includes an inventory management feature that allows authorized users to add, update, and view stock items. Each product record contains relevant information such as name, quantity, and pricing. Inventory levels are automatically updated whenever a sale is completed, ensuring that stock records remain accurate and up to date.

Sales Management

The sales management feature enables staff users to record sales efficiently at the point of sale. Sales are captured digitally and linked to the authenticated user who performed the transaction. This provides traceability and ensures that each sale can be reviewed and verified when necessary.

Sales Verification

The system includes a sales verification feature that allows finance users to review recorded sales before they are finalized. Verified sales are marked accordingly, while unverified sales remain pending. This verification process introduces an internal control mechanism that helps detect errors, prevent fraud, and improve financial accuracy.

QR Scan

The system supports QR code–based sales entry to improve speed and accuracy during checkout. Products can be scanned using a laptop webcam or a mobile phone camera, eliminating the need for dedicated barcode scanners. This feature reduces manual data entry and minimizes errors during busy sales periods.

Realtime Updates

The system provides real-time updates across inventory and sales data. When a sale is recorded or verified, the corresponding inventory and sales records are updated immediately. This allows users to view current stock levels and sales performance without delays.

User Management

An administrative management feature allows administrators to manage user accounts and roles within the system. Administrators can promote staff users to finance roles or demote users as needed. This ensures that system access remains aligned with staff responsibilities.

Data security

The system implements data security measures to protect sensitive business information. User credentials are securely handled, and data transmission is encrypted to prevent unauthorized access or data sniffing. These measures help maintain confidentiality and system integrity.

System Architecture

The E-Duuka system uses a web-based client–server architecture. Users interact with the system through a web browser on a laptop or mobile phone. This approach eliminates the need for specialized point-of-sale hardware and allows the system to scale as the number of users or shops increases.

The client layer provides the user interface for sales processing, inventory management, sales verification, and administrative functions. User interactions from the client are sent to the application layer for processing.

The application layer is implemented using Next.js and TypeScript. It handles core business logic, authentication, role-based access control, and system workflows such as sales recording and verification. This layer enforces permissions based on user roles and coordinates communication between the client and the database.

Database is managed using MongoDB hosted on MongoDB Atlas. The database stores user accounts, roles, inventory records, sales transactions, and verification status. The cloud-based database ensures data availability, supports concurrent access by multiple users, and enables reliable storage of business records.

Tech Stack

The frontend is developed using Next.js with TypeScript with Tailwind CSS is used for styling the user interface.

The backend logic is handled within the Next.js application using server-side capabilities. Business logic, authentication, role-based access control, and system workflows are implemented using TypeScript to ensure consistency across the application.

Data is managed using MongoDB, with MongoDB Atlas providing a cloud-hosted database solution.

Authentication is implemented using NextAuth, providing secure user login and session management. Passwords are securely handled using bcryptjs to ensure safe credential storage.

QR code functionality is supported using react-qr-code for QR generation and @yudiel/react-qr-scanner for QR scanning through device cameras. This allows the system to perform QR-based sales using a laptop webcam or mobile phone camera without requiring additional hardware.

User interface enhancements and interactions are supported using Framer Motion for animations and Lucide React for icons, improving usability without compromising performance.

Project Structure

The project follows the Next.js App Router structure, with all application logic organized under the app folder.

app/

The app folder is the main entry point of the system. It contains routing, UI pages, API endpoints, database models, authentication logic, and shared utilities.

app/auth/

The auth folder inside app contains the authentication pages. These include the signup and signin pages that allow users to create an account and authenticate into the system. After a successful signup, users proceed to signin. Upon signin, authenticated users are redirected to the dashboard area of the system.

app/dash/

The dash/ folder represents the protected dashboard area. This is the main working area of the application after authentication. It contains the inventory, sales, and user management pages. The dashboard layout includes a sidebar that provides navigation between these sections. Access to user management is restricted to users with the admin role, while inventory and sales are available based on assigned permissions.

app/components/

The components/ folder inside app/ contains reusable UI components used across pages. These include layout components such as the sidebar, tables, forms, buttons, modals, and other shared interface elements. Keeping UI components here ensures consistency and reuse across the application.

app/api/

The api/ folder inside app/ contains all backend API routes implemented using route.ts files. Each API route handles server-side logic such as creating, reading, updating, and deleting records in the database. These routes act as the bridge between the frontend UI and the database.

app/lib/

The lib/ folder inside app/ contains authentication configuration and database connection logic.

app/models

The models/ folder inside app/ contains Mongoose models that define the database schema for each entity in the system. These include models for users, inventory items, and sales transactions. Each model represents a single collection in MongoDB and is used by API routes to enforce consistent data structure.

app/types

The types/ folder inside app/ contains shared TypeScript type definitions used across the application.

Environment variables

These variables are defined in a .env file at the root of the project and are required for authentication and database connectivity.

The MONGODB_URI variable defines the MongoDB connection string used by the application. It points to the MongoDB Atlas cluster where all system data is stored.

The NEXTAUTH_SECRET variable is used by NextAuth to sign and encrypt JSON Web Tokens (JWTs) and session data.

The NEXTAUTH_URL variable defines the base URL of the application

Installation

npm install mongoose next-auth bcryptjs framer-motion lucide-react clsx tailwind-merge react-qr-code @yudiel/react-qr-scanner --legacy-peer-deps

npm install -D @types/bcryptjs

Run

npm run dev

Deployed Application

E-Duuka is already deployed and running as a live web application on Vercel at https://eduuka-app-v1.vercel.app/.

UI Samples

inventory

Inventory

It provides an inventory page to manage stock inventory

and sales page for making sales.

Sales

And sales page for making sales. sales

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors