Skip to content

penguninn/first-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ Retail Management System

Java MySQL Swing Maven

A comprehensive Java desktop application for retail store management with modern UI and complete business functionality


πŸ“‹ Table of Contents

πŸ” Overview

The Retail Management System is a full-featured desktop application designed for managing retail operations. Built with Java Swing and MySQL, it provides a modern, user-friendly interface for handling sales, inventory, customer management, and business analytics.

Key Highlights

  • 🎯 Complete Business Solution: End-to-end retail management from inventory to analytics
  • 🎨 Modern UI: Professional interface with FlatLaf theme and responsive design
  • πŸ“Š Real-time Analytics: Dashboard with charts, KPIs, and business intelligence
  • πŸ” Role-based Access: Manager and employee roles with appropriate permissions
  • πŸ’Ύ Robust Database: MySQL backend with comprehensive data relationships
  • πŸ“ˆ Scalable Architecture: Well-organized codebase with separation of concerns

✨ Features

🏒 Core Business Modules

πŸ“Š Dashboard & Analytics

  • Real-time KPI monitoring (revenue, orders, profit margins)
  • Interactive charts and statistical visualizations
  • Multi-dimensional analytics (products, staff, customers)
  • Time-based filtering and reporting

πŸ’° Sales Management

  • Multi-order processing with shopping cart functionality
  • Real-time inventory validation
  • Customer lookup and creation
  • Voucher/discount system integration
  • Multiple payment methods (Cash, Bank Transfer)
  • Order workflow automation

πŸ“¦ Product Management

  • Master product catalog with variants
  • Product attributes (size, color, material, thickness)
  • Supplier relationship management
  • Inventory tracking and stock alerts
  • Advanced search and filtering

πŸ‘₯ Customer Management

  • Comprehensive customer database
  • Contact information and demographics
  • Customer status tracking
  • Phone-based lookup system
  • Purchase history integration

🧾 Invoice Management

  • Complete transaction history
  • Detailed invoice breakdown
  • Customer and payment tracking
  • Search and filtering capabilities

πŸ‘€ Staff Management

  • Employee database with role assignments
  • Login credential management
  • Performance tracking
  • Active/inactive status control

🎁 Promotion Management

  • Voucher creation and management
  • Time-based promotional campaigns
  • Usage limits and restrictions
  • Discount type configuration

πŸ”„ Return Processing

  • Product return handling
  • Automatic refund calculations
  • Inventory adjustment automation

πŸ› οΈ Technical Features

🎨 User Interface

  • Modern FlatLaf look and feel
  • Responsive MigLayout system
  • Custom Swing components
  • Interactive data tables with cell editors
  • Real-time form validation
  • Keyboard shortcuts and mouse interactions

πŸ“ˆ Data Visualization

  • JFreeChart integration for analytics
  • Dynamic chart updates
  • Color-coded performance metrics
  • Statistical trend analysis

πŸ“„ Export Capabilities

  • Excel export using Apache POI
  • PDF generation with iText
  • Customizable report formats

πŸ“Έ Screenshots

Coming soon - Application screenshots showcasing the modern UI and key features

πŸ› οΈ Technology Stack

Core Technologies

  • Java 21 - Latest LTS version with modern language features
  • Swing - Desktop GUI framework with custom components
  • MySQL 8.0 - Relational database for data persistence
  • Maven - Build automation and dependency management

UI & Design

  • FlatLaf - Modern look and feel for Swing applications
  • MigLayout - Flexible and powerful layout manager
  • SwingX - Enhanced Swing components
  • Custom Components - Purpose-built UI elements

Data & Analytics

  • JDBC - Database connectivity and operations
  • JFreeChart - Chart and graph generation
  • Apache POI - Excel file manipulation
  • iText - PDF document generation

Additional Libraries

  • JCalendar - Date picker components
  • TimingFramework - Animation support
  • JNA - Native system integration

πŸš€ Installation

Prerequisites

  • Java Development Kit (JDK) 21 or higher
  • MySQL Server 8.0 or higher
  • Maven 3.6 or higher

Setup Instructions

  1. Clone the Repository

    git clone <repository-url>
    cd first-project
  2. Database Setup

    # Start MySQL service
    sudo systemctl start mysql  # Linux
    # or
    brew services start mysql   # macOS
    
    # Import database schema
    mysql -u root -p < DuAn_1.sql
  3. Configure Database Connection

    Update database credentials in src/main/java/com/daipc/repo/JDBCHelper.java:

    private final String URL = "jdbc:mysql://localhost:3306/DuAn1_Final";
    private final String USER = "your_username";
    private final String PASSWORD = "your_password";
  4. Build and Run

    # Compile the project
    mvn compile
    
    # Run the application
    mvn exec:java

Default Login Credentials

  • Username: nva
  • Password: 123

πŸ“– Usage

Getting Started

  1. Login: Use the default credentials or create new employee accounts
  2. Dashboard: View real-time business metrics and analytics
  3. Sales: Process orders by selecting products and customers
  4. Inventory: Manage products, suppliers, and stock levels
  5. Customers: Maintain customer database and relationships
  6. Reports: Generate business reports and analytics

Common Workflows

Processing a Sale

  1. Navigate to Sales module
  2. Select or create customer
  3. Add products to cart (double-click or search)
  4. Apply vouchers/discounts if applicable
  5. Choose payment method
  6. Complete transaction

Managing Inventory

  1. Go to Products module
  2. Add new products with variants
  3. Set pricing and supplier information
  4. Monitor stock levels
  5. Update quantities as needed

Generating Reports

  1. Access Dashboard or respective modules
  2. Select date ranges and filters
  3. View real-time analytics
  4. Export data to Excel/PDF

πŸ“ Project Structure

src/main/java/com/daipc/
β”œβ”€β”€ UI/                     # Main application windows
β”‚   β”œβ”€β”€ Login.java         # Authentication entry point
β”‚   β”œβ”€β”€ MainFrame.java     # Main application window
β”‚   └── Header.java        # Application header
β”œβ”€β”€ form/                   # Business feature forms
β”‚   β”œβ”€β”€ Form_Sell.java     # Sales processing
β”‚   β”œβ”€β”€ Form_Products.java # Product management
β”‚   β”œβ”€β”€ Form_Customer.java # Customer management
β”‚   β”œβ”€β”€ Form_Bill.java     # Invoice management
β”‚   β”œβ”€β”€ Form_Staffs.java   # Staff management
β”‚   └── Form_Home.java     # Dashboard
β”œβ”€β”€ model/                  # Data entities
β”‚   β”œβ”€β”€ SanPham.java       # Product model
β”‚   β”œβ”€β”€ KhachHang.java     # Customer model
β”‚   └── HoaDon.java        # Invoice model
β”œβ”€β”€ repo/                   # Data access layer
β”‚   β”œβ”€β”€ JDBCHelper.java    # Database connection
β”‚   └── QuanLi*.java       # Business logic classes
β”œβ”€β”€ swing/                  # Custom UI components
β”œβ”€β”€ table/                  # Custom table components
└── chart/                  # Chart components

πŸ—ƒοΈ Database Schema

Core Tables

  • SanPham - Products and catalog
  • KhachHang - Customer information
  • NhanVien - Employee data
  • HoaDon - Invoice transactions
  • HoaDonCT - Invoice line items
  • Voucher - Promotional codes
  • NhaCungCap - Supplier management

Key Relationships

  • Products have multiple variants (size, color, material)
  • Invoices contain multiple product line items
  • Customers are linked to their purchase history
  • Employees are associated with their sales transactions

Development Guidelines

  • Follow Java coding conventions
  • Write meaningful commit messages
  • Add comments for complex business logic
  • Test thoroughly before submitting
  • Update documentation as needed

πŸ“§ For questions or support, please open an issue on GitHub

Made with ❀️ using Java and Swing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages