Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaBaba

E-commerce web application — Course 20503, Group 61.

A coffee shop with a public catalog, search, cart, and checkout, plus an admin area for managing products, categories, orders, and promotional banners.

Architecture

TomEE 9.1.3 (Plume) · Jakarta EE 9.1 (jakarta.*) · JDK 17 · MySQL 8

Layered flow: JSF (Facelets) → JAX-RS REST API → Service → JDBC/DAO → MySQL. The UI does not touch the database directly; it calls the application's own REST API.

Prerequisites

  • JDK 17
  • MySQL 8 (running locally, and the root password)

Maven is not required — the project ships with the Maven Wrapper (mvnw).

In the commands below, use ./mvnw on macOS/Linux and .\mvnw on Windows PowerShell.

Setup & run

From the project root:

  1. Create the database. Start the MySQL client and load the schema (creates the javababa database, all tables, seed data, and the admin user):

    mysql -u root -p
    source db/schema.sql
    exit
    
  2. Configure the DB connection. Copy the template and fill in your MySQL password:

    src/main/webapp/WEB-INF/resources.xml.example  →  src/main/webapp/WEB-INF/resources.xml
    

    Edit resources.xml and set Password (and UserName if not root). This file is gitignored, so your password is never committed.

  3. Build and start the server:

    ./mvnw clean package tomee:run
    
  4. Open the app: http://localhost:8080/javababa/

Default login

Role Email Password
Admin admin@javababa.com admin

Customers register through the site's Register form.

Tests

Runs the unit test suite (no database or server required):

./mvnw test

Optional: AI-assisted search

Product search can use Google Gemini to expand a free-text query into related keywords. It is off by default and the search falls back to plain SQL when no key is set. To enable it, provide an API key before starting the server, e.g. on Windows PowerShell:

$env:GEMINI_API_KEY = "your-api-key"

Notes

  • Product/banner images are static files under src/main/webapp/img/, referenced by path. Adding a new image file requires rebuilding (clean package) so it is redeployed.
  • A mock branch runs the same app on in-memory data with no MySQL — useful for frontend work. main (this branch) uses the real MySQL backend.

About

Full E2E Java based E-commerce web app. Made by coffee lovers for course 20503 in the OpenU. Utilizing REST API, AI Studio API for smart search bar, JDBC, MySQL, JSF.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages