|
1 | | - |
| 1 | +# buildcores-open-db-cn |
2 | 2 |
|
3 | | -# BuildCores OpenDB |
4 | | - |
5 | | -A community-driven open database for PC components. This repository contains structured data about computer hardware components that can be used for compatibility checking, component research, and building PC builder / part picking apps. |
| 3 | +China-oriented PC components product facts repository. |
6 | 4 |
|
7 | | -*For an easy way to browse and search all components in a user-friendly interface, you can visit:* |
8 | | -https://buildcores.com/products |
| 5 | +This repository keeps two product-fact sources side by side: |
9 | 6 |
|
10 | | -*You can click on the 'Edit in OpenDB' button on each part to open the GitHub page for it* |
| 7 | +1. `open-db-upstream/open-db/` - upstream BuildCores OpenDB (nested submodule) |
| 8 | +2. `open-db-cn/` - China market incremental product facts (reviewed additions) |
11 | 9 |
|
12 | | - |
| 10 | +The union of these two directories is the effective CN product-facts view. |
13 | 11 |
|
14 | | -## Help Wanted / Bounties |
| 12 | +## Repository Layout |
15 | 13 |
|
16 | | -We have a few near-term goals for this project to improve data quality and increase the utility of BuildCores (or any other project that relies on this data). |
| 14 | +- `open-db-upstream/` - nested git submodule tracking `buildcores/buildcores-open-db` |
| 15 | +- `open-db-cn/` - CN incremental facts (same category-style layout) |
| 16 | +- `schemas/` - schema definitions |
| 17 | +- `tools/build_product_facts.py` - builds combined index from upstream + CN layers |
| 18 | +- `viewer/` - static viewer for generated index |
17 | 19 |
|
18 | | -- We want to collect manufacturer product page urls for each product in our database. |
19 | | -- We want to collect PDFs for each product in our database. |
20 | | - - Good examples are motherboard and case manuals. We can extract useful information out of these. |
21 | | -- We want to collect motherboard BIOS versioning data along with CPU support lists. |
22 | | -- We want to expand our retailer coverage outside of the USA. |
23 | | -- ... more to come. If you have any specific requests from this project, please open a GitHub issue. |
24 | | - |
| 20 | +## Key Rules |
25 | 21 |
|
26 | | -## Repository Structure |
| 22 | +- No retail prices, promotions, or inventory in product facts. |
| 23 | +- Every real product must map to one stable `product_id` in downstream identity mapping. |
| 24 | +- CN incremental facts must keep source evidence and pass review before promotion. |
27 | 25 |
|
28 | | -- `/open-db/` - Contains component data organized by category (CPU, GPU, RAM, etc.) |
29 | | -- `/schemas/` - JSON schemas that define the structure and validation rules for each component type |
30 | | -- `/docs/` - Documentation for contributors |
31 | | -- `/.github/workflows/` - Workflows to validate schemas and sync with our internal API |
| 26 | +## Upstream Update Strategy (Changed) |
32 | 27 |
|
33 | | -## How to Use |
| 28 | +This repo no longer merges upstream directly into `main`. |
34 | 29 |
|
35 | | -### Accessing Component Data |
| 30 | +Use nested submodule updates instead: |
36 | 31 |
|
37 | | -All component data is stored in the `/open-db/` directory, organized by component category. Each component is stored as a separate JSON file with a UUID v4 filename. |
38 | | - |
39 | | -``` |
40 | | -/open-db/ |
41 | | - /CPU/ |
42 | | - e0230286-0549-4da9-8115-9d1fbdcc2979.json |
43 | | - ... |
44 | | - /GPU/ |
45 | | - ... |
46 | | - /RAM/ |
47 | | - ... |
| 32 | +```bash |
| 33 | +./scripts/sync_upstream.sh |
48 | 34 | ``` |
49 | 35 |
|
50 | | -Each product page on the BuildCores website has an "Edit on GitHub" button that allows you to directly contribute changes to the specific component, making it easy to update or fix information. |
51 | | - |
52 | | -### Data Structure |
53 | | - |
54 | | -Each component follows a standard JSON structure defined by its corresponding schema in the `/schemas/` directory. For example, a CPU component contains information about: |
55 | | - |
56 | | -- Core counts and threading |
57 | | -- Clock speeds |
58 | | -- Cache sizes |
59 | | -- Socket type |
60 | | -- TDP |
61 | | -- Integrated graphics (if applicable) |
62 | | -- Retailer SKUs |
63 | | - |
64 | | -### Product Variants |
65 | | - |
66 | | -Many products come in multiple variants (e.g., different colors, speeds, or editions). These are grouped together using the `metadata` fields: |
67 | | - |
68 | | -- `metadata.manufacturer` - The company that makes the product |
69 | | -- `metadata.series` - The product line/series name |
70 | | -- `metadata.variant` - What distinguishes this specific variant |
71 | | - |
72 | | -For detailed guidance on adding variants, see [docs/VARIANTS.md](docs/VARIANTS.md). |
73 | | - |
74 | | -## How to Contribute |
75 | | - |
76 | | -### Adding or Updating Components |
| 36 | +This updates the pointer of `open-db-upstream` to latest upstream commit. |
77 | 37 |
|
78 | | -1. **Fork the repository** and create a new branch for your changes |
79 | | -2. **Add or modify component JSON files** in the appropriate category directory |
80 | | - - For new components, create a new JSON file with a UUID v4 filename and include this same UUID in the `opendb_id` field |
81 | | - - For existing components, modify the component's JSON file |
82 | | -3. **Validate your changes** against the appropriate schema |
83 | | -4. **Submit a pull request** with your changes |
| 38 | +## Build Product Facts Index |
84 | 39 |
|
85 | | -### PR Validation |
86 | | - |
87 | | -When you submit a pull request, GitHub Actions will automatically: |
88 | | -1. Validate your JSON files against the appropriate schemas |
89 | | -2. Post validation results as a comment on your PR |
90 | | -3. Block merging if validation fails |
91 | | - |
92 | | -### After Merge |
93 | | - |
94 | | -When changes are merged to the main branch, they are automatically synchronized with the BuildCores API: |
95 | | -- New components are created in the database |
96 | | -- Modified components are updated |
97 | | -- Deleted components are removed |
98 | | - |
99 | | -### Component Requirements |
100 | | - |
101 | | -- All components must follow the schema for their category |
102 | | -- Required fields vary by component type (check the schema) |
103 | | -- When possible, include retailer SKUs and manufacturer information |
104 | | - |
105 | | -## Limitations |
106 | | -We cannot provide price data or retailer-specific data due to restrictions. |
107 | | - |
108 | | -## License |
109 | | - |
110 | | -This database is made available under the Open Data Commons Attribution License (ODC-By) v1.0. |
111 | | - |
112 | | -You are free: |
| 40 | +```bash |
| 41 | +python tools/build_product_facts.py |
| 42 | +``` |
113 | 43 |
|
114 | | -- To share: To copy, distribute and use the database. |
115 | | -- To create: To produce works from the database. |
116 | | -- To adapt: To modify, transform and build upon the database. |
| 44 | +Output: |
117 | 45 |
|
118 | | -As long as you: |
| 46 | +- `dist/product_facts/index.json` |
| 47 | +- `dist/product_facts/index.csv` |
| 48 | +- `dist/product_facts/stats.json` |
119 | 49 |
|
120 | | -- Attribute: You must attribute any public use of the database, or works produced from the database, in the manner specified in the license. For any use or redistribution of the database, or works produced from it, you must make clear to others the license of the database and keep intact any notices on the original database. |
| 50 | +## Viewer |
121 | 51 |
|
122 | | -For more information, see [opendatacommons.org/licenses/by/1-0](https://opendatacommons.org/licenses/by/1-0/). |
| 52 | +```bash |
| 53 | +python -m http.server 8000 |
| 54 | +# open http://localhost:8000/viewer/ |
| 55 | +``` |
0 commit comments