| | 1 | = ERModel |
| | 2 | |
| | 3 | == Diagram |
| | 4 | [[Image(ERDiagram_v1.png)]] |
| | 5 | |
| | 6 | == Data requirements |
| | 7 | === Entities |
| | 8 | **Users** – Entity that defines the users of the platform. |
| | 9 | * id – numeric type (primary key) |
| | 10 | * username – text type (required, unique) |
| | 11 | * password – text type (required) |
| | 12 | * email – text type (required, unique) |
| | 13 | |
| | 14 | **Admins** – Administrator profile. Inherits from Users. |
| | 15 | * user_id – numeric type (primary key, foreign key to Users) |
| | 16 | * Suggestion – Lets users to suggest components that they want to be added. |
| | 17 | * id – numeric type (primary key) |
| | 18 | * user_id – numeric type (foreign key to Users) |
| | 19 | * admin_id – numeric type (foreign key to Admins) |
| | 20 | * link – text type (required) |
| | 21 | * admin_comment – text type (optional) |
| | 22 | * description – text type (optional) |
| | 23 | * status – text type (required) |
| | 24 | * component type – text type (required) |
| | 25 | |
| | 26 | **Component** – Entity representing all hardware components. |
| | 27 | * id – numeric type (primary key) |
| | 28 | * name – text type (required) |
| | 29 | * brand – text type (required) |
| | 30 | * price – numeric type (required) |
| | 31 | * img_url – text type (optional) |
| | 32 | |
| | 33 | **CPU** – Entity detailing CPU components. Inherits from Component. |
| | 34 | * component_id – numeric type (primary & foreign key to Component) |
| | 35 | * socket – text type (required) |
| | 36 | * cores – numeric type (required) |
| | 37 | * threads – numeric type (required) |
| | 38 | * base_clock – numeric type (required) |
| | 39 | * boost_clock – numeric type (optional) |
| | 40 | * tdp – numeric type (required) |
| | 41 | |
| | 42 | **GPU** – Entity for graphics cards. Inherits from Component. |
| | 43 | * component_id – numeric type (primary & foreign key to Component) |
| | 44 | * vram – numeric type (required) |
| | 45 | * tdp – numeric type (required) |
| | 46 | * base_clock – numeric type (optional) |
| | 47 | * boost_clock – numeric type (optional) |
| | 48 | * chipset – text type (required) |
| | 49 | * length – numeric type (required) |
| | 50 | |
| | 51 | **Memory** – RAM modules. Inherits from Component. |
| | 52 | * component_id – numeric type (primary & foreign key to Component) |
| | 53 | * type – text type (required) |
| | 54 | * speed – numeric type (required) |
| | 55 | * capacity – numeric type (required) |
| | 56 | * modules – numeric type (required) |
| | 57 | |
| | 58 | **Power_Supply** – Power supply units. Inherits from Component. |
| | 59 | * component_id – numeric type (primary & foreign key to Component) |
| | 60 | * type – text type (required) |
| | 61 | * wattage – numeric type (required) |
| | 62 | * form_factor – text type (required) |
| | 63 | |
| | 64 | **Case** – Computer cases. Inherits from Component. |
| | 65 | * component_id – numeric type (primary & foreign key to Component) |
| | 66 | * cooler_max_height – numeric type (required) |
| | 67 | * gpu_max_length – numeric type (required) |
| | 68 | |
| | 69 | **Case_Storage_Form_Factors** – Supported storage form factors for a case. |
| | 70 | * case_id – numeric type (primary key & foreign key to Case) |
| | 71 | * form_factor – text type (primary key) |
| | 72 | |
| | 73 | **Case_PS_Form_Factors** – Supported Power Supply form factors for a case. |
| | 74 | * case_id – numeric type (primary key & foreign key to Case) |
| | 75 | * form_factor – text type (primary key) |
| | 76 | |
| | 77 | **Case_Mobo_Form_Factors** – Supported motherboard form factors for a case. |
| | 78 | * case_id – numeric type (primary key & foreign key to Case) |
| | 79 | * form_factor – text type (primary key) |
| | 80 | |
| | 81 | **Cooler** – CPU coolers. Inherits from Component. |
| | 82 | * component_id – numeric type (primary & foreign key to Component) |
| | 83 | * type – text type (required) |
| | 84 | * height – numeric type (required) |
| | 85 | * max_tdp_supported – numeric type (required) |
| | 86 | |
| | 87 | **Cooler_CPU_Sockets** – Supported CPU sockets for a cooler. |
| | 88 | * cooler_id – numeric type (primary key & foreign key to Cooler) |
| | 89 | * socket – text type (primary key) |
| | 90 | |
| | 91 | **Motherboard** – Motherboards. Inherits from Component. |
| | 92 | * component_id – numeric type (primary & foreign key to Component) |
| | 93 | * socket – text type (required) |
| | 94 | * chipset – text type (required) |
| | 95 | * form_factor – text type (required) |
| | 96 | * ram_type – text type (required) |
| | 97 | * num_ram_slots – numeric type (required) |
| | 98 | * max_ram_capacity – numeric type (required) |
| | 99 | |
| | 100 | **Storage** – Storage devices. Inherits from Component. |
| | 101 | * component_id – numeric type (primary & foreign key to Component) |
| | 102 | * type – text type (required) |
| | 103 | * capacity – numeric type (required) |
| | 104 | * form_factor – text type (required) |
| | 105 | |
| | 106 | **Memory_Card** – Memory card readers. Inherits from Component. |
| | 107 | * component_id – numeric type (primary & foreign key to Component) |
| | 108 | * num_slots – numeric type (required) |
| | 109 | * interface – text type (required) |
| | 110 | |
| | 111 | **Optical_Drive** – CD/DVD/Blu-Ray drives. Inherits from Component. |
| | 112 | * component_id – numeric type (primary & foreign key to Component) |
| | 113 | * form_factor – text type (required) |
| | 114 | * type – text type (required) |
| | 115 | * interface – text type (required) |
| | 116 | * write_speed – numeric type (required) |
| | 117 | * read_speed – numeric type (required) |
| | 118 | |
| | 119 | **Sound_Card** – Dedicated sound cards. Inherits from Component. |
| | 120 | * component_id – numeric type (primary & foreign key to Component) |
| | 121 | * sample_rate – numeric type (required) |
| | 122 | * bit_depth – numeric type (required) |
| | 123 | * chipset – text type (required) |
| | 124 | * interface – text type (required) |
| | 125 | |
| | 126 | **Sound_Card_Channels** – Supported channels for a sound card. |
| | 127 | * soundcard_id – numeric type (primary & foreign key to Sound_Card) |
| | 128 | * channel – text type (primary key) |
| | 129 | |
| | 130 | **Cables** – Computer cables. Inherits from Component. |
| | 131 | * component_id – numeric type (primary & foreign key to Component) |
| | 132 | * length_cm – numeric type (required) |
| | 133 | * type – text type (required) |
| | 134 | |
| | 135 | **Network_Adapter** – Wireless network adapters. Inherits from Component. |
| | 136 | * component_id – numeric type (primary & foreign key to Component) |
| | 137 | * wifi_version – text type (required) |
| | 138 | * interface – text type (required) |
| | 139 | * num_antennas – numeric type (required) |
| | 140 | |
| | 141 | **Network_Card** – Wired network cards. Inherits from Component. |
| | 142 | * component_id – numeric type (primary & foreign key to Component) |
| | 143 | * num_ports – numeric type (required) |
| | 144 | * speed – numeric type (required) |
| | 145 | * interface – text type (required) |
| | 146 | |
| | 147 | **Build** – Entity for user PC configurations. |
| | 148 | * id – numeric type (primary key) |
| | 149 | * user_id – numeric type (foreign key to Users) |
| | 150 | * name – text type (required) |
| | 151 | * created_at – date type (required) |
| | 152 | * description – text type (optional) |
| | 153 | * total_price – numeric type (required) |
| | 154 | * is_approved – boolean type (required) |
| | 155 | |
| | 156 | **Build_Component** – Components belonging to a configuration. |
| | 157 | * build_id – numeric type (primary key, foreign key to Build) |
| | 158 | * component_id – numeric type (primary key, foreign key to Component) |
| | 159 | |
| | 160 | **Favorite_Build** – User’s favorited configurations. |
| | 161 | * build_id – numeric type (primary key, foreign key to Build) |
| | 162 | * user_id – numeric type (primary key, foreign key to Users) |
| | 163 | |
| | 164 | **Rating_Build** – Ratings for PC builds. |
| | 165 | * build_id – numeric type (primary key, foreign key to Build) |
| | 166 | * user_id – numeric type (primary key, foreign key to Users) |
| | 167 | * value – numeric type (required) |
| | 168 | |
| | 169 | **Review** – User comments on a build. |
| | 170 | * id – numeric type (primary key) |
| | 171 | * build_id – numeric type (foreign key to Build) |
| | 172 | * user_id – numeric type (foreign key to Users) |
| | 173 | * content – text type (required) |
| | 174 | * created_at – text type (required) |
| | 175 | |
| | 176 | === Relations |
| | 177 | * **owns_build** – 1:N relationship between Users and Build, linking a user to their PC configurations. |
| | 178 | * **has_component** – N:M relationship between Build and Component, representing components included in a build. |
| | 179 | * **favorites** – N:M relationship between Users and Build, allowing users to favorite builds. |
| | 180 | * **rates** – N:M relationship between Users and Build, allowing users to give ratings (1–5). |
| | 181 | * **written_by** – 1:N relationship between Users and Review, linking users to their written reviews. |
| | 182 | * **reviews** – 1:N relationship between Build and Review, linking reviews to a specific build. |
| | 183 | * **submit** – 1:N relationship between Users and Suggestion, allowing users to suggest components. |
| | 184 | * **moderate** – 1:N relationship between Admins and Suggestion, allowing admins to approve or reject user suggestions. |