Easy to use query based search engine for JLCPCB SMT service.
Try out the live demo at jlcdb-web.onrender.com
Live demo web service and database updater application is hosted on Render.com using Web Service and Cron Job configurations. A serverless MongoDB instance is used from MongoDB Cloud
JLCDB is a simple query based component search engine for JLCPCB SMT parts library. This project is aimed for ease of use by avoiding complicated tables and filters that occur in such web pages but instead using a query based search system. Repository consists of two projects including a Csv Parser and a Web Server.
Csv Parser application fetches latest CSV file and updates the MongoDB instance using the parsed values from component descriptions. File is updated approximately once a week so it is suitable to use a cronjob to run this application as in the demo application. Demo application uses render.com CronJob service.
Web server simply creates a websocket connection with react client for processing queries and building a MongoDB filter which then passed to a MongoDB instance. Additional table sorting and filtering can be done in the react application. Live demo deployment uses Web Service configuration from render.com
Serverless MongoDB instance is used from MongoDB Cloud
- Simple and responsive interface
- Easy to use query based search
- Autocompletion of possible categories and component features
- Downloading results as CSV file
- Table sorting and filtering
- Automatic updating of parts database
Self contained production builds can be produced using the provided docker images. These images can directly be used in a cloud provider such as Render.com
Development containers also exist in the root directory for use with Vscode Dev Containers. Devcontainers include a MongoDB container
Docker images do not require any external dependencies other than Docker itself.
- Iconv (Included with Macos/Linux distributions)
- .NET Core 6.0
- .NET Core 6.0
- NodeJS 16.x LTS (Not needed at runtime)
# Restore packages
dotnet restore
# Build
dotnet build
# Run
dotnet run
Deployment to various cloud providers such as Render.com can easily be done by using the images located in the root directory. A MongoDB instance is required.
Make sure to pass the required enviroment variables while deploying images.
Context directory must be specified root directory and Dockerfile name should be provided e.g: Dockerfile.Web
CSV Parser
Variable | Description | Type |
---|---|---|
Database__ConnectionString | MongoDB connection string. Compressors are automatically added in the code. | string |
Database__Name | Name of the database to write the records. | string |
UseLocalDownload (optional) | Use locally downloaded csv file during development. CSV must be placed in the CSVParser project directory. | true | false |
Web Service
Variable | Description | Type |
---|---|---|
Database__ConnectionString | MongoDB connection string. Compressors are automatically added in the code. | string |
Database__Name | Name of the database to write the records. | string |
dotnet publish
command can be used a create a production build.
dotnet publish ./Web/Web.csproj -c Release
Application executable and all runtime dependencies will be included in the bin/Release/net6.0/publish
folder.
Set enviroment variables and run the application.
export Database__ConnectionString="" && export Database__Name="data" && ./Web/bin/Release/net6.0/publish/Web
-
Build the image
docker build -t JLCDB/Web -f Dockerfile.Web
-
Create and run a container
docker run -it --name jlcdb-web-server -e Database__ConnectionString="mongodb://root:[email protected]:27017/admin?authSource=admin" -e Database__Name="data" -p 80:80 JLCDB/Web
- Query syntax highlighting and validation
- Implement more category parsers
- Full text description filtering with regex
- Parse price ranges and display an estimated price calculator
- In stock filter
- Save queries
- Filter impossible queries in server
- Individual part information request
- Price estimation of component cart
This project is licensed under the MIT License - see the LICENSE file for details.