-
-
Notifications
You must be signed in to change notification settings - Fork 52
Minor tweaks in README, others #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
d81cf93
ab97735
73d3d65
1a6e724
df5fa02
77a78c2
72c835d
44dfb23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# LCSC API | ||
|
||
- to get a product page based on LCSC number use GET request on | ||
1. To get a product page based on LCSC number, use GET request on | ||
`https://lcsc.com/api/global/additional/search?q=<part_number>`. You get a | ||
JSON with URL of the product. | ||
- to get a product options based on LSCS number use POST request to | ||
2. To get a product options based on LSCS number, use POST request to | ||
`https://lcsc.com/api/products/search` with data | ||
`current_page=1&in_stock=false&is_RoHS=false&show_icon=false&search_content=<part_number>` | ||
`current_page=1&in_stock=false&is_RoHS=false&show_icon=false&search_content=<part_number>`. | ||
You have to include CSRF token and cookies. Both you can get from the category | ||
page (e.g., `https://lcsc.com/products/Pre-ordered-Products_11171.html`) | ||
page (e.g., `https://lcsc.com/products/Pre-ordered-Products_11171.html`). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
 | ||
|
||
# JLC PCB SMD Assembly Component Catalogue | ||
# JLCPCB SMD Assembly Component Catalogue | ||
|
||
A better tool to browse the components offered by the [JLC PCB SMT Assembly | ||
A better tool to browse the components offered by the [JLCPCB SMT Assembly | ||
Service](https://jlcpcb.com/smt-assembly). | ||
|
||
## How To Use It? | ||
|
||
Just visit: [https://yaqwsx.github.io/jlcparts/](https://yaqwsx.github.io/jlcparts/) | ||
|
||
The site and parts cache is hosted on GitHub Pages. | ||
|
||
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment makes no logical sense here. This is the first information the user (e.g., electrical engineer) sees when using this project. Why should they care about the internal implementation details of the project? This just clutters the text for them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should factor the whole There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that having a separate dev section is a good direction. |
||
## Why? | ||
|
||
Probably all of us love JLC PCB SMT assembly service. It is easy to use, cheap | ||
Probably all of us love JLCPCB SMT assembly service. It is easy to use, cheap | ||
and fast. However, you can use only components from [their | ||
catalogue](https://jlcpcb.com/parts). This is not as bad, since the library is | ||
quite broad. However, the library UI sucks. You can only browse the categories, | ||
do full-text search. You cannot do parametric search nor sort by property. | ||
quite broad. However, the library UI sucks. You can only browse the categories and do full-text searches. You cannot do parametric search nor sort by property. | ||
|
||
That's why I created a simple page which presents the catalogue in much nicer | ||
form. You can: | ||
- do full-text search | ||
- browse categories | ||
- parametric search | ||
- sort by any component attribute | ||
- sort by price based on quantity | ||
- easily access datasheet and LCSC product page. | ||
- easily access datasheet and LCSC product page | ||
|
||
## Do You Enjoy It? Does It Make Your Life Easier? | ||
|
||
|
@@ -32,30 +34,30 @@ form. You can: | |
Support on Ko-Fi allows me to develop such tools as this one and perform | ||
hardware-related experiments. | ||
|
||
## How Does It Look Like? | ||
## What Does It Look Like? | ||
|
||
Title page | ||
### Title Page | ||
|
||
 | ||
|
||
Property filter | ||
### Property Filter | ||
|
||
 | ||
|
||
Component detail | ||
### Component Detail | ||
|
||
 | ||
|
||
|
||
## How Does It Work? | ||
|
||
The page has no backend so it can be easily hosted on GitHub Pages. Therefore, | ||
Travis CI download XLS spreadsheet from the JLC PCB page, a Python script | ||
process it and it generates per-category JSON file with components. | ||
The page has no backend so it can be easily hosted on GitHub Pages. | ||
Travis CI downloads the XLSX spreadsheet from the JLCPCB page, a Python script | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we're updating the docs, it is worth it to change Travis to GH Action we use. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. That's why I made the change. This is the only instance of Travis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I probably explained myself wrongly; the original wording is out-dated. We no longer use Travis CI, we use GH Actions. However, even after your update, you say we use Travis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, thank you. Fixed. |
||
processes it, and it generates a per-category JSON file with components. | ||
|
||
The frontend uses IndexedDB in the browser to store the component library and | ||
perform queries on it. Therefore, before the first use, you have to download the | ||
component library and it can take a while. Then, all the queries are performed | ||
perform queries on it. Therefore, before the first use, the page downloads the | ||
component library (it can take a while). Then, all the queries are performed | ||
locally. | ||
|
||
## Development | ||
|
@@ -64,40 +66,43 @@ To get started with developing the frontend, you will need NodeJS & Python 3. | |
|
||
Set up the Python portion of the program by running: | ||
|
||
``` | ||
```bash | ||
$ virtualenv venv | ||
$ source venv/bin/activate | ||
$ pip install -e . | ||
``` | ||
|
||
Then to download the cached parts list and process it, run: | ||
Then to download the cached parts list (from the GH Pages site, generated via GH Actions) and process it, run: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I find this extra information rather confusing - like I can see it is downloaded from the GH pages from the URL. And GH pages are in 99+% generated in GH actions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GH Pages are not in 99% of GH Actions. GH Actions generally run unit tests. I know that you think it's obvious. I'm an experienced dev, and I did not think it's obvious, hence why I spent my weekend updating these docs. If you think that it's that obvious that I'm the only person who could get confused on this, feel free to request that I revert this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You misinterpreted my saying (and inverted the implication):
What I dislike is "random pieces of information" scattered across the documentation. If you want to improve something, there should be "architecture overview" that captures the high-level design. It shouldn't pollute step-by-step instruction that the user is expected to just follow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Propose a solution. Tell me what you want. We agree on the problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I said in another thread - a new document describing the overall architecture. But building such a document is currently out of my time scope. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's out of your timescope, can you just accept this change, and I'll split it out into a separate file later? |
||
|
||
``` | ||
```bash | ||
$ wget https://yaqwsx.github.io/jlcparts/data/cache.zip https://yaqwsx.github.io/jlcparts/data/cache.z0{1..8} | ||
$ 7z x cache.zip | ||
$ mkdir -p web/public/data/ | ||
$ jlcparts buildtables --jobs 0 --ignoreoldstock 30 cache.sqlite3 web/public/data | ||
``` | ||
|
||
To understand how the GH Actions generate the cache zip file, refer to the | ||
[update_components.yaml workflow](.github/workflows/update_components.yaml). | ||
|
||
To launch the frontend web server, run: | ||
|
||
``` | ||
```bash | ||
$ cd web | ||
$ npm install | ||
$ npm start | ||
``` | ||
|
||
## The Page Is Broken! | ||
## Reporting Issues | ||
DeflateAwning marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Feel free to open an issue on GitHub. | ||
If the page is broken, feel free to open an issue on GitHub. | ||
|
||
## You Might Also Be Interested | ||
## Related Projects | ||
|
||
- [KiKit](https://github.com/yaqwsx/KiKit): a tool for automatic panelization of | ||
KiCAD PCBs. It can also perform fully automatic export of manufacturing data | ||
for JLC PCB assembly - read [the | ||
for JLCPCB assembly - read [the | ||
documentation](https://github.com/yaqwsx/KiKit/blob/master/doc/fabrication/jlcpcb.md) | ||
or produce a solder-paste stencil for populating components missing at JLC PCB - read [the | ||
or produce a solder-paste stencil for populating components missing at JLCPCB - read [the | ||
documentation](https://github.com/yaqwsx/KiKit/blob/master/doc/stencil.md). | ||
- [PcbDraw](https://github.com/yaqwsx/PcbDraw): a tool for making nice schematic | ||
drawings of your boards and population manuals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for making this numeric list? There isn't a clear sequence "first this and then this". The bullets serve as a clear graphical division between two parts of the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numerical lists allow for discussion among teams better, which is important for software like this which may be prone to forking/external use. Either a short subheading or ordered list is most appropriate here, in my opinion.
Am happy to revert the list type change, if requested.