This project is a real-time chat application utilizing Rust with Actix Web for the backend and React for the frontend. It demonstrates the use of WebSockets for bi-directional, real-time, event-based communication.
- Real-time messaging between clients through a Rust-powered WebSocket server.
- Simple and intuitive React user interface.
- Docker-compose integration for easy setup and deployment.
- Docker and Docker Compose
- Node.js and npm (for local development)
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Build and run the application using Docker Compose:
docker-compose up --build
This command builds the React app and Rust server from their respective Dockerfiles and starts them. The React app will be accessible on
http://localhost:5173
, and the Rust WebSocket server listens onws://localhost:3030
.
For development purposes, you might want to run the frontend and backend separately to take advantage of hot reloading.
Navigate to the backend directory and run:
```bash
cd backend
cargo run
```
This will start the Rust WebSocket server on localhost:3030
.
Navigate to the frontend directory, install dependencies, and start the development server:
```bash
cd frontend
npm install
npm start
```
This will start the React development server, which should automatically open http://localhost:5173
in your default web browser.
Once the application is running, open http://localhost:5173
in your web browser to access the chat interface. Type a message and press enter or click the send button to see real-time communication in action.
Contributions are welcome! Feel free to open issues or submit pull requests with improvements or new features.
This project is licensed under the MIT License - see the LICENSE file for details.