REST API service to store and track changes of steam user's dota 2 inventory items.
- Inventory history - created, updated, deleted items
- Rate limiter
- Unit tests
Swagger OpenAPI 3 is available by path:
- UI:
host:port/swagger-ui.html
- JSON:
host:port/api-docs
- Show Inventories:
GET /api/v1/inventories
- Search Inventories (paginated):
GET /api/v1/inventories/search-page
- Create an Inventory (load items from steam):
POST /api/v1/inventories/:steamid
- Show an Inventory:
GET /api/v1/inventories/:steamid
- Update an Inventory (reload items from steam):
PUT /api/v1/inventories/:steamid
- Delete an Inventory:
DELETE /api/v1/inventories/:steamid
- Search Inventory Items (filter with large payloads):
POST /api/v1/inventories/:steamid/items/search
- Search Inventory Items (paginated; filter with large payloads):
POST /api/v1/inventories/:steamid/items/search-page
- Show Inventory Items (positioned pagination):
GET /api/v1/inventories/:steamid/items/page-positioned
- Show Inventory Items 'defIndex' fields:
GET /api/v1/inventories/:steamId/items/def-indexes
- Show Inventory Items changes:
GET /api/v1/inventories/:steamid/changes/:version
- Search Operations (paginated):
GET /api/v1/inventories/:steamid/operations/search-page
- Java 21
- Apache Maven
- MongoDB 8.0
- Create
.env
based on.env.example
- Create
environment.properties
based onenvironment.properties.example
inapp/src/main/resources
- Set the steam api key property to access Steam's API:
env.steam.api.key=your_api_key
- To run in development environment.
You can use a default build for IntelliJ IDEA to run the app -
.run/dev-build.run.xml
.docker-compose up
- To run in production environment
docker compose -f docker-compose.prod.yml up -d
Conceptual entity relation diagram (Barker's system):
Assumptions:
- Average inventory item size - 500 bytes.
- Average user has 5000 inventory items.
- Users update inventory once per day. Each day it increased by some small coefficient (0.05).
- Data is stored for a year.
Estimate:
- User inventory size: 500 B * 5000 = 2.5 MB
- User inventory size for a year: 2.5 MB + (365 * 0.05 * 2.5 MB) = ~50 MB
- Storage for 100K users: 50MB * 100000 = ~5 TB
Download & install libssl1.1 latest version:
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
The GNU General Public License v3.0. Please see License File for more information.