Create a Node.js application that connects to the Backpack.tf WebSocket service and gathers listing data. It then stores this data in a CockroachDB database ensuring the information remains up-to-date. This project is ideal for custom pricers that require real-time listing updates, this project is heavily inspired by backpack.tf-ws-service, but with a CockroachDB database instead of MongoDB and TypeScript(typescript supremacy).
This is a table of contents for your project. It helps the reader navigate through the README quickly.
- Project Title
- Table of Contents
- Important Notes
- Features
- Requirements
- Installation
- Usage
- Issues
- Contribute
- License
- This project is not affiliated with Backpack.tf.
- The Backpack.tf WebSocket service is a premium feature and requires a subscription to access.
- This project is under development and may contain bugs.
- Contact me in Discord if you have any questions:
amayacrab
- For more information about the Backpack.tf WebSocket service, visit the official documentation.
- For now the custom pricer is not implemented, but it will be soon.
- The project has a problem with creating too many connections to the database, I'm working on a solution.
- Real-time listing updates via Backpack.tf's WebSocket service.
- Secure storage of listings in a CockroachDB database.
- Prioritization of specific items for more frequent price updates (ideal for custom pricers).
- Node.js v16 or later
- Running CockroachDB instance
- Backpack.tf API token
-
Clone the repository:
git clone https://github.com/LucasHenriqueDiniz/backpacktf-ws-service-cockroach-db.git
-
Automated Installation:
run initial.bat
-
Manual Installation:
npm install
-
Environment Variables:
Create a
.env
file in the root directory and add the following variables:WEBSOCKET_URL="wss://ws-backpack.tf/ws" DATABASE_URL="postgresql://username:password@localhost:26257/database_name?sslmode=disable" BPTF_TOKEN="YOUR_BPTF_TOKEN"
optional:
PRIORITY_ITEMS="item1,item2,item3"
-
Initialize Prisma the Database:
npx prisma db push
-
Migrate the Database:
npx prisma migrate dev
-
Start the Application:
npm start
-
Start the Application:
npm start
-
View the Logs: The application logs can be viewed in the console or in a log file.
-
Custom Pricer: (SOON) To prioritize specific items for more frequent price updates, add the item names to the
PRIORITY_ITEMS
environment variable. -
View the Database (optional): The database can be accessed using a GUI tool like DBeaver or TablePlus.
If you encounter any issues, please open an issue in the issues tab.
Contributions are always welcome! Please create a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.