Skip to content

A simple mail_order application with java and microsoft sql

Notifications You must be signed in to change notification settings

jAmikA78/Mail-Order

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# πŸ“¦ Mail Order Management System

## Overview

A comprehensive **Java-based Mail Order Management System** with a professional GUI built using Swing. The system manages customers, employees, orders, and parts inventory with a SQL Server database backend. This is a complete CRUD application with role-based access control for customers, employees, and administrators.

---

## 🎯 Key Objectives

βœ… **Customer Management** - Registration, authentication, and order tracking  
βœ… **Employee Management** - Order processing and shipment management  
βœ… **Admin Functions** - Complete system administration and inventory management  
βœ… **Order Processing** - Full order lifecycle management with parts tracking  
βœ… **Real-time Updates** - Instant data synchronization across the system  

---

## πŸ“Š System Architecture & Diagrams

### Entity-Relationship Diagram (ERD)
See `Diagrames/ERD.pdf` for the complete database schema and relationships between entities:
- **Customer** ↔ **Order** (One-to-Many)
- **Employee** ↔ **Order** (One-to-Many)
- **Part** ↔ **Part_of_order** (One-to-Many)
- **Order** ↔ **Part_of_order** (One-to-Many)

### Database Schema Diagram
Refer to `Diagrames/SCHEMA.pdf` for visual representation of:
- Table structures and relationships
- Primary and foreign keys
- Data types and constraints

### UML Class Diagram
Check `Diagrames/uml.pdf` for the complete object-oriented design:
- Class hierarchies and relationships
- Method definitions and attributes
- System components and interactions

---

## πŸ‘₯ Development Team

| Name | ID | Role |
|------|-----|------|
| Ahmed Ibrahim Abd ElGhany | C10 12300050 | Lead Developer |
| Kerolos Fatouh Ibrahim | C10 12300055 | QA/Testing |
| Ahmed Wael Farag | C10 12300100 | Backend Developer |
| Remon Naser Mahrous | C10 12300148 | Database Developer |
| Mohamed Tamer Mohamed | C10 12300026 | Frontend Developer |

---

## πŸ“ Project Structure

```
MAil_order/
β”œβ”€β”€ MailOrderSystem/                    # Main Java Application
β”‚   β”œβ”€β”€ src/MailOrderSystem/            
β”‚   β”‚   └── project.java                # Main application entry point
β”‚   β”œβ”€β”€ build/                          # Compiled classes
β”‚   β”œβ”€β”€ dist/                           # Deployable JAR
β”‚   β”œβ”€β”€ nbproject/                      # NetBeans configuration
β”‚   β”œβ”€β”€ build.xml                       # Ant build file
β”‚   └── manifest.mf                     # JAR manifest
β”œβ”€β”€ data_base/                          # Database Scripts
β”‚   β”œβ”€β”€ mail_order.sql                  # Production schema
β”‚   └── project.sql.txt                 # Documentation
β”œβ”€β”€ Diagrames/                          # System Architecture
β”‚   β”œβ”€β”€ ERD.pdf                         # Entity-Relationship Diagram
β”‚   β”œβ”€β”€ SCHEMA.pdf                      # Database Schema
β”‚   └── uml.pdf                         # UML Class Diagram
β”œβ”€β”€ backgrounds/                        # GUI Background Images
β”œβ”€β”€ sqljdbc_4.2/                        # SQL Server JDBC Driver
└── README.txt                          # This file
```

---

## πŸ› οΈ System Requirements

| Requirement | Version |
|-------------|---------|
| **Java** | 1.8 or higher |
| **SQL Server** | 2012 or higher |
| **IDE** | NetBeans (recommended) |
| **JDBC Driver** | SQL Server JDBC 4.2 |
| **OS** | Windows 10/11 |
| **Drive** | D: partition (recommended) |

---

## πŸš€ Installation & Setup

### Step 1: Database Configuration
```sql
-- Execute the scripts from data_base/mail_order.sql
-- Run on your SQL Server instance:
-- 1. Create database: mail_order
-- 2. Create all tables with provided schema
-- 3. Insert initial admin credentials
```

### Step 2: Project Setup
1. Clone or extract the project to `D:\projects\java\MAil_order`
2. Open NetBeans and load the `MailOrderSystem` project
3. Verify the JDBC driver path: `sqljdbc_4.2/sqljdbc_4.2.jar`

### Step 3: Database Connection Configuration
**File**: `MailOrderSystem/src/MailOrderSystem/project.java`

Update connection parameters:
```java
String path = "jdbc:sqlserver://localhost;databaseName=mail_order";
String username = "123";
String password = "123";
```

### Step 4: Build & Deploy
```bash
# Using NetBeans:
1. Right-click project β†’ Clean and Build
2. Run β†’ Run Project (F6)

# Or execute JAR directly:
java -jar dist/MailOrderSystem.jar
```

---

## πŸ‘€ User Roles & Permissions

### 1️⃣ Customer Role
- Register new account with email validation
- Login and manage profile
- Browse available parts/products
- Create and place new orders
- View order status in real-time
- Track shipment dates
- View complete order history
- Search past orders

### 2️⃣ Employee Role
- Login with secure authentication
- View assigned orders queue
- Update order processing status
- Record shipment dates
- Manage order fulfillment
- Access customer information
- Generate order reports

### 3️⃣ Administrator Role
- **User Management**: Add/remove employees and customers
- **Order Monitoring**: View and manage all system orders
- **Inventory Control**: Add, update, delete parts and prices
- **System Analytics**: Generate reports and statistics
- **Account Management**: Reset passwords, manage credentials
- **Search & Filter**: Advanced queries across all data

---

## πŸ’Ύ Database Schema

### Core Tables

#### `Customer`
| Column | Type | Description |
|--------|------|-------------|
| ID | INT (PK) | Customer identifier |
| F_name | VARCHAR | First name |
| L_name | VARCHAR | Last name |
| E_ZIP | VARCHAR | Email/ZIP code |
| pass_world | VARCHAR | Password hash |

#### `Employee`
| Column | Type | Description |
|--------|------|-------------|
| ID | INT (PK) | Employee identifier |
| F_name | VARCHAR | First name |
| L_name | VARCHAR | Last name |
| E_ZIP | VARCHAR | Email/ZIP code |
| pass_world | VARCHAR | Password hash |

#### `Part`
| Column | Type | Description |
|--------|------|-------------|
| Num | INT (PK) | Part number |
| Name | VARCHAR | Part description |
| Price | DECIMAL | Unit price |
| Quantity_in_stock | INT | Current stock |

#### `or_der`
| Column | Type | Description |
|--------|------|-------------|
| Order_num | INT (PK) | Order identifier |
| Date_of_receipt | DATE | Order received date |
| Ship_date | DATE | Planned ship date |
| Actual_ship_date | DATE | Actual ship date |
| time_order | TIME | Order time |
| customer_id | INT (FK) | Customer reference |
| employee_id | INT (FK) | Employee reference |

#### `Part_of_order`
| Column | Type | Description |
|--------|------|-------------|
| Ord_ID | INT (FK) | Order reference |
| Part_ID | INT (FK) | Part reference |
| Quantity | INT | Items ordered |

#### `Adminn`
| Column | Type | Description |
|--------|------|-------------|
| username | VARCHAR (PK) | Admin login |
| pass_world | VARCHAR | Password hash |

---

## πŸ” Authentication & Security

### Default Credentials (Development)
```
Database Server: localhost
Database Name: mail_order
Username: 123
Password: 123
```

### Security Features
- User-level authentication and authorization
- Role-based access control (RBAC)
- Password storage (currently plaintext - upgrade recommended)
- Session management
- Input validation and SQL injection prevention

⚠️ **IMPORTANT**: For production deployment:
- Use encrypted password storage
- Implement environment variables for credentials
- Enable SQL Server authentication
- Use SSL/TLS for database connections
- Implement audit logging

---

## 🎨 GUI Features

- **Professional Appearance**: Custom background images and themes
- **Responsive Interface**: Dialog boxes and real-time notifications
- **Data Tables**: JTable components for data display and editing
- **Selection Controls**: ComboBox for parts and options
- **Validation**: Real-time input validation with error messages
- **Calculations**: Automatic price and total calculations
- **Date/Time**: Integrated date and time picker components
- **Search**: Advanced search functionality across all modules

---

## πŸ”§ Key Features Implemented

βœ… Multi-user authentication system with role separation  
βœ… Complete CRUD operations (Create, Read, Update, Delete)  
βœ… Order management with full lifecycle tracking  
βœ… Inventory management and stock tracking  
βœ… Real-time data updates and synchronization  
βœ… Advanced search and filter functionality  
βœ… Input validation and error handling  
βœ… Professional GUI with user-friendly design  
βœ… Comprehensive reporting capabilities  
βœ… Database transaction management  

---

## πŸ“¦ Dependencies & Libraries

| Library | Version | Purpose |
|---------|---------|---------|
| sqljdbc | 4.2 | SQL Server database connectivity |
| Java Swing | Built-in | GUI framework |
| Java AWT | Built-in | Graphics and window toolkit |
| JDBC | Built-in | Database abstraction layer |

---

## ⚠️ Important Configuration Notes

### Path Requirements
- Project must be stored on **D: partition** (as configured in code)
- Database scripts should be executed on **SQL Server instance**
- Background images are loaded from `D:\backgrounds\`

### Configuration Changes
If relocating the project:
1. Update database path in `project.java`
2. Update background image paths
3. Update database connection string if using different server
4. Verify SQL Server JDBC driver is in classpath

### Development vs Production
```
DEVELOPMENT:
- Hardcoded credentials
- Local SQL Server
- Debug mode enabled

PRODUCTION:
- Environment variables for credentials
- Secured SQL Server with firewall
- Encrypted connections
- Audit logging enabled
- Backup strategy implemented
```

---

## πŸ“š Documentation Files

- **`Diagrames/ERD.pdf`** - Entity Relationship Diagram showing data model
- **`Diagrames/SCHEMA.pdf`** - Database schema with visual table layouts
- **`Diagrames/uml.pdf`** - UML class diagram for system architecture
- **`data_base/mail_order.sql`** - SQL scripts for database creation
- **`data_base/project.sql.txt`** - Additional SQL documentation

---

## 🀝 Support & Maintenance

For issues or contributions:
1. Review the architecture diagrams in `Diagrames/`
2. Check database schema in `data_base/mail_order.sql`
3. Consult UML diagram for class relationships
4. Review source code in `MailOrderSystem/src/`

---

## πŸ“„ License & Attribution

This is an academic project developed by the team listed above. For educational purposes.

**Last Updated**: November 2025  
**Project Status**: Complete

About

A simple mail_order application with java and microsoft sql

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published