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.
- 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 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
- Java - Core programming language
- Java Servlets - Web application framework
- JSP (JavaServer Pages) - Server-side templating
- Hibernate ORM - Database persistence layer
- MySQL - Relational database
- HTML/CSS - Structure and styling
- JavaScript & jQuery - Client-side interactivity
- Bootstrap - Responsive CSS framework
- Custom CSS - Application-specific styling
- Apache Ant - Build automation
- NetBeans IDE - Development environment
- GlassFish Server - Application server
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
- Java 8 or higher
- NetBeans IDE (recommended)
- MySQL Server
- GlassFish Server
-
Clone the repository
git clone https://github.com/chinguyenle/watcht.git cd watcht -
Set up the database
# Import the database schema mysql -u root -p < watch_business.sql
-
Configure database connection
- Update
src/java/hibernate.cfg.xmlwith your MySQL credentials - Ensure database URL, username, and password are correct
- Update
-
Build the project
# Using Ant ant clean compile ant dist -
Deploy to GlassFish
- Open NetBeans IDE
- Import the project
- Deploy to GlassFish server
- Access the application at
http://localhost:8080/watcht
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
- 3 product categories
- 14 sample watches
- Admin user and 2 customer accounts
- URL:
http://localhost:8080/watcht/admin-login.jsp - Username:
admin - Password:
admin123(check database for actual credentials)
- URL:
http://localhost:8080/watcht/login.jsp - Use the sample customer accounts from the database
Home Page β Product Catalog β Product Details β
Add to Cart β Review Cart β Login/Register β
Delivery Address β Order Confirmation β Success
Admin Login β Dashboard β
[Products/Categories/Users/Analytics Management] β
CRUD Operations β Reports
- MVC (Model-View-Controller) - Separation of concerns
- DAO (Data Access Object) - Database abstraction
- Singleton - Database connection management
- Controllers: Servlet-based request handling
- Models: Hibernate entities and DAO classes
- Views: JSP pages with Bootstrap styling
- Services: Business logic layer
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
-pre-compile- Before compilation-post-compile- After compilation-pre-dist- Before WAR creation-post-dist- After distribution-post-clean- After cleanup
- Session-based cart management
- Add/remove items
- Quantity updates
- Price calculations
- Complete checkout process
- Delivery address collection
- Order confirmation emails
- Order history tracking
- Sales reporting with charts
- User management dashboard
- Product performance metrics
- Category-wise analysis
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Basic security implementation (consider upgrading authentication)
- Legacy servlet-based architecture
- Limited error handling
- No input validation on frontend
- 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
For questions or issues, please create an issue in the GitHub repository or contact the maintainer.
Built with β€οΈ using Java and open source technologies