Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0e222eb
Bump dependencies
JensForstmann Sep 26, 2024
b25281e
Fix whitespace in docs
JensForstmann Oct 4, 2024
ad43aed
Fix copy to clipboard not working for match share link
JensForstmann Oct 6, 2024
125ae33
Improve (rcon and log) connections between game server and TMT, espec…
JensForstmann Oct 6, 2024
5bf3f8e
Add workaround for CS2 getting stuck after loading round backup
JensForstmann Oct 6, 2024
a2711a1
Add explanation to game server page
JensForstmann Oct 6, 2024
dba9e77
Bump dependencies
JensForstmann Oct 6, 2024
d019727
Use node+tini instead of npm in Dockerfile
JensForstmann Oct 6, 2024
2f26bd5
Add connection details to game server page
JensForstmann Oct 7, 2024
6d2010d
Make presets usable for logged in or all users (configurable per preset)
JensForstmann Oct 7, 2024
8d5ddae
Update 2on2 wingman default preset (active duty map pool & election s…
JensForstmann Oct 7, 2024
b6e2ea7
Remove unused code
JensForstmann Oct 7, 2024
a869323
Fix issue that matches are not supervised after restarting TMT
JensForstmann Oct 7, 2024
a603e14
Fix redirect from edit match page back to match page
JensForstmann Oct 7, 2024
21ca728
Improve usability for anonymous users
JensForstmann Oct 7, 2024
fcda563
Improve dev container
JensForstmann Oct 7, 2024
86f01e2
Add docker compose file
JensForstmann Oct 7, 2024
68e597d
Fix invalid swagger definition
JensForstmann Oct 7, 2024
195f887
Tag docker container with a correct semver version (2.9.0, 2.9, 2 ins…
JensForstmann Oct 8, 2024
0ddb7f8
Re-add previous docker tag schema with leading "v" for backwards comp…
JensForstmann Oct 8, 2024
68acb68
Bump docker actions
JensForstmann Oct 8, 2024
472d1a5
Update docker tag order to set deprecated v2 to the end (on the docke…
JensForstmann Oct 8, 2024
70dc027
Reconfigure prettier
JensForstmann Oct 8, 2024
daadd5d
Bump dependencies
JensForstmann Oct 9, 2024
2c3bd3b
Add documentation to match update properties
JensForstmann Oct 9, 2024
73e5115
Add game server crash detection to automatically execute rcon init co…
JensForstmann Oct 9, 2024
218ac9d
Remove color codes from logs
JensForstmann Oct 9, 2024
145dca6
Bake TMT version and build timestamp into docker container
JensForstmann Oct 9, 2024
c803921
Add possibility to force players by their steam ids into a specific t…
JensForstmann Oct 11, 2024
ce35afc
Fix typo
JensForstmann Oct 11, 2024
0bf0a8b
Bump dependencies
JensForstmann Oct 11, 2024
f5499b9
Don't write error message in chat if players try to join the team the…
JensForstmann Oct 12, 2024
4a781f9
Change managed_game_servers.json to an sqlite table
Dec 20, 2024
49dfeea
Factorize SQLite-related methods
Dec 21, 2024
d8c1cc2
Fix unused argument
Dec 21, 2024
13a3572
Make code prettier
Dec 21, 2024
9fda266
Add French localization (#41)
pixup1 Dec 22, 2024
12af595
Fix format
JensForstmann Dec 22, 2024
371b866
Bump dependencies
JensForstmann Dec 22, 2024
bc2f7de
Fix formatting
Jan 6, 2025
a3d93dd
Merge pull request #8 from InsaLan/implement-sqlite
pixup1 Jan 6, 2025
4940374
Add missing dependency
Jan 6, 2025
d3f876c
Remove sqlite dependency from main package
Jan 8, 2025
fd16ebc
Allow data migration from JSON to sqlite
Jan 8, 2025
d32c34e
Reduce open/close database operations
Jan 8, 2025
62e43eb
Add updataDB method and fix messed up commit
Jan 31, 2025
4c93232
Fix me issue
Jan 31, 2025
0f4a8b8
Merge remote-tracking branch 'upstream/main'
pixup1 Feb 3, 2025
dcb1483
Add statsLogger setup
Dec 22, 2024
0e04a36
Prettier code
Dec 25, 2024
ad270c4
Log KDA
Jan 27, 2025
79353ee
Log hits and calculated stats
Jan 28, 2025
892f4ac
Changes on tables and other stuff
Feb 4, 2025
1951635
Add stats page
pixup1 Jan 27, 2025
bc8dc0d
Add backend API endpoints for stats
pixup1 Jan 29, 2025
bd157bc
Add players and matches stats pages
pixup1 Jan 29, 2025
21879f1
Working stats views
pixup1 Jan 30, 2025
5975282
Add match-specific stats page
pixup1 Jan 30, 2025
1504363
Add player-specific stats view
pixup1 Jan 31, 2025
0f152cb
Group stats by match in player stats
pixup1 Jan 31, 2025
012f090
Factorize stats tables
pixup1 Feb 1, 2025
b4e3187
Add ability to sort by column
pixup1 Feb 1, 2025
19767f5
Handle errors (a bit) better
pixup1 Feb 1, 2025
b5cd4da
Handle 404s
pixup1 Feb 2, 2025
579c812
Improve frontend error handling
pixup1 Feb 3, 2025
99910d7
Adapt stats for new tables
pixup1 Feb 4, 2025
a11d9f5
Add team players to match view
pixup1 Feb 5, 2025
85bf87a
Insalan rebrand + highlight current tab
pixup1 Oct 22, 2025
065e80d
Fix logo color + tweak title
pixup1 Oct 22, 2025
bfbf9da
Add proper 404 page
pixup1 Oct 22, 2025
a3e9297
Add stats management page
pixup1 Oct 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ jobs:
run: npm ci

- name: Check syntax (prettier)
run: npx prettier --check .
run: npm run prettier-check

build:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
if: ${{ github.event_name == 'push' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' }}
build-args: |
COMMIT_SHA=${{ github.sha }}
TMT_COMMIT_SHA=${{ github.sha }}
tags: |
jensforstmann/tmt2:${{ github.sha }}
jensforstmann/tmt2:latest
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,27 @@ jobs:
uses: olegtarasov/get-tag@v2.1
id: tagName
with:
tagRegex: "(?<major>.*)\\.(?<minor>.*)"
tagRegex: "v(?<major>.*)\\.(?<minor>.*)\\.(?<patch>.*)"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
build-args: |
COMMIT_SHA=${{ github.sha }}
TMT_COMMIT_SHA=${{ github.sha }}
TMT_VERSION=${{ steps.tagName.outputs.major }}.${{ steps.tagName.outputs.minor }}.${{ steps.tagName.outputs.patch }}
tags: |
jensforstmann/tmt2:v${{ steps.tagName.outputs.major }}
jensforstmann/tmt2:${{ steps.tagName.outputs.major }}
jensforstmann/tmt2:${{ steps.tagName.outputs.major }}.${{ steps.tagName.outputs.minor }}
jensforstmann/tmt2:${{ steps.tagName.outputs.major }}.${{ steps.tagName.outputs.minor }}.${{ steps.tagName.outputs.patch }}
12 changes: 0 additions & 12 deletions .prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ singleQuote: true
printWidth: 100
useTabs: true
overrides:
- files: '**/*.yml'
- files: ['**/*.yaml', '**/*.yml']
options:
tabWidth: 2
useTabs: false
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ COPY frontend/vite.config.mts .
RUN npm run build

FROM node:20
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
COPY --from=backend_build_image /app/backend/package.json /app/backend/swagger.json /app/backend/
COPY --from=backend_build_image /app/backend/dist /app/backend/dist
COPY --from=backend_build_image /app/backend/node_modules /app/backend/node_modules
COPY --from=frontend_build_image /app/frontend/dist /app/frontend/dist
VOLUME /app/backend/storage
EXPOSE 8080
ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}
ARG TMT_COMMIT_SHA
ENV TMT_COMMIT_SHA=${TMT_COMMIT_SHA}
ARG TMT_VERSION
ENV TMT_VERSION=${TMT_VERSION}
RUN date -u +"%Y-%m-%dT%H:%M:%SZ" > /app/.TMT_IMAGE_BUILD_TIMESTAMP
WORKDIR /app/backend
CMD ["npm", "start"]
CMD ["/tini", "node", "./dist/backend/src/index.js"]
112 changes: 84 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# TMT2 - Tournament Match Tracker 2

[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/JensForstmann/tmt2/docker.yml?label=docker%20build)](https://github.com/JensForstmann/tmt2/actions/workflows/docker.yml)
[![Docker Pulls](https://img.shields.io/docker/pulls/jensforstmann/tmt2)](https://hub.docker.com/r/jensforstmann/tmt2)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/jensforstmann/tmt2/latest)](https://hub.docker.com/r/jensforstmann/tmt2)
[![Docker Image Size](https://img.shields.io/docker/image-size/jensforstmann/tmt2/latest?label=docker%20image%20size)](https://hub.docker.com/r/jensforstmann/tmt2)



TMT is a tool that tracks/watches/observes a Counter-Strike 2 match.

Expand Down Expand Up @@ -53,19 +56,24 @@ Table of Contents:
- [match specific access tokens](#match-specific-access-tokens)
- [Development](#development)
- [Docker](#docker)
- [NodeJS](#nodejs)
- [Install dependencies and run application in development mode](#install-dependencies-and-run-application-in-development-mode)
- [Build docker image](#build-docker-image)



## Getting Started

TMT2 is available on docker hub: https://hub.docker.com/r/jensforstmann/tmt2

Run it with:
You can either use a [docker compose file (compose.yaml)](compose.yaml) or run it directly with `docker run`:

```sh
docker run --name tmt2 -d -p 8080:8080 jensforstmann/tmt2
```

Data will be written within the container to `/app/backend/storage`. To keep the files with different containers you can either specify a docker volume or a path on the local system:
Data will be written within the container to `/app/backend/storage`.
To keep the files with different containers
you can either specify a docker volume or a path on the local system:

```sh
# docker volume
Expand All @@ -77,9 +85,12 @@ docker run --name tmt2 -d -p 8080:8080 -v /home/tmt2/storage:/app/backend/storag

The matches which are neither finished nor stopped will be loaded on application start.



### Create you first Match

After running the container you can open the web frontend: http://localhost:8080 (or at whatever ip/server your docker container runs on.)
After running the container you can open the web frontend: http://localhost:8080
(or at whatever ip/server your docker container runs on.)



Expand All @@ -88,14 +99,20 @@ _Example screenshot: Create a new match from the web frontend (both dark and lig



Even without an admin token you can create and manage matches (but only your own ones). If you want to know your admin token (a random one is generated at startup) either take a look at the `access_tokens.json` file or take a look at the first lines of the log output (`docker logs tmt2`).
Even without an admin token you can create and manage matches (but only your own ones).
If you want to know your admin token (a random one is generated at startup)
either take a look at the `access_tokens.json` file
or take a look at the first lines of the log output (`docker logs tmt2`).



### Ingame Chat Commands

While TMT watches a match the player ingame can use chat commands to communicate with TMT:

- `.team a` or `.team b` - you need to choose a team before you can execute any other commands, check the response in the chat to be sure you've joined the right one, also check the scoreboard (team names are visible there) if you're on the right side (CT/T)
- `.team a` or `.team b` - you need to choose a team before you can execute any other commands,
check the response in the chat to be sure you've joined the right one,
also check the scoreboard (team names are visible there) if you're on the right side (CT/T)
- during the map election process:
- `.ban` - ban a map from the map pool
- `.pick` - pick a map to be played
Expand All @@ -113,7 +130,8 @@ While TMT watches a match the player ingame can use chat commands to communicate
- during the match
- `.pause` - pause the match at the next freezetime (alias `.tech`)
- `.unpause` - set your team as ready (alias `.ready` & `.rdy`)
- `.tac` - like pause, but uses up a tactical timeout for that team (same as calling an ingame vote for a tactical timeout)
- `.tac` - like pause, but uses up a tactical timeout for that team
(same as calling an ingame vote for a tactical timeout)



Expand All @@ -137,12 +155,16 @@ TMT_SAY_PREFIX="[TMT] "
```



## API

See [`backend/swagger.json`](backend/swagger.json). You might want to copy its content and paste it into https://editor.swagger.io/.
See [`backend/swagger.json`](backend/swagger.json).
You might want to copy its content and paste it into https://editor.swagger.io/.

See also the [`examples`](examples) folder.



## Security / Authentication

There are two types of authentication:
Expand All @@ -158,6 +180,8 @@ Both are used in client requests in the Authorization header with a "Bearer "-pr
Authorization: Bearer 2Mgog6ATqAs495NtUQUsph
...



### global access tokens

Global access tokens are persisted in the storage folder in the file `access_tokens.json`.
Expand All @@ -182,6 +206,8 @@ Example:

If the file does not exist at startup a new one with a single auto generated global access token will be created.



### match specific access tokens

Every match will have a `tmtSecret` property. This can be used in the same way as a global access token.
Expand All @@ -199,46 +225,76 @@ After starting the dev processes you can reach the backend & frontend at:
- Backend: http://localhost:8080
- Frontend: http://localhost:5173

## Docker

Docker is recommended as it's easy to use and doesn't require any other software to be installed (if docker is already set up).

> Note for windows user: It's recommended to have docker installed **directly within** WSL (not using Windows Docker from WSL) or to run a Linux VM.

Init the dev environment:
## Docker

./dev-container-init.sh
Docker is recommended as it's easy to use and doesn't require any other software to be installed
(if docker is already set up).

Start a docker container with port forwarding and hot reloading:
> *Note for windows user:*
>
> For better performance it's recommended to have docker (and this repo)
> installed **directly within** WSL (not using Windows Docker from WSL) or to run a Linux VM.

./dev-container-start.sh
```shell
# Linux:
./dev-container.sh
```

```powershell
# Windows
.\dev-container.ps1
```


## NodeJS

If you don't want to use docker or want to use NodeJS directly, you can do the following to setup a dev environment:
## Install dependencies and run application in development mode

Install dependencies:

npm install
cd backend
npm install
cd ../frontend
npm install
```sh
npm install
cd backend
npm install
cd ../frontend
npm install
```

Run backend with hot reloading:

cd backend
npm run dev
```sh
cd backend
npm run dev
```

Run frontend with hot reloading:

cd frontend
npm run dev
```sh
cd frontend
npm run dev
```

Run both backend and frontend with hot reloading:

```sh
npm run dev
```



## Build docker image

To build a docker image locally:

```sh
docker build -t tmt2 .
```



---



> This project is a complete rewrite of the former [TMT](https://github.com/JensForstmann/CSGO-PHP-TournamentMatchTracker).
Loading
Loading