CHATIFY is a modern, real-time mobile chat application developed as a university project. The application utilizes React Native for a cross-platform mobile frontend and a robust Java Servlet backend integrated with Hibernate for database interaction. It's designed to provide secure, instant messaging, covering core features from user authentication and contact management to live, private conversations powered by WebSockets.
- User Authentication: Secure sign-up and sign-in via OTP (One-Time Password) using a phone number.
- Real-Time Messaging: Instant, low-latency transmission and receipt of text messages via WebSockets.
- Contact Management: Ability to view, search, and add new contacts.
- Account Settings: User control over profile information, privacy settings (e.g., Last Seen, Read Receipts), and account management.
| Category | Technology | Purpose |
|---|---|---|
| Frontend | React Native | Cross-platform mobile application development (iOS/Android). |
| Backend Server | Java Servlet | Handles request/response cycles and application logic. |
| ORM | Hibernate | Object-Relational Mapping (ORM) for managing the database interaction with Java objects. |
| Database | MySQL | Persistent storage for user data, messages, and contacts. |
| Real-time | WebSockets | Enabling instant, bi-directional message delivery between clients and the server. |
Follow these steps to set up and run the CHATIFY application locally for both the backend and frontend components.
You must have the following software installed on your development machine:
- Node.js (
v16+recommended) - Java Development Kit (JDK) (
[Specify Version, e.g., 17]) [Specify Backend Build Tool, e.g., Apache Maven / Gradle]- MySQL Server
- Android Studio / Xcode (for running the mobile app in an emulator/simulator)
- Clone the repository:
git clone [Your Repository URL] cd chatify/backend - Configure Database (MySQL):
- Create a database named
[Database Name]in your local MySQL instance. - Update the connection details (URL, username, password) in the Hibernate configuration file:
[Path to config, e.g., hibernate.cfg.xml].
- Create a database named
- Build and Deploy the Server:
- Use your build tool (
Maven/Gradle) to compile the project and package it as a.warfile. - Deploy the
.warfile to a Java Servlet container (e.g., Apache Tomcat) and start the server.
The backend server, including the WebSocket endpoints, should now be running on# Example command for building with Maven mvn clean packagehttp://localhost:[Port Number]/[App Name]. - Use your build tool (
- Navigate to the frontend directory:
cd ../frontend - Install dependencies:
npm install # or yarn install - Configure API and WebSocket URLs:
- Update the base URL for the REST APIs and the WebSocket endpoint URL to point to your running Java server in the client-side configuration file:
[Path to API config file].
- Update the base URL for the REST APIs and the WebSocket endpoint URL to point to your running Java server in the client-side configuration file:
- Run the application:
The app should open in your configured emulator/simulator and connect to the local server.
# For iOS Simulator npx react-native run-ios # For Android Emulator npx react-native run-android
This project follows a standard decoupled structure, separating the client and server codebases.
CHATIFY/
├── backend/ # Java Servlet/Hibernate code
│ ├── src/
│ ├── webapp/ # Deployment descriptor (web.xml)
│ ├── pom.xml (or build.gradle)
│ └── ...
└── frontend/ # React Native code
├── src/
│ ├── components/ # Reusable UI elements
│ ├── screens/ # Main application screens
│ └── services/ # API and WebSocket interaction logic
├── package.json
└── ...
Project Link: https://github.com/xPamii/CHATIFY
Developer: PAMITH HERATH (xPamii)