PriceTracker is a tool for tracking prices on various online stores and monitoring the price fluctuations of products over time.
This repository also includes integrations with stores Pingo Doce and Worten, communicating via RabbitMQ.
The RabbitMQ integration is utilized for the PriceTracker catalog service to receive product updates and store registrations.
The catalog service persists store and product information using PostgreSQL.
- Features
- Installation
- Build and Usage
- Development
- RabbitMQ Integration
- PostgreSQL Integration
- Contributing
- License
- Store Price Tracking: Monitor prices from Pingo Doce and Worten.
- Product History: View historical price data to identify trends.
- RabbitMQ Integration: Communicate with the PriceTracker catalog for product updates and store registration.
- PostgreSQL Integration: Persist store and product information.
- RabbitMQ server running
- PostgreSQL database running
Both of this applications can be run containerized for development purposes by
using the included docker-compose.yaml
.
make build
To compile for a specific platform, use the following syntax:
make build system=linux arch=amd64
All compiled binaries will be stored in the dist
directory.
-
Build the Project:
In order to build the catalog and stores, ensure you have Golang 1.21 or later installed.
To build for all more common platforms run:
make build
If you which to target only one platform you can do it like so:
make build system=linux arch=amd64
All compiled binaries will be stored in the
dist/$system_$arch
directory. -
Configure Catalog:
Adapt the
config.yaml
file in thedist/$system_$arch/catalog
directory to have the correct credentials for both RabbitMQ and PostgreSQL. If you are using the includeddocker-compose.yaml
file, you can leave it as is. -
Run Catalog:
Execute the catalog:
./dist/$system_$arch/catalog
-
Configure Stores:
Go to the desired store directories (e.g.,
pingodoce
,worten
) and ensure the configurations in theconfig.yaml
file for the RabbitMQ connection match the ones used in thecatalog
. -
Run Stores:
Execute the stores from their respective directories:
./dist/$system_$arch/store/pingodoce/pingodoce
./dist/$system_$arch/store/worten/worten
-
Access Catalog Frontend:
The
catalog
frontend is accessible on port8080
.Open your web browser and navigate to http://localhost:8080 to access the catalog frontend.
Note: Ensure that RabbitMQ and PostgreSQL are running and correctly configured.
-
Go to the catalog directory:
cd dist/$system_$arch/catalog
-
Create and execute docker containers:
docker-compose up
-
Install dev_dependencies:
make dev_dependencies
-
Ensure Golang's bin directory is in your
$PATH
. -
Run using
air
for code hot-reloading:make run
-
Ensure the catalog is running.
-
Run the store like any other Golang application:
go run main.go
The RabbitMQ integration is crucial for the PriceTracker catalog service. It facilitates communication for receiving product updates and store registrations. Ensure the RabbitMQ server is running and correctly configured. Update the config.yaml
file in the catalog
directory with the RabbitMQ connection details.
The catalog service uses PostgreSQL to persist store and product information. Make sure the PostgreSQL database is running and properly configured. Update the config.yaml
file in the catalog
directory with the PostgreSQL connection details.
If you'd like to contribute to PriceTracker, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and submit a pull request.
- Provide a detailed description of your changes.
This project is licensed under the GNU General Public License (GPL).