Skip to content

chiNguyenLe/Watcht

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Watch - Java E-commerce Web Application πŸ•

A full-featured e-commerce web application for selling watches, built with Java Servlets, JSP, and Hibernate ORM. Features both customer shopping experience and comprehensive admin management system.

🌟 Features

Customer Features

  • Product Catalog: Browse watches by categories (Casio, Rolex, Omega)
  • Product Details: Detailed watch specifications and images
  • Shopping Cart: Add/remove items with session-based cart management
  • User Authentication: Registration and login system
  • Order Management: Complete checkout flow with delivery address
  • Order Confirmation: Success pages and order tracking

Admin Features

  • Admin Dashboard: Comprehensive management interface with analytics
  • Product Management: CRUD operations for watches
  • Category Management: Organize products by brands
  • User Management: Manage customer accounts
  • Order Analytics: Chart-based reporting and sales analytics

πŸ› οΈ Technology Stack

Backend

  • Java - Core programming language
  • Java Servlets - Web application framework
  • JSP (JavaServer Pages) - Server-side templating
  • Hibernate ORM - Database persistence layer
  • MySQL - Relational database

Frontend

  • HTML/CSS - Structure and styling
  • JavaScript & jQuery - Client-side interactivity
  • Bootstrap - Responsive CSS framework
  • Custom CSS - Application-specific styling

Build & Deployment

  • Apache Ant - Build automation
  • NetBeans IDE - Development environment
  • GlassFish Server - Application server

πŸ“ Project Structure

watcht/
β”œβ”€β”€ src/                          # Java source code
β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”œβ”€β”€ controller/          # Servlet controllers
β”‚   β”‚   β”œβ”€β”€ entities/           # Hibernate entities
β”‚   β”‚   └── model/              # DAO layer
β”‚   └── conf/                   # Configuration files
β”œβ”€β”€ web/                        # Web resources
β”‚   β”œβ”€β”€ *.jsp                  # JSP pages
β”‚   β”œβ”€β”€ css/                   # Stylesheets
β”‚   β”œβ”€β”€ js/                    # JavaScript files
β”‚   β”œβ”€β”€ images/                # Static images
β”‚   └── WEB-INF/               # Web configuration
β”œβ”€β”€ nbproject/                  # NetBeans project files
β”œβ”€β”€ build.xml                  # Ant build script
└── watch_business.sql         # Database schema

πŸš€ Quick Start

Prerequisites

  • Java 8 or higher
  • NetBeans IDE (recommended)
  • MySQL Server
  • GlassFish Server

Installation

  1. Clone the repository

    git clone https://github.com/chinguyenle/watcht.git
    cd watcht
  2. Set up the database

    # Import the database schema
    mysql -u root -p < watch_business.sql
  3. Configure database connection

    • Update src/java/hibernate.cfg.xml with your MySQL credentials
    • Ensure database URL, username, and password are correct
  4. Build the project

    # Using Ant
    ant clean compile
    ant dist
  5. Deploy to GlassFish

    • Open NetBeans IDE
    • Import the project
    • Deploy to GlassFish server
    • Access the application at http://localhost:8080/watcht

πŸ—„οΈ Database Schema

The application uses 5 main tables:

  • category - Product categories (Casio, Rolex, Omega)
  • watch - Product information with specifications
  • user - Customer and admin accounts
  • invoice - Order headers
  • invoice_detail - Order line items

Sample Data Included

  • 3 product categories
  • 14 sample watches
  • Admin user and 2 customer accounts

πŸ”‘ Default Login Credentials

Admin Access

  • URL: http://localhost:8080/watcht/admin-login.jsp
  • Username: admin
  • Password: admin123 (check database for actual credentials)

Customer Access

  • URL: http://localhost:8080/watcht/login.jsp
  • Use the sample customer accounts from the database

πŸ“± Application Flow

Customer Journey

Home Page β†’ Product Catalog β†’ Product Details β†’ 
Add to Cart β†’ Review Cart β†’ Login/Register β†’ 
Delivery Address β†’ Order Confirmation β†’ Success

Admin Workflow

Admin Login β†’ Dashboard β†’ 
[Products/Categories/Users/Analytics Management] β†’ 
CRUD Operations β†’ Reports

πŸ—οΈ Architecture

Design Patterns Used

  • MVC (Model-View-Controller) - Separation of concerns
  • DAO (Data Access Object) - Database abstraction
  • Singleton - Database connection management

Key Components

  • Controllers: Servlet-based request handling
  • Models: Hibernate entities and DAO classes
  • Views: JSP pages with Bootstrap styling
  • Services: Business logic layer

πŸ”§ Build System

The project uses Apache Ant with NetBeans integration:

  • build.xml - Main build script with customization hooks
  • nbproject/ - NetBeans-generated build configuration
  • Ant Targets: clean, compile, dist, run, test

Custom Build Hooks Available

  • -pre-compile - Before compilation
  • -post-compile - After compilation
  • -pre-dist - Before WAR creation
  • -post-dist - After distribution
  • -post-clean - After cleanup

πŸ“Š Features in Detail

Shopping Cart

  • Session-based cart management
  • Add/remove items
  • Quantity updates
  • Price calculations

Order Management

  • Complete checkout process
  • Delivery address collection
  • Order confirmation emails
  • Order history tracking

Admin Analytics

  • Sales reporting with charts
  • User management dashboard
  • Product performance metrics
  • Category-wise analysis

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is open source and available under the MIT License.

πŸ› Known Issues

  • Basic security implementation (consider upgrading authentication)
  • Legacy servlet-based architecture
  • Limited error handling
  • No input validation on frontend

🚧 Future Improvements

  • Implement Spring Boot framework
  • Add REST API endpoints
  • Upgrade to modern frontend framework (React/Vue)
  • Add comprehensive security features
  • Implement caching mechanisms
  • Add unit and integration tests
  • Docker containerization

πŸ“ž Support

For questions or issues, please create an issue in the GitHub repository or contact the maintainer.


Built with ❀️ using Java and open source technologies

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors