A modern real-time chat application built with Kotlin and Jetpack Compose, leveraging Apollo Client to access a GraphQL server powered by Spring Boot.
- Real-time messaging with GraphQL subscriptions
- Jetpack Compose UI for a modern, responsive experience
- Apollo Client for seamless GraphQL integration
- Kotlin Coroutines & Flow for efficient data handling
- State Management with ViewModel and LiveData
- Lightweight & Scalable backend powered by Spring Boot
- Language: Kotlin
- Framework: Jetpack Compose
- GraphQL Client: Apollo Client
- State Management: ViewModel, LiveData
- Concurrency: Kotlin Coroutines, Flow
- Networking: OkHttp, Retrofit (for REST fallbacks)
The backend for this chat application is built using Spring Boot with GraphQL support.
- Android Studio (latest version)
- JDK 17+
- Apollo Client dependencies
- Access to the GraphQL server
-
Clone this repository:
git clone https://github.com/anubhav-auth/message_practice.git cd message_practice
-
Open the project in Android Studio.
-
Sync dependencies using Gradle.
-
Configure the GraphQL server URL inside
gradle.properties
orlocal.properties
:GRAPHQL_SERVER_URL=https://your-server.com/graphql
-
Run the application on an emulator or device.
This app interacts with the GraphQL backend using Apollo Client. Queries, mutations, and subscriptions are handled via GraphQL operations.
enum MessageStatus {
UNSENT
SENT
DELIVERED
READ
}
type Message {
id: String!
topic: String!
content: String!
sender: String!
receiver: String!
status: MessageStatus!
sentAt: String!
deliveredAt: String!
readAt: String!
}
type MessageStatusUpdates {
id: String!
receiver: String!
status: MessageStatus!
deliveredAt: String!
readAt: String!
}
type Query {
syncMessages(topic: String): [Message!]!
}
type Mutation {
sendMessage(id: String!, topic: String!, content: String!, sender: String!, sentAt: String!): Message!
statusUpdate(messageId: String!, topic: String!, status: MessageStatus!, deliveredAt: String!, readAt: String!): MessageStatusUpdates!
}
type Subscription {
messageAdded(topic: String!): Message!
messageUpdates(topic: String!): MessageStatusUpdates!
}
query GetMessages($topic: String!) {
syncMessages(topic: $topic) {
id
content
sender
receiver
status
sentAt
deliveredAt
readAt
}
}
- Fork the repository.
- Create a new branch (
feature/new-feature
orbugfix/fix-issue
). - Commit your changes with meaningful messages.
- Push to your branch and create a Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for details.
For any queries, feel free to reach out:
- Email: anubhav-auth@gmail.com
- GitHub: your-username
Happy Coding! 🚀