This project is a full-stack chat application consisting of a backend and a frontend. The backend is built using Java with Spring Boot, and the frontend is developed using React with Vite. The application allows users to create chat rooms and exchange messages in real-time.
The backend is a Spring Boot application that provides REST APIs for managing chat rooms and messages. It also includes WebSocket support for real-time communication.
- Java
- Spring Boot
- WebSocket
- Maven
- Navigate to the backend directory:
cd chat-app-backend - Build the project using Maven:
./mvnw clean install
- Run the application:
./mvnw spring-boot:run
- The backend will be available at
http://localhost:8080.
chat-app-backend/
├── src/
│ ├── main/
│ │ ├── java/com/substring/chat/
│ │ │ ├── ChatAppBackendApplication.java
│ │ │ ├── config/
│ │ │ ├── controllers/
│ │ │ ├── entities/
│ │ │ ├── payload/
│ │ │ └── repositories/
│ │ ├── resources/
│ │ ├── application.properties
│ │ ├── static/
│ │ └── templates/
│ └── test/
│ └── java/com/substring/chat/
│ └── ChatAppBackendApplicationTests.java
GET /rooms- Get all chat roomsPOST /rooms- Create a new chat room
POST /messages- Send a messageGET /messages/{roomId}- Get messages for a specific room
The frontend is a React application bootstrapped with Vite. It provides a user-friendly interface for interacting with the chat application.
- React
- Vite
- Tailwind CSS
- Axios
- Navigate to the frontend directory:
cd chat-app-frontend - Install dependencies:
npm install
- Start the development server:
npm run dev
- The frontend will be available at
http://localhost:5173.
chat-app-frontend/
├── src/
│ ├── components/
│ │ ├── ChatPage.jsx
│ │ └── JoinCreateChat.jsx
│ ├── config/
│ │ ├── AxiosHelper.js
│ │ └── helper.js
│ ├── context/
│ │ └── ChatContext.jsx
│ ├── services/
│ │ └── RoomService.js
│ ├── App.css
│ ├── App.jsx
│ ├── index.css
│ └── main.jsx
├── public/
├── vite.config.js
└── tailwind.config.js
- Start the backend server by following the backend setup instructions.
- Start the frontend development server by following the frontend setup instructions.
- Open your browser and navigate to
http://localhost:5173. - You can now create chat rooms and exchange messages in real-time.
Enjoy using the Chat Application!