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.
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.
- JDK 17
- MySQL 8 (running locally, and the
rootpassword)
Maven is not required — the project ships with the Maven Wrapper (mvnw).
In the commands below, use
./mvnwon macOS/Linux and.\mvnwon Windows PowerShell.
From the project root:
-
Create the database. Start the MySQL client and load the schema (creates the
javababadatabase, all tables, seed data, and the admin user):mysql -u root -p source db/schema.sql exit -
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.xmlEdit
resources.xmland setPassword(andUserNameif notroot). This file is gitignored, so your password is never committed. -
Build and start the server:
./mvnw clean package tomee:run -
Open the app: http://localhost:8080/javababa/
| Role | Password | |
|---|---|---|
| Admin | admin@javababa.com |
admin |
Customers register through the site's Register form.
Runs the unit test suite (no database or server required):
./mvnw test
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"
- 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
mockbranch runs the same app on in-memory data with no MySQL — useful for frontend work.main(this branch) uses the real MySQL backend.