ft_transcendence is a web application project developed as the final assignment for 42. This project uses Django as the backend, with HTML, CSS, JavaScript, and Bootstrap for the frontend. It implements real-time Ping Pong game matches and real-time chat functionality using socket communication.
Additionally, Grafana and Prometheus are integrated using Docker, allowing for server state monitoring.
-
Ping Pong Game:
- A game where players compete for points using two paddles and one ball
- Remote play functionality
- Tournament mode
-
Real-time Chat:
- Private chat between individuals
- Real-time message sending and receiving
- Ability to invite chat partners to a game using the
:invite
command
-
Server Monitoring:
- Server state visualization using Grafana and Prometheus
- An environment capable of running Docker
-
Clone the repository:
git clone https://github.com/yuki-shimoda-crypto/42_ft_transcendence.git cd ft_transcendence
-
Copy the environment variable file:
cp .env.example .env
-
Start the Docker containers:
sudo make up-d
This will start the following services in the background:
- web-prod (for product deployment)
- web-dev (development environment)
- web-db (database)
- grafana
- prometheus
- Web application:
https://localhost:8000
- Grafana:
http://localhost:3000
- Prometheus:
http://localhost:9090
Note: For detailed configuration and usage of Grafana and Prometheus, please refer to MONITOR_README.md.
To run the project in a development environment:
-
Enter the development container:
sudo make exec web-dev
-
Generate an SSL certificate:
CERT_PATH="./cert.pem" KEY_PATH="./key.pem" openssl req -x509 -newkey rsa:4096 -keyout "$KEY_PATH" -out "$CERT_PATH" -days 365 -nodes -subj "/CN=localhost"
-
Start the development server:
daphne --settings=PongChat.settings PongChat.asgi:application
-
Access
https://localhost:8001
to start development.
Note: If you make changes to files, please restart the server to reflect the changes.
.
├── PongChat
│ ├── PongChat
│ ├── accounts
│ ├── chat
│ ├── locale
│ ├── media
│ ├── pingpong
│ ├── static
│ └── templates
├── data
├── docs
├── node_modules
├── sample_code
├── tests
└── tools
└── docker
├── web_dev
└── web_prod
- Backend: Django 5.0.4
- Frontend: HTML, CSS, JavaScript, Bootstrap
- Database: PostgreSQL
- Real-time Communication: Django Channels
- Containerization: Docker
- Monitoring: Grafana, Prometheus
For other dependencies, please refer to requirements.txt.
If you have any issues or suggestions, please create an Issue.
This project is released under the MIT License.
Currently, there is no specific contact information. If you have any questions or concerns, please reach out through GitHub Issues.