Shop. Manage. Analyze Smarter.
An integrated Electronics E-Commerce, Inventory & AI Business Intelligence platform featuring a component catalog, multi-channel checkout, sales analytics dashboard, and AI-powered advisor agents.
Introduction β’ Local Setup & Credentials β’ Screenshots β’ Features β’ Architecture β’ Design Patterns β’ Tech Stack β’ Services & Environment Configuration β’ Getting Started β’ API Reference β’ Database Schema β’ Project Structure β’ Product Categories β’ Roadmap β’ Contributing β’ License
Xontrix is a full-stack, monorepo-based electronic components e-commerce platform and business intelligence suite. Built to provide hobbyists and professional builders with an easy way to purchase microcontrollers, sensors, motors, and shields, Xontrix also delivers a powerful web portal for administrators to run sales analytics, track stock levels, and coordinate delivery calendars.
The platform links a clean React web frontend and an Apache Cordova mobile client with a PHP/MySQL API server and a dedicated Node.js/Express authentication server. By integrating inventory capping checks, role-based access, a full user account dashboard, and conversational AI advisor widgets (an Admin-side AI Strategic Advisor and a User-side AI Electronics Consultant), Xontrix is a comprehensive showcase of modern e-commerce engineering.
π‘ Designed for local & mobile deploy, Xontrix utilizes XAMPP (Apache + MySQL) to keep backend setups simple and lightweight. This makes it easy to run local demonstrations, debug database states, and compile native Android packages directly against the local web API.
| Service | Address / Port | Technology | Location |
|---|---|---|---|
| π Web Portal | http://localhost:5173 | React 18 + Vite 6 + Tailwind 4 | apps/web/ |
| π Auth Server | http://localhost:3001 | Node.js + Express + JWT | apps/auth-server/ |
| βοΈ API Server | http://localhost/xontrix-backend/api | PHP REST-like API | apps/backend/xontrix-backend/ |
| πΎ Seed Installer | http://localhost/xontrix-backend/api/install.php | Schema seed engine | apps/backend/xontrix-backend/api/install.php |
| π¦ Mobile App | Target Android APK | Apache Cordova CLI wrapper | apps/mobile/cordova-mobile/ |
The database installer includes seeded user records to speed up development. Running the seeder initializes the default admin user listed below. You can log in using these credentials to access the analytics and management dashboards:
| Role | Password | Admin Access | |
|---|---|---|---|
| Platform Administrator | admin@xontrix.local |
admin123 |
β Full access to sales analytics, orders, products, inventory, user lists, and AI reports |
Note: To seed or reset the database back to default records (including products, orders, user accounts, and feedback comments), run the
install.phpfile in your browser once. For production security, restrict access or delete this file in deployment environments.
π Navigation Header
Persistent top navigation bar with logo, search field, category links, cart badge, and user account menu.
π Homepage β Hero Section
Modern storefront hero featuring a full-width promo banner, headline copy, and a primary call-to-action to browse the catalog.
π Homepage β Categories Section
Visual category grid showcasing all six electronics categories with icon cards and quick-navigate links.
π Homepage β Universities & Featured Sections
Mid-page highlights including university partnerships, featured component picks, and promotional deal rows.
π£ Homepage Footer
Clean, descriptive footer layout listing store links, customer attributions, and design credits.
ποΈ Products Page β Catalog Listing
Product catalog screen featuring category sidebar filters, search bar, item ratings, stock status, and add-to-cart actions.
ποΈ Products Page β Scrolled View
Lower catalog section showing additional products with consistent card layout and badge indicators.
π¦ Product Detail β Top View
Individual product page with high-res image, pricing, stock indicator, specification table, and add-to-cart controls.
π¦ Product Detail β Scrolled View
Lower product detail area showing the full specifications breakdown, ratings summary, and customer reviews.
π Cart β Empty State
Empty cart state with a friendly placeholder illustration and a call-to-action to continue browsing the catalog.
βΉοΈ About Page β Top View
Frosted-glass UI introducing the store's mission, quality standards, and core team overview.
βΉοΈ About Page β Scrolled View
Lower about section featuring technical partner attributions, community milestones, and social proof details.
π¬ Contact Page
Clean contact page with an interactive query form, customer support links, and office location details.
π Login Page
Authentication page supporting standard email/password login and Google sign-in via Firebase OAuth flow.
π€ Chatbot β Opened
AI Electronics Consultant floating widget opened, ready to assist users with product compatibility questions.
π€ Chatbot β Active Conversation
Live chatbot session demonstrating context-aware recommendations for selecting compatible microcontrollers and sensors.
π³ Checkout Page
Checkout layout showing order summary, shipping calculation, and multi-channel payment method options (GCash, Maya, COD, Card).
π« 404 Not Found Page
Styled not-found page with navigation shortcuts to guide users back to the catalog or homepage.
| Feature | Description |
|---|---|
| π Product Catalog & Filters | Dynamic electronics catalog with category sorting, search, item ratings, reviews, stock labels, and new item flags. |
| π³ Flexible Checkout Flow | Step-by-step transaction form supporting GCash, Maya, Cash on Delivery (COD), and credit card configurations. |
| π¦ Real-Time Inventory Sync | Automatic database checks that block purchases when quantities exceed stock, updating stock values on successful orders. |
| π Admin Sales Analytics | Business Intelligence dashboard with charts, MoM growth metrics, targets, pending/shipped order states, and low-stock warnings. |
| π€ AI Strategic Advisor | Admin-side chatbot that scans sales metrics and historical feedback to generate financial advice. |
| π¬ AI Electronics Consultant | Customer-side floating chat widget that guides users on picking compatible microcontrollers and sensors. |
| π Delivery Order Calendar | Dynamic calendar displaying shipping statuses, order delivery deadlines, and priority warnings. |
| π Customer Loyalty Tiers | Automatically places customers into Bronze, Silver, Gold, or Platinum tiers based on total spend and order counts. |
| π€ User Account Dashboard | Full profile management with order history, saved addresses, wishlist, notifications, and security settings. |
| π Multi-Auth Protocol | Session-based login, JWT authentication via Node.js/Express auth server, and Google OAuth via Firebase Auth SDK. |
| π± Cordova Mobile Wrapper | Cordova project setup targeting Android platforms, allowing the web portal to be compiled into a native APK. |
| ποΈ PNPM Monorepo Layout | Organized workspaces grouping the web app, auth server, PHP API backend, documentation, and mobile build wrappers. |
graph TB
subgraph Client ["π₯οΈ Client Layer"]
WEB["React 18 & TypeScript<br/>Web Portal<br/>(Vite 6)"]
MOBILE["Apache Cordova<br/>Mobile App<br/>(Android APK Target)"]
end
subgraph AuthSrv ["π Auth Server (Node.js / Express)"]
JWT["JWT Token Issuer<br/>bcrypt Password Hashing"]
GOOGLE["Google Token Verifier<br/>(google-auth-library)"]
end
subgraph API ["βοΈ API Layer (Apache / XAMPP)"]
BOOTSTRAP["bootstrap.php<br/>Global Init & Cors"]
CONFIG["config.php<br/>MySQL DB Config"]
PRODUCTS["products.php<br/>Product Catalog CRUD"]
ORDERS["orders.php<br/>Order Placement & Sync"]
USERS["users.php<br/>Session Auth & Roles"]
SALES["sales.php<br/>Sales & Analytics API"]
UPLOAD["upload.php<br/>Image Uploader"]
end
subgraph Data ["πΎ Data Layer (Local Server)"]
MYSQL["MySQL Database<br/>(Local Relational tables)"]
end
subgraph Services ["π External Services"]
FIREBASE["Firebase Auth SDK<br/>Google Login Portal"]
end
subgraph UserAI ["π¬ Client-side User AI"]
CONSULTANT["AI Floating Widget<br/>Electronics Consultant"]
end
subgraph AdminAI ["π€ Admin-side AI"]
ADVISOR["AI Strategic Advisor<br/>Chatbot Interface"]
end
WEB -->|"HTTP Requests"| API
WEB -->|"Auth Requests"| AuthSrv
MOBILE -->|"HTTP Requests"| API
WEB -->|"OAuth Tokens"| FIREBASE
AuthSrv -->|"SQL Queries"| MYSQL
API -->|"SQL Queries"| MYSQL
WEB -->|"Floating Chat"| CONSULTANT
WEB -->|"Admin Chat"| ADVISOR
ADVISOR -->|"Scans Context"| API
style Client fill:#1e1b4b,stroke:#818cf8,color:#f8fafc
style AuthSrv fill:#1e293b,stroke:#22d3ee,color:#f8fafc
style API fill:#111827,stroke:#10b981,color:#f8fafc
style Data fill:#1e1b4b,stroke:#eab308,color:#f8fafc
style Services fill:#111827,stroke:#f97316,color:#f8fafc
style UserAI fill:#1e293b,stroke:#06b6d4,color:#f8fafc
style AdminAI fill:#1e293b,stroke:#a855f7,color:#f8fafc
User / Admin Interaction
β
ββββ [Products List / Catalog] ββ productsApi.list() βββ products.php βββ MySQL (SELECT)
β
ββββ [Checkout Transaction] βββββ ordersApi.create() βββ orders.php
β ββββ Check Stock Availability
β ββββ Deduct MySQL Inventory (UPDATE)
β ββββ Insert Order & Items (INSERT)
β ββββ Return ApiOrder JSON
β
ββββ [Login / Register] βββββββββ Auth Server (Express) ββ JWT Token
β ββββ bcrypt password hash verify
β ββββ Google token validation
β ββββ Return signed JWT cookie
β
ββββ [AI Strategic Advice] ββββββ Admin Dashboard ββββββ salesApi.summary() βββ sales.php
β ββββ Compute financial KPIs
β ββββ Retrieve daily/weekly/monthly charts
β ββββ Strategic advice prompt context
β
ββββ [Google Authentication] ββββ Firebase Auth SDK ββββ Auth Server / users.php
ββββ Create / Login User Record
ββββ Return Session Cookie
| Pattern | Usage | Details |
|---|---|---|
| π Monorepo Structure | Workspace Layout | Manages multiple applications (frontend, auth server, backend, mobile) within a single codebase using pnpm-workspace.yaml. |
| π Model-View-Controller (MVC) | Backend Routing | PHP controllers act as routers (Controllers), database queries represent data shapes (Models), and JSON outputs serve as views (Views). |
| π§± Type-Safe Contracts | API Interface Client | TypeScript interfaces in the web app mirror MySQL schema fields exactly, creating an end-to-end data contract. |
| π JWT + Session Auth | User Authentication | Combines a dedicated Node.js JWT auth server with PHP sessions, plus Firebase tokens for Google OAuth client flows. |
| π‘οΈ Guard / Policy Pattern | Admin Route Protection | Middleware checks roles (e.g., admin role check) both in React Router (frontend) and on the PHP backend APIs (backend). |
| π£ State Synchronization | React Hooks & Context | Syncs shopping cart state, session user profiles, and catalog cache across pages using React Context providers. |
| βοΈ Inventory Safety | Optimistic Locking | Verifies quantity caps during cart updates and re-validates stock levels at the moment of checkout transaction. |
| π€ Conversational Interface Agent | UI Chat Widgets | Integrates floating conversational UI components leveraging context-aware responses to guide users and advise admins. |
Workspace (Local Edit)
β
ββββ Web Assets Build βββ pnpm build βββ dist/ βββ Deploy to Static Apache Root
β
ββββ Auth Server ββββββββ node server.js (or nodemon) βββ localhost:3001
β
ββββ Mobile APK Build βββ cordova build android βββ platforms/android/app/.../app-debug.apk
β
ββββ Backend Setup ββββββ Copy apps/backend/xontrix-backend to htdocs/
ββββ Trigger db seeder install.php
| # | Service | Role | Server / Local | Description |
|---|---|---|---|---|
| 1 | Apache HTTP Server | Web API Host | Local (XAMPP) | Hosts the PHP controllers and assets, handling API routing calls. |
| 2 | MySQL Database | Relational Storage | Local (XAMPP) | Stores core entities: products, inventory, users, sales metrics, and logs. |
| 3 | Node.js Auth Server | JWT Authentication | Local (Express) | Handles password hashing, JWT token issuance, and Google token validation. |
| 4 | Firebase Console | Google Identity Provider | Cloud Service | Authenticates user clients and returns credentials for Google login sync. |
| 5 | Cordova Android SDK | APK Compiler | Local CLI | Wraps frontend files into native Android app package configurations. |
To let the frontend web portal communicate with the backend PHP endpoints, auth server, and Google Auth, create a .env file under apps/web/ containing:
# ββ API Connection (XAMPP Local Server) ββ
VITE_API_URL=http://localhost/xontrix-backend/api
# ββ Auth Server Connection ββ
VITE_AUTH_URL=http://localhost:3001
# ββ Google Authentication (Firebase Console Setup) ββ
VITE_FIREBASE_API_KEY=your_firebase_api_key_here
VITE_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_firebase_app_idEnsure you have the following software installed locally:
| Tool | Version | Link |
|---|---|---|
| π’ Node.js | β₯ 18.0 |
nodejs.org |
| π¦ pnpm | β₯ 9.0 |
pnpm.io |
| ποΈ XAMPP / WampServer | Latest (PHP 8+, MySQL) | apachefriends.org |
| π± Android Studio / SDK | Command Line Tools & Gradle | developer.android.com |
| β Java JDK | 17 |
oracle.com |
1. Clone the repository
git clone https://github.com/TechyElle/e-commerce_website.git
cd e-commerce_website2. Install dependencies
pnpm install3. Configure the PHP / MySQL Backend (XAMPP)
- Copy the folder
apps/backend/xontrix-backendinto your XAMPP htdocs directory:C:\xampp\htdocs\xontrix-backend - Open XAMPP Control Panel and start Apache and MySQL.
4. Generate & Seed the Database
- Open your browser and navigate once to:
This creates the tables defined in
http://localhost/xontrix-backend/api/install.phpschema.sqland inserts mock electronics products, orders, and users.
5. Start the Auth Server
cd apps/auth-server
npm run devThe auth server will be available at http://localhost:3001.
6. Start the Frontend Web App
- Ensure you have configured your
.envfile underapps/web/. - From the monorepo root, launch the development server:
pnpm dev
- Open http://localhost:5173 in your browser.
1. Navigate to the Cordova workspace
cd apps/mobile/cordova-mobile/2. Add the Android platform
cordova platform add android3. Compile target APK
cordova build android- The output APK will be generated at:
platforms/android/app/build/outputs/apk/debug/app-debug.apk
| Endpoint | Method | Description |
|---|---|---|
/products.php |
GET |
List all products with optional category/search filters |
/products.php |
POST / PUT / DELETE |
Admin product CRUD operations |
/orders.php |
GET |
Retrieve orders list |
/orders.php |
POST |
Place a new order with inventory deduction |
/users.php |
GET / POST |
User session management and login |
/sales.php |
GET |
Sales summary, revenue charts, and analytics KPIs |
/upload.php |
POST |
Admin product image file upload |
| Endpoint | Method | Description |
|---|---|---|
/auth/register |
POST |
Register a new user with bcrypt password hashing |
/auth/login |
POST |
Login and receive a signed JWT token |
/auth/google |
POST |
Verify Google token and return a JWT |
The relational database (hosted locally on MySQL) is structured as follows:
erDiagram
users {
int id PK
varchar name
varchar email UK
varchar password
varchar role
timestamp created_at
}
products {
varchar id PK
varchar name
decimal price
varchar category
text description
varchar image
int stock
float rating
int reviews
boolean is_new
json specs
timestamp created_at
timestamp updated_at
}
orders {
varchar id PK
varchar customer_name
varchar customer_email
varchar payment_method
varchar status
decimal subtotal
decimal shipping
decimal total
timestamp created_at
timestamp updated_at
}
order_items {
int id PK
varchar order_id FK
varchar product_id FK
varchar name
decimal price
int quantity
varchar image
}
feedback {
int id PK
varchar customer_name
varchar customer_email
int rating
text comment
timestamp created_at
}
users ||--o{ orders : "places"
orders ||--|{ order_items : "contains"
products ||--o{ order_items : "ordered_in"
.
βββ π apps/
β βββ π web/ # React 18 + Vite 6 + Tailwind 4 Frontend (β Local Host)
β β βββ π src/
β β β βββ π app/
β β β β βββ π components/ # UI Components (shadcn/ui + custom widgets)
β β β β βββ π context/ # React Contexts (AuthContext, CartContext, StoreContext)
β β β β βββ π hooks/ # Custom React hooks (useScrollReveal)
β β β β βββ π lib/ # API Client wrapper (api.ts)
β β β β βββ π pages/ # Route pages:
β β β β β βββ π Home.tsx
β β β β β βββ π Products.tsx
β β β β β βββ π ProductDetail.tsx
β β β β β βββ π Cart.tsx
β β β β β βββ π Checkout.tsx
β β β β β βββ π About.tsx
β β β β β βββ π Contact.tsx
β β β β β βββ π Login.tsx
β β β β β βββ π Admin.tsx
β β β β β βββ π Dashboard.tsx
β β β β β βββ π UserProfile.tsx
β β β β β βββ π UserOrders.tsx
β β β β β βββ π UserWishlist.tsx
β β β β β βββ π UserAddresses.tsx
β β β β β βββ π UserNotifications.tsx
β β β β β βββ π UserSecurity.tsx
β β β β β βββ π NotFound.tsx
β β β β βββ π App.tsx # Root app router provider
β β β β βββ π routes.tsx # Dynamic router configuration
β β β βββ π imports/ # Image assets, logo, QR code
β β β βββ π styles/ # Globals.css containing Tailwind utility theme config
β β β βββ π main.tsx # React bootstrap entry point
β β βββ π vite.config.ts # Vite 6 compiler and proxy settings
β β βββ π package.json
β β
β βββ π auth-server/ # Node.js + Express JWT Auth Server (β localhost:3001)
β β βββ π server.js # Express routes: /auth/register, /auth/login, /auth/google
β β βββ π db.js # MySQL2 connection pool
β β βββ π package.json
β β
β βββ βοΈ backend/
β β βββ π xontrix-backend/ # PHP / MySQL API Server Application (β Apache)
β β βββ π api/
β β β βββ π bootstrap.php # Global CORS and header setups
β β β βββ π config.php # MySQL database credentials & PDO wrapper
β β β βββ π install.php # Automatic table generation & dataset seeder
β β β βββ π orders.php # Order CRUD and inventory deduct actions
β β β βββ π products.php # Product catalog manager (CRUD API)
β β β βββ π sales.php # Sales analytics summary & dashboard events API
β β β βββ π schema.sql # Database schema structure dump
β β β βββ π upload.php # File upload handlers for admin products
β β β βββ π users.php # Session registration, login, and roles
β β βββ π README.md # Backend configuration instructions
β β
β βββ π± mobile/
β βββ π cordova-mobile/ # Apache Cordova Mobile wrapper configuration (β APK)
β βββ π config.xml # Cordova app configs (name, bundle id, permissions)
β βββ π www/ # Compiled static files folder for Cordova builds
β
βββ π docs/
β βββ π planning/ # Architecture designs, planning checklists
β βββ π screenshots/ # 18 showcase screenshots of all pages
β βββ π Attributions.md # Framework and asset attributions
β βββ π PRODUCTS.pdf # PDF documentation on electronic products
β βββ π README.md # Standard client setup guide
β βββ π task.md # AI sales feature implementation status
β βββ π TODO.md # Project QA checklists
β
βββ π pnpm-workspace.yaml # PNPM workspace configurations
βββ π pnpm-lock.yaml # Lockfile
βββ π README.md # You are here!
Xontrix organizes its electronic components catalog into 6 core product categories:
| Icon | Category Name | Description & Key Examples |
|---|---|---|
| π§ | Microcontrollers | Core processor units: Arduino Uno, ESP8266 NodeMCU, ESP32, Arduino Nano |
| π‘ | Sensors | Interaction modules: DHT11 Temp, MQ-2 Smoke, Ultrasonic HC-SR04, Soil Moisture |
| βοΈ | Actuators & Motors | Movement drivers: Stepper Motor, Servo Motor SG90, DC Gearbox Robot Motor |
| π‘οΈ | Shields & Modules | Expandable shield boards: Motor Driver L298N, RFID RC522, ESP8266 Expansion |
| π | Accessories & Cables | Prototype tools: Breadboard, Jumper Wires, 5V Regulator LM7805, Logic ICs |
| π | Power & Switches | Energy controllers: Rocker Switch 2-pin, 9V Battery Snap, Toggle buttons |
- Scaffolding monorepo layouts using PNPM workspaces
- Implementing React storefront components catalog
- Implementing PHP MySQL backend endpoints
- Adding Node.js/Express JWT authentication server
- Coding dynamic cart management cap-checked by available inventory
- Writing auto-deduct SQL orders transaction triggers
- Adding Firebase Google Auth SDK route configurations
- Adding Admin sales analytics charts and calendar views
- Designing strategic AI Advisor and user AI Consultant chatbot views
- Building full user account dashboard (profile, orders, wishlist, addresses, notifications, security)
- Building Cordova hybrid project configs to compile Android APK targets
- Integrating GCash and Maya real payment gateway merchant APIs
- Implementing real-time push notifications for delivery deadlines
- Setting up automated daily database backup scripts
- Adding multi-vendor admin access controls to
/adminroutes
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the repository
- Create your feature branch
git checkout -b feat/amazing-feature
- Commit your changes
git commit -m "feat: add amazing feature" - Push to the branch
git push origin feat/amazing-feature
- Open a Pull Request
This project follows Conventional Commits:
| Prefix | Description |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation changes |
style: |
Code style (formatting, no logic change) |
refactor: |
Code refactoring |
test: |
Adding or updating tests |
chore: |
Maintenance tasks |
|
Ghani Regina Gold San Luis Quality Assurance Engineer |
Cielle Mae PeΓ±amora Full-Stack Engineer |
Jayson Cris Mamaril Mobile Engineer |
This project is licensed under the MIT License β see the LICENSE file for details.
MIT License
Copyright (c) 2026 TechyElle | Ghani Regina Gold
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- React β The library for web user interfaces
- Vite β Next-generation frontend tooling
- Tailwind CSS β Utility-first CSS styling
- PHP β Fast, general-purpose scripting language
- MySQL β Relational database system
- Express β Fast, minimalist web framework for Node.js
- Apache Cordova β Mobile application development framework
- Firebase Auth β Google identity provider toolkit
- Recharts β Redefined chart library for React applications
- Lucide React β Clean community-designed SVG icons
- shadcn/ui β Premium accessible React component primitives
Built with π‘ for efficient electronics development

















