This is a course project by Edvīns Lazarevičs for the subject Object Oriented Programming at TSI.
This project is a full-stack web messaging application, organized into separate backend and frontend modules. Below is an overview of the project structure and the purpose of each main component.
web-messaging-app/
│
├── backend/
│ ├── chat-history/ # Spring Boot (Kotlin) service for chat message history
│ └── real-time-chat/ # Spring Boot (Kotlin) service for real-time chat and websocket communication
│
└── frontend/
└── chat-web/ # React + TypeScript + Vite frontend for the chat application
- Purpose: Handles storage and retrieval of chat message history.
- Tech Stack: Kotlin, Spring Boot, JPA, H2 database, Kafka (for messaging integration).
- Key Files:
build.gradle– Gradle build configurationsrc/main/kotlin/– Application source codesrc/main/resources/– Configuration and static resources
- Purpose: Manages real-time chat features, including websocket connections and live message delivery.
- Tech Stack: Kotlin, Spring Boot, WebFlux, WebSocket, JPA, H2 database.
- Key Files:
build.gradle.kts– Gradle build configuration (Kotlin DSL)src/main/kotlin/– Application source codesrc/main/resources/– Configuration and static resourcesdocker-compose.yaml– (If present) for local development/testing
- Purpose: User interface for the chat application.
- Tech Stack: React, TypeScript, Vite, Tailwind CSS, STOMP/WebSocket client libraries.
- Key Files:
src/– Main application source codecomponents/– React components (organized by feature: channel, chat, profile, signin)assets/– Static assets (e.g., images)App.tsx,Home.tsx,main.tsx– Main entry points and routing
index.html– Main HTML templatepackage.json– Project dependencies and scriptstailwind.config.ts– Tailwind CSS configuration
-
Backend:
- Each backend service can be built and run independently using Gradle (
./gradlew bootRun). - Configure environment variables or
application.propertiesas needed.
- Each backend service can be built and run independently using Gradle (
-
Frontend:
- Install dependencies:
npm install - Start development server:
npm run dev
- Install dependencies:
A docker-compose.yaml file is provided in backend/real-time-chat/ to help you run Kafka and Zookeeper locally for development and testing. To start Kafka and Zookeeper, run the following command from the backend/real-time-chat directory:
docker-compose up -d- This will start both Zookeeper and Kafka containers in the background.
- Kafka will be available on
localhost:9092. - To stop the services, run:
docker-compose downImportant:
- The
application.propertiesfiles in backend modules now use placeholders for sensitive values:spring.security.oauth2.client.registration.github.client-id=YOUR_GITHUB_CLIENT_IDspring.security.oauth2.client.registration.github.client-secret=YOUR_GITHUB_CLIENT_SECRET
- Each module contains its own README and configuration files for more details.
- The backend and frontend communicate via REST APIs and WebSockets.
- Designed for modularity and scalability.
For more details, refer to the README files within each module or the source code itself.