>

03/2023 ~ 06/2023

Chenmko Full-Stack Web Development

Website Development
Database Design
Frontend Development
Backend Development
Handed Off

Chenmko’s trilingual electronics website and admin dashboard. Visitors browse components by category and compare specifications, while staff manage products, specification fields, and website content.

Chenmko Full-Stack Web Development

Project Overview

To find an electronic component, customers can choose a category on the Chenmko website, compare specifications across models, and download a datasheet to check the details. The website is available in Traditional Chinese, English, and Japanese. Company staff use an admin dashboard to update the catalog, homepage banners, contact details, and company history.

Different types of components need different specifications. Staff choose which fields each category uses. When they add a product, the admin form shows the fields for that category, and the public catalog uses the same fields to display the specifications.

My Role

I turned the client’s designs into responsive pages with Bootstrap and developed the PHP backend. I designed the product and category data model and worked with the team to store field definitions, category settings, and product specifications separately. I connected the same settings to the admin form and the public product table.

Chenmko homepage

Choose a category and add a product

To list a new transient-voltage-suppression (TVS) diode, an administrator selects “TVS Diodes” in the dashboard and clicks “Add Product.” They can also use the sidebar to switch categories and see the products already listed in each one.

TVS Diodes product management table with Add Product and Edit Category Fields buttons on the right

The form shows the fields enabled for that category, including the model number, breakdown voltage, and a datasheet upload. Once the administrator enters the specifications, uploads the datasheet, and saves, customers can compare the new diode in the public TVS Diodes table. When editing the listing later, staff can keep the existing datasheet or replace it.

Product edit form with the model number, datasheet upload, and TVS diode specifications

Use the same category settings for the public table and admin form

Products in a category need the same columns so customers can compare them side by side. If each category had a separately maintained form and public table, every change would require two edits. If the two fell out of sync, staff might enter a value customers never see, or the site might show a column with no corresponding input.

I added switches under “Edit Category Fields” so staff can enable the fields they need. The form and public table use the same category ID to look up the enabled fields and their order. Both use field IDs to match the inputs to the saved specifications. For example, enabling breakdown voltage adds an input to the admin form and a corresponding column to the public table.

Category field settings with switches that control which TVS diode specifications are shown

Trade-off

One setting keeps the two views in sync and applies to every product in the category. If staff enable a field that older products have no value for, the public table shows a blank cell until someone fills it in.

Store field definitions, category settings, and specification values separately

Chenmko ER diagram showing products, categories, field definitions, and two linking tables on the left, with tables for company information, banners, history, and login verification on the right
Start with the two linking tables on the left. cols_configs determines which fields each category uses, and products_col_link stores the values entered for each product.

Categories can share fields such as model number and datasheet while still requiring different electrical specifications. I separated the core product record from its variable specifications. Staff can change which existing fields a category uses without changing the structure of the product table.

  • category stores the category hierarchy, and products stores each product ID and its category.
  • cols_html stores field IDs, display markup, and the value type used for sorting. More than one category can use the same field definition.
  • cols_configs uses the category ID and field ID to record whether a field is enabled and where it appears.
  • products_col_link uses the product ID and field ID to store values such as model numbers, voltages, and datasheet file paths.

Assemble the public specification table

The public page reads the category’s enabled fields and builds a query from them. It uses an INNER JOIN to retrieve specification values, GROUP BY to group them by product ID, and MAX(CASE …) to turn the separate values into columns on one product row. The category view supports column sorting and shows up to 50 products per page. A model-number search can span categories, with results shown in each category’s own columns.

Trade-off

Categories can reuse fields, and staff can change which fields appear through configuration. Queries need extra joins and aggregation, and sorting takes more work when values are stored as text. For numeric specifications, the query uses SUBSTRING to extract the number, casts it to a numeric value, and then applies ORDER BY. New specification formats need to be checked against that extraction rule.

Other admin tables

Company information, homepage banners, company history, and login verification each use a separate table. They are company, banner, company_history, and backend_psw_config.

Manage homepage banners

Slide 0
Slide 1

Staff can review the images in the homepage carousel, upload a new banner, or remove one they no longer use.

Update contact details and where they appear

Staff can edit core company and contact information. Bootstrap switches on each entry control whether it appears on the contact page and in the footer independently.

Company information settings with editable contact details and separate switches for the contact page and footer

Edit the company history

Staff can edit and format the company history using the CKEditor toolbar, then save the updated page.

Company history editor with the CKEditor rich-text toolbar

Tech Stack

Bootstrap

Responsive page layouts and the admin interface

PHP

A framework-free admin backend and product queries to meet the client’s handover requirements

Relational database

Stores products, category field settings, and per-product specifications for lookup and sorting

CKEditor

Rich-text editing for the company history page