|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +<img src="src/main/webapp/images/logo.png" alt="IoTBay" width="110" /> |
| 4 | + |
1 | 5 | # IoTBay |
2 | 6 |
|
3 | | -IoT device e-commerce platform built with Java Servlets, JSP, and SQLite. |
| 7 | +**Full-stack e-commerce platform for IoT devices** |
| 8 | + |
| 9 | +[](https://github.com/salieri009/IoTBay/actions/workflows/ci.yml) |
| 10 | +[](https://github.com/salieri009/IoTBay/actions/workflows/deploy.yml) |
| 11 | +[](https://openjdk.org/projects/jdk/11/) |
| 12 | +[](https://www.sqlite.org/) |
| 13 | +[](https://ghcr.io/salieri009/iotbay) |
| 14 | +[](src/test/java/e2e/) |
| 15 | + |
| 16 | +Browse, purchase, and manage IoT devices — Smart Home, Industrial, Healthcare, and more. |
| 17 | + |
| 18 | +[Quick Start](#quick-start) · [Features](#features) · [Tech Stack](#tech-stack) · [Docs](docs/) |
| 19 | + |
| 20 | +</div> |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Features |
| 25 | + |
| 26 | +<table> |
| 27 | +<tr> |
| 28 | +<td width="33%" valign="top"> |
| 29 | + |
| 30 | +**User & Auth** |
| 31 | +- Registration with email validation |
| 32 | +- SHA-256 salted password hashing |
| 33 | +- Role-based access: Customer / Staff / Admin |
| 34 | +- Session management & audit trail |
| 35 | + |
| 36 | +</td> |
| 37 | +<td width="33%" valign="top"> |
| 38 | + |
| 39 | +**Product Catalog** |
| 40 | +- Full-text search with category, price & stock filters |
| 41 | +- 6 product categories |
| 42 | +- Paginated listing with sort controls |
| 43 | + |
| 44 | +</td> |
| 45 | +<td width="33%" valign="top"> |
| 46 | + |
| 47 | +**Shopping & Checkout** |
| 48 | +- Persistent session cart |
| 49 | +- Multi-step checkout with shipping options |
| 50 | +- Payment history & order confirmation |
| 51 | + |
| 52 | +</td> |
| 53 | +</tr> |
| 54 | +<tr> |
| 55 | +<td width="33%" valign="top"> |
| 56 | + |
| 57 | +**Order Management** |
| 58 | +- Full order lifecycle tracking |
| 59 | +- Shipment creation & tracking numbers |
| 60 | +- Customer order cancellation |
| 61 | + |
| 62 | +</td> |
| 63 | +<td width="33%" valign="top"> |
| 64 | + |
| 65 | +**Admin Dashboard** |
| 66 | +- KPI overview — sales, users, products |
| 67 | +- Product CRUD & user activation/deactivation |
| 68 | +- Bulk data export (CSV & JSON) |
| 69 | + |
| 70 | +</td> |
| 71 | +<td width="33%" valign="top"> |
| 72 | + |
| 73 | +**Security** |
| 74 | +- CSRF token validation |
| 75 | +- SQL injection prevention (prepared statements) |
| 76 | +- XSS output encoding |
| 77 | +- Full access log |
| 78 | + |
| 79 | +</td> |
| 80 | +</tr> |
| 81 | +</table> |
| 82 | + |
| 83 | +--- |
4 | 84 |
|
5 | 85 | ## Quick Start |
6 | 86 |
|
| 87 | +**Prerequisites:** Java 11+, Maven 3.6+ |
| 88 | + |
7 | 89 | ```bash |
8 | | -# Start local server |
| 90 | +git clone https://github.com/salieri009/IoTBay.git |
| 91 | +cd IoTBay |
9 | 92 | mvn jetty:run |
| 93 | +``` |
| 94 | + |
| 95 | +Open [http://localhost:8080](http://localhost:8080). |
10 | 96 |
|
11 | | -# Run all tests (server must be running) |
| 97 | +```bash |
| 98 | +# Run the full E2E test suite (server must be running) |
12 | 99 | mvn test |
13 | 100 | ``` |
14 | 101 |
|
| 102 | +> **No Java?** Use Docker instead: |
| 103 | +> ```bash |
| 104 | +> docker compose up |
| 105 | +> ``` |
| 106 | +
|
| 107 | +--- |
| 108 | +
|
| 109 | +## Tech Stack |
| 110 | +
|
| 111 | +<div align="center"> |
| 112 | +
|
| 113 | +| Layer | Technology | |
| 114 | +|---|---| |
| 115 | +| **Backend** |   | |
| 116 | +| **Database** |  | |
| 117 | +| **Frontend** |   | |
| 118 | +| **Server** | -00CED1) -F8DC75?logo=apachetomcat&logoColor=black) | |
| 119 | +| **Testing** |   | |
| 120 | +| **CI/CD** |   | |
| 121 | +
|
| 122 | +</div> |
| 123 | +
|
| 124 | +--- |
| 125 | +
|
| 126 | +## Architecture |
| 127 | +
|
| 128 | +```mermaid |
| 129 | +flowchart TD |
| 130 | + A[Browser] --> B[JSP Views] |
| 131 | + B --> C[Servlet Controllers] |
| 132 | + C --> D[Service Layer\nCart · Order · Product · User · Review] |
| 133 | + D --> E[DAO Layer\ninterface + impl per entity] |
| 134 | + E --> F[(SQLite)] |
| 135 | +``` |
| 136 | +
|
| 137 | +<details> |
| 138 | +<summary>Domain model — 10 core entities</summary> |
| 139 | + |
| 140 | +| Entity | Key Relationships | |
| 141 | +|---|---| |
| 142 | +| `User` | has many `Order`, `Review`, `CartItem`, `AccessLog` | |
| 143 | +| `Product` | belongs to `Category`; has many `Review`, `OrderProduct` | |
| 144 | +| `Order` | has many `OrderProduct`, one `Payment`, one `Shipment` | |
| 145 | +| `CartItem` | links `User` → `Product` | |
| 146 | +| `Review` | links `User` → `Product` | |
| 147 | +| `Shipment` | belongs to `Order` | |
| 148 | +| `Payment` | belongs to `Order` | |
| 149 | +| `Supplier` | supplies `Product` | |
| 150 | +| `AccessLog` | records every authenticated action | |
| 151 | + |
| 152 | +</details> |
| 153 | + |
| 154 | +<details> |
| 155 | +<summary>Feature coverage — F01–F10 (118 E2E tests)</summary> |
| 156 | + |
| 157 | +| ID | Feature | Tests | |
| 158 | +|---|---|---| |
| 159 | +| F01 | Access Log | 6 | |
| 160 | +| F02 | Product Catalog | 10 | |
| 161 | +| F03 | Order Management | 8 | |
| 162 | +| F04 | Payment | 8 | |
| 163 | +| F05 | Shipment | 12 | |
| 164 | +| F06 | User Management | 10 | |
| 165 | +| F07 | Customer Management | 12 | |
| 166 | +| F08 | Staff Management | 12 | |
| 167 | +| F09 | Supplier Management | 10 | |
| 168 | +| F10 | Data Management (CSV/JSON) | 16 | |
| 169 | +| — | Security Boundary Tests | 14 | |
| 170 | +| **Total** | | **118** | |
| 171 | + |
| 172 | +</details> |
| 173 | + |
| 174 | +--- |
| 175 | + |
15 | 176 | ## Documentation |
16 | 177 |
|
17 | | -Full documentation is in the [`docs/`](docs/) directory: |
| 178 | +<details> |
| 179 | +<summary>Full documentation index</summary> |
18 | 180 |
|
19 | | -- [Project Overview](docs/1_getting-started/PROJECT_OVERVIEW.md) |
20 | | -- [Quick Start Guide](docs/1_getting-started/QUICKSTART.md) |
21 | | -- [Architecture](docs/2_architecture/) |
22 | | -- [Testing Guide](docs/5_testing/E2E_TESTING.md) |
23 | | -- [Deployment](docs/4_development/deployment/) |
| 181 | +| Section | Links | |
| 182 | +|---|---| |
| 183 | +| [Getting Started](docs/1_getting-started/) | [Project Overview](docs/1_getting-started/PROJECT_OVERVIEW.md) · [Quick Start](docs/1_getting-started/QUICKSTART.md) · [Setup Guide](docs/1_getting-started/SETUP_GUIDE.md) | |
| 184 | +| [Architecture](docs/2_architecture/) | [Components](docs/2_architecture/COMPONENT_ARCHITECTURE.md) · [Database Design](docs/2_architecture/DATABASE_DESIGN.md) · [Security Architecture](docs/2_architecture/SECURITY_ARCHITECTURE.md) | |
| 185 | +| [Requirements](docs/3_requirements/) | [Features](docs/3_requirements/FEATURES.md) · [User Stories](docs/3_requirements/USER_STORIES.md) · [API Reference](docs/3_requirements/API_REFERENCE.md) | |
| 186 | +| [Development](docs/4_development/) | [Backend Guide](docs/4_development/BACKEND_GUIDE.md) · [Frontend Guide](docs/4_development/FRONTEND_GUIDE.md) · [Contributing](docs/4_development/CONTRIBUTING.md) | |
| 187 | +| [Deployment](docs/4_development/deployment/) | [Docker Setup](docs/4_development/deployment/DOCKER_SETUP.md) · [Local](docs/4_development/deployment/LOCAL_DEPLOYMENT.md) · [Production](docs/4_development/deployment/PRODUCTION_DEPLOYMENT.md) | |
| 188 | +| [Testing](docs/5_testing/) | [E2E Guide](docs/5_testing/E2E_TESTING.md) · [Test Strategy](docs/5_testing/TEST_STRATEGY.md) · [Test Data](docs/5_testing/TEST_DATA.md) | |
24 | 189 |
|
25 | | -## Tech Stack |
| 190 | +</details> |
| 191 | + |
| 192 | +--- |
26 | 193 |
|
27 | | -- **Backend:** Java 11, Servlets, JSP, SQLite |
28 | | -- **Frontend:** Tailwind CSS, Vanilla JS |
29 | | -- **Server:** Jetty (dev), Tomcat (prod) |
30 | | -- **Testing:** JUnit 4, Selenium WebDriver 4 |
31 | | -- **CI/CD:** GitHub Actions, Docker, GHCR |
| 194 | +<div align="center"> |
| 195 | +Java Servlets · JSP · SQLite · Tailwind CSS · Selenium WebDriver<br/> |
| 196 | +297 commits · 8 contributors · 111 source files · 118 E2E tests |
| 197 | +</div> |
0 commit comments