Restructuration of the project folders

This commit is contained in:
Sebastien Riviere
2026-02-13 16:06:50 +01:00
parent 5f16500634
commit c1f1688794
188 changed files with 265 additions and 301 deletions

1
.gitignore vendored
View File

@@ -136,3 +136,4 @@ ios/
yarn.lock
keys/
temp.*
temp/

23
README.md Normal file
View File

@@ -0,0 +1,23 @@
---
lang: en-GB
---
# La Traque
La Traque is an outdoor survival game where several teams, usually made up of three players, compete in a shrinking play zone until only two remain. Each team starts in a different location within the play zone. Once the game begins, each team must track and capture their target while being hunted by another team. Teams can obtain information about their target's location in exchange for revealing information about their own position. See `docs/la_traque.pdf` for the complete explaination.
## Get started
### Mobile
If you want to work on the mobile application or create an apk of the application, please follow `mobile/docs/setup.md`.
### Server
If you want to work on the server and the website, or deploy the server, please follow `server/docs/setup.md`.
## Authors
- [Quentin Roussel](mailto:quentin.roussel11@gmail.com)
- Mathieu Oriol
- [Sébastien Rivière](mailto:sebriviere2004@gmail.com)

View File

@@ -1,15 +0,0 @@
#/bin/bash
version="2.0.0"
repository="git.rezel.net/ludotech"
docker build -t ${repository}/traque-proxy:latest -t ${repository}/traque-proxy:${version} proxy
docker build -t ${repository}/traque-front:latest -t ${repository}/traque-front:${version} traque-front
docker build -t ${repository}/traque-back:latest -t ${repository}/traque-back:${version} traque-back
docker push ${repository}/traque-proxy:latest
docker push ${repository}/traque-proxy:${version}
docker push ${repository}/traque-front:latest
docker push ${repository}/traque-front:${version}
docker push ${repository}/traque-back:latest
docker push ${repository}/traque-back:${version}

View File

@@ -1,63 +0,0 @@
# TODO
## Général
- [x] Tester avec 2+ équipes : vérifier que l'on voit la position des autres équipes et qu'on reçoit la leur quand on envoi notre position.
## Team (Application)
- [x] Rendre plus claire le code de capture dans l'interface utilisateur (bien préciser que c'est l'id de capture).
- [x] Ajouter timer du rétrécissement des zones.
- [x] Afficher dernière position envoyée par la team.
- [x] Rendre la position de l'ennemi visible dès le départ.
- [x] Préciser que l'équipe doit fournir une photo d'eux où l'on voit leur tête et au moins leur buste.
- [x] Utiliser les messages de victoire/défaite/etc définis par le serveur.
- [x] Centrer la map sur la position à l'ouverture + bouton centrage
- [x] Indiquer que l'équipe est hors zone.
- [x] Mettre les stats dans le tiroir (distance, temps, vitesse moy, nb captures, nb envoi)
- [ ] Implémenter des notifs lors du background (hors zone, position envoyée, update zone)
- [ ] Ajouter les logs de la partie
- [ ] Créer le menu paramètre (idées de section : langue, photo équipe, notifs, mode sombre, unitées)
- [ ] Afficher la trajectoire passée sur la carte (désactivable)
- [ ] Afficher les évènements passés sur la carte (captures, envois, départ) (désactivable)
- [ ] Permettre le changement du style de la carte (schéma, satellite, relief etc)
- [ ] Ajouter imprécision de la position au besoin (comme sur google maps)
- [ ] Synchroniser les horloges sur l'interface
- [ ] Avoir un récap des évènement de la partie
- [ ] Publier sur le playstore
## Admin (Pageweb)
- [x] Clarifier qui est qui sur l'interface.
- [x] Clarifier qui chasse qui sur l'interface.
- [x] Ajouter timer du rétrécissement des zones.
- [x] Pouvoir changer les paramètres du jeu pendant une partie.
- [x] Implémenter les wireframes
- [x] Ajouter une région par défaut si pas de position
- [x] Focus une team cliquée
- [x] Refaire les flèches de chasse sur la map
- [x] Pouvoir définir la zone de départ de chaque équipe
- [x] Nommer les polygons par des lettres de l'alphabet
- [x] Plein écran
- [ ] Pouvoir faire pause dans la partie
- [ ] Mettre en évidence le menu paramètre
- [ ] Afficher un feedback quand un paramètre est sauvegardé
- [ ] Améliorer le système de création zone (cercle et polygone)
- [ ] Voir les traces et évènements des teams
- [ ] Voir l'incertitude de position des teams
- [ ] Faire un menu quand on arrive sur la traque
- [ ] Pouvoir load des paramètres enregistrés
- [ ] Penser l'affichage en fin de traque
## Améliorations du jeu de la traque
- [x] Supprimer la pénalité de non envoi de position : envoyer la position automatiquement à la fin du timer.
- [x] Supprimer la pénalité d'hors zone : révéler la position de la team hors zone au bout d'un certain temps.
- [x] Changer le système de zone de jeu pour qu'il soit fait d'un pavage de zones qui se ferment successivement.
## Autres idées
- Améliorer l'accessibilité du site et de l'appli (traduction anglaise notamment).
- Nettoyer le code, le commenter, créer des tests, le rendre maintenable après la fin du projet.
- Améliorer l'UI admin.
- Améliorer l'UI team.

28
mobile/docs/TODO.md Normal file
View File

@@ -0,0 +1,28 @@
# TODO
## Tâches
- [x] Rendre plus claire le code de capture dans l'interface utilisateur (bien préciser que c'est l'id de capture).
- [x] Ajouter timer du rétrécissement des zones.
- [x] Afficher dernière position envoyée par la team.
- [x] Rendre la position de l'ennemi visible dès le départ.
- [x] Préciser que l'équipe doit fournir une photo d'eux où l'on voit leur tête et au moins leur buste.
- [x] Utiliser les messages de victoire/défaite/etc définis par le serveur.
- [x] Centrer la map sur la position à l'ouverture + bouton centrage
- [x] Indiquer que l'équipe est hors zone.
- [x] Mettre les stats dans le tiroir (distance, temps, vitesse moy, nb captures, nb envoi)
- [ ] Implémenter des notifs lors du background (hors zone, position envoyée, update zone)
- [ ] Ajouter les logs de la partie
- [ ] Créer le menu paramètre (idées de section : langue, photo équipe, notifs, mode sombre, unitées)
- [ ] Afficher la trajectoire passée sur la carte (désactivable)
- [ ] Afficher les évènements passés sur la carte (captures, envois, départ) (désactivable)
- [ ] Permettre le changement du style de la carte (schéma, satellite, relief etc)
- [ ] Ajouter imprécision de la position au besoin (comme sur google maps)
- [ ] Synchroniser les horloges sur l'interface
- [ ] Avoir un récap des évènement de la partie
- [ ] Publier sur le playstore
## Autres idées
- Améliorer l'accessibilité (traduction anglaise notamment).
- Améliorer l'UI.

117
mobile/docs/setup.md Normal file
View File

@@ -0,0 +1,117 @@
---
lang: en-GB
---
# Set up mobile
This tutorial will help you to set up your development environment, use a dev build and create an APK.
## Table of Contents
* [Environment](#environment) : Dependencies, packages, app key and device
* [Dev build](#dev-build) : Create, install and use
* [APK](#apk) : Create and install
## Environment
### Installing dependencies and preparing the device
You will need to install Android Studio, some SDKs and prepare your device if you want to use a physical one. Follow this [tutorial](https://reactnative.dev/docs/set-up-your-environment?os=linux&platform=android).
Note : if you want to use a physical android device, you just have to follow the first part of the tutorial. You may also enable install via USB depending on your device.
### Installing packages and create the android folder
Go in the `traque-app` folder and run `npm i` to intall the packages of the project.
Then run `npx expo prebuild --platform android` to create the android folder needed to create a dev build or an apk.
In order to prevent an issue, go to the `android/build.gradle` file and replace the line `classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')` by `classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25')`.
In order to be able to have a dev build and an apk on the same device, go to the `android/app/build.gradle` file and add :
```txt
android {
...
buildTypes {
debug {
...
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
}
...
}
...
}
```
### App key
An app key is like a signature of the application and is required by google play store. Therefore, you can skip this part if you don't plan to publish your modifications on the Google Playstore.
#### Create the app key
An app cannot have more than one key associated to it. If a key have already been generated for this project, please contact the creator of the key and follow to the next section.
Go in the `traque-app/android/app/` folder and run `keytool -genkey -v -keystore release.keystore -alias traque_key -keyalg RSA -keysize 2048 -validity 10000`.
Note : `release` and `traque_key` can be modified if you want.
#### Add the app key
Put the `.keystore` file associated with your app into `traque-app/android/app/` and then modify the android bracket of the `traque-app/android/app/build.gradle` file as follows :
```txt
android {
...
signingConfigs {
...
release {
storeFile file('TO_BE_FILLED.keystore')
storePassword 'TO_BE_FILLED'
keyAlias 'TO_BE_FILLED'
keyPassword 'TO_BE_FILLED'
}
}
buildTypes {
...
release {
...
signingConfig signingConfigs.release
}
}
...
}
```
## Dev build
A development build (or dev build) is an application that can be installed on you device, that connects to a development server and that allow you to see the modifications instantly.
### Build and install the dev build
Here you need to connect your device to your computer with a USB cable.
Go in the `traque-app` folder and run `npx expo run:android` in order to build the app and send it on your device.
### Use the dev build
Here you can work over USB or over the wifi.
Go in the `traque-app` folder and run `npm start` to start the development server. Verify that a blue *development build* appears in your terminal. Then scan the QR code that appears with your android device.
Note : if the app crashes, you may need to restart the development server.
## APK
An apk is an application that can be installed on an android device without the need of google play store. It is a definitive version of your application that can't be modified after being built.
### Build the APK
Go in the `traque-app/android/` folder and run `./gradlew assembleRelease`. At the end, the created apk will be located in the `app/build/outputs/apk/release/` folder.
Note : if the build fail you may try to delete and recreate `node_modules/` or `android/`, you may also try to delete the `~/.gradle/caches/` folder.
### Install the APK
Simply share the APK with a drive and click on the APK file on your device to install it.

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 877 KiB

After

Width:  |  Height:  |  Size: 877 KiB

View File

Before

Width:  |  Height:  |  Size: 517 KiB

After

Width:  |  Height:  |  Size: 517 KiB

View File

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 360 KiB

View File

Before

Width:  |  Height:  |  Size: 653 KiB

After

Width:  |  Height:  |  Size: 653 KiB

View File

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 245 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -1,8 +1,8 @@
import { createContext, useContext, useMemo } from "react";
import { io } from "socket.io-client";
const SOCKET_URL = `ws://172.16.1.180/player`;
const SERVER_URL = `http://172.16.1.180/back`;
const SOCKET_URL = `ws://0.0.0.0/player`;
const SERVER_URL = `http://0.0.0.0/back`;
export const teamSocket = io(SOCKET_URL, {
path: "/back/socket.io",

View File

@@ -1,57 +0,0 @@
---
lang: en-GB
---
# La Traque
La Traque is an outdoor survival game where several teams, usually made up of three players, compete in a shrinking play zone until only two remain. Each team starts in a different location within the play zone. Once the game begins, each team must track and capture their target while being hunted by another team. Teams can obtain information about their target's location in exchange for revealing information about their own position. See the documentation for the complete explaination.
The next sections will help you to set up your environment in order to develop on the project or deploy it.
## Development
This section will cover how to set up the server, the website and the app in development mode so the changes made in the project take effect immediately.
### Server and website
The server and the website use Docker. When the containers are up, you can access the website by searching for localhost on the web.
Main commands :
- Create the containers : `docker compose -f docker-compose.dev.yaml up`
- Remove the containers : `docker compose down`
Other commands :
- Add the `-d` flag to create the containers in the background
- Stop the running containers : `docker compose stop`
- Start the stopped containers : `docker compose start`
- See all containers : `docker ps -a`
- See all images : `docker images`
- Remove an image : `docker rmi IMAGE_ID`
### Android app
- Follow the `traque-app/doc/dev_build_android.md` tutorial to set up your environment and start the development server.
## Deployment
This section will cover how to deploy the server and the website on a rezel virtual machine, and how to create an apk of the Android app.
### Server and website
- On git.rezel.net create an access token for your account allowing in writing package, repository and user. Save the token password.
- On your machine run `docker login git.rezel.net` and connect with your token password.
- On your machine run `./build_push_images.sh` to build and push the latest images on the remote.
- Connect to the local network of Telecom Paris, then connect to the virtual machine by running `ssh admin@2a09:6847:fa10:1410::207`. Make sure your ssh key is in the `.ssh/authorized_keys` file of the virtual machine.
- Finally create the containers by running `docker compose -f docker-compose.dev.yaml up -d`
### Android app
- Follow the `traque-app/doc/apk_android.md` tutorial to create an apk of the Android app.
## Authors
- [Quentin Roussel](mailto:quentin.roussel11@gmail.com) (initial version)
- Mathieu Oriol
- [Sébastien Rivière](mailto:sebriviere2004@gmail.com)

View File

@@ -1,5 +1,5 @@
services:
reverse_proxy:
proxy:
build: ./proxy
restart: always
ports:

View File

@@ -1,5 +1,5 @@
services:
reverse_proxy:
proxy:
image: git.rezel.net/ludotech/traque-proxy:latest
ports:
- "80:80"

29
server/docs/TODO.md Normal file
View File

@@ -0,0 +1,29 @@
# TODO
## Tâches
- [x] Clarifier qui est qui sur l'interface.
- [x] Clarifier qui chasse qui sur l'interface.
- [x] Ajouter timer du rétrécissement des zones.
- [x] Pouvoir changer les paramètres du jeu pendant une partie.
- [x] Implémenter les wireframes
- [x] Ajouter une région par défaut si pas de position
- [x] Focus une team cliquée
- [x] Refaire les flèches de chasse sur la map
- [x] Pouvoir définir la zone de départ de chaque équipe
- [x] Nommer les polygons par des lettres de l'alphabet
- [x] Plein écran
- [ ] Pouvoir faire pause dans la partie
- [ ] Mettre en évidence le menu paramètre
- [ ] Afficher un feedback quand un paramètre est sauvegardé
- [ ] Améliorer le système de création zone (cercle et polygone)
- [ ] Voir les traces et évènements des teams
- [ ] Voir l'incertitude de position des teams
- [ ] Faire un menu quand on arrive sur la traque
- [ ] Pouvoir load des paramètres enregistrés
- [ ] Penser l'affichage en fin de traque
## Autres idées
- Améliorer l'accessibilité (traduction anglaise notamment).
- Améliorer l'UI.

46
server/docs/setup.md Normal file
View File

@@ -0,0 +1,46 @@
---
lang: en-GB
---
# Set up server
This tutorial will help you to start the servers for development or for production.
## Table of Contents
* [Docker](#docker) : Explaination and commands
* [Start server](#start-server) : Development and deployment
## Docker
The server and the website use Docker. When the containers are up, you can access the website by searching for localhost on the web.
Useful docker commands :
- Create the containers : `docker compose -f {your-file.yaml} up`
- Remove the containers : `docker compose down`
- Add the `-d` flag to create the containers in the background
- Stop the running containers : `docker compose stop`
- Start the stopped containers : `docker compose start`
- See all containers : `docker ps -a`
- See all images : `docker images`
- Remove an image : `docker rmi IMAGE_ID`
## Start server
### Development
Use `docker compose -f docker-compose.dev.yaml up` to start the containers of the server in development mode so the changes made in the project take effect immediately. You can access the website by searching for `localhost` in your browser.
### Deployment
#### Update the server
To update the server, you have to build the images of the containers on your computer and then push them on the docker of `git.rezel.net`. If it isn't the case, you have to login to the docker of git.rezel.net. To do that, go on `git.rezel.net` and create an access token for your account allowing writing package, repository and user, and save the token password. Then on your machine run `docker login git.rezel.net` and connect with your token password. Now, you can build and push the latest images on the remote by running `./scripts/build_push_images.sh`.
#### Access the LXC container
The server run on a rezel LXC container you can access [here](https://hosting.rezel.net/vms). Ask persmissions to an admin of the container to be able to connect to it via ssh : `ssh admin@2a09:6847:fa10:1410::207`.
#### Start the server
Run `docker compose -f docker-compose.yaml up -d` on the LXC container to start the containers. The website will be accesible on `traque.rezel.net`.

View File

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View File

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View File

@@ -0,0 +1,17 @@
#!/bin/bash
version="2.0.0"
repo="git.rezel.net/ludotech"
services=("proxy:traque-proxy" "traque-front:traque-front" "traque-back:traque-back")
for service in "${services[@]}"; do
path="${service%%:*}"
name="${service##*:}"
tag_latest="${repo}/${name}:latest"
tag_version="${repo}/${name}:${version}"
echo "--- Building & Pushing $name ---"
docker build -t "$tag_latest" -t "$tag_version" "$path"
docker push "$tag_latest"
docker push "$tag_version"
done

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Some files were not shown because too many files have changed in this diff Show More