Skip to content

Commit df93823

Browse files
authored
Merge pull request #64 from csfloat/feature/readme
Update Readme
2 parents 9b68a36 + 60e84b4 commit df93823

2 files changed

Lines changed: 65 additions & 1 deletion

File tree

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
1-
# Reverse.Watch
1+
# [reverse.watch](https://reverse.watch)
2+
3+
Community-driven open trade reversal tracking database for Steam. Participating entities can report trade reverals to the open database.
4+
5+
## Interested in Participating?
6+
7+
If you're looking to participate by contributing reversal reports (i.e. marketplace, trading tool, community site, etc...), reach out at **join@reverse.watch**.
8+
9+
## Running Locally
10+
11+
1. Ensure Go 1.24+ and PostgreSQL are installed.
12+
2. Copy the config template and fill in your local database credentials:
13+
```bash
14+
cp config.example.json config.json
15+
```
16+
3. Run the service:
17+
```bash
18+
go run main.go
19+
```
20+
21+
The server starts on port `80` by default (configurable via `HTTP_PORT`).
22+
23+
## Configuration
24+
25+
Configuration is loaded from environment variables or a `config.json` file.
26+
27+
## Authentication
28+
29+
All entity endpoints require a Bearer token in the `Authorization` header:
30+
31+
```
32+
Authorization: Bearer reversewatch_live_xxxxxxxx...
33+
```
34+
35+
API keys are scoped to an entity and carry a permission bitfield. Keys are prefixed with `reversewatch_live_` (production) or `reversewatch_test_` (development).
36+
37+
### Permissions
38+
39+
| Permission | Description |
40+
|---|---|
41+
| `admin` | Full administrative access (Service operator only) |
42+
| `manage` | Manage API keys for own entity |
43+
| `write` | Create reversal reports |
44+
| `delete` | Expunge reversal reports for own entity |
45+
| `read` | Read access |
46+
| `export` | List and export reversal data |
47+
48+
## Rate Limiting
49+
50+
Rate limits are enforced in-memory per process. Throttled responses return `429 Too Many Requests` with `X-RateLimit-*` and `Retry-After` headers.

config.example.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"Database": {
3+
"Host": "localhost",
4+
"Port": "5432",
5+
"User": "postgres",
6+
"Password": "postgres",
7+
"PrivateDBName": "private",
8+
"PublicDBName": "public"
9+
},
10+
"HTTP": {
11+
"Port": "3434",
12+
"AllowedOrigins": ["allowed-origin-1", "allowed-origin-2"]
13+
},
14+
"Environment": "development"
15+
}

0 commit comments

Comments
 (0)