This is a chat room application built with React Native for the frontend and FastAPI for the backend. The application allows users to create chat rooms and exchange messages in real-time.
- Create a new chat room
- Join an existing chat room
- Send and receive messages in real-time
- React Native
- FastAPI
- PostgreSQL (for database storage)
Before running the application, ensure that you have the following installed:
- Node.js
- React Native CLI
- Python
- PostgresSQL
- Pipenv (Python package manager)
- Android Studio Application or a physical mobile device
To get started to use the application, readers need to first make sure to clone the repository first
- Open a terminal window
- Navigate to the backend directory and execute
pipenv install --dev
to install all the backend dependencies - Update the database configuration in
backend/app/database.py
to match your database settings. - execute
uvicorn main:app --reload
to run the FastAPI application.
Note: Database migrations are automatically handled by a code in the database.py
file.
We recommend using Android Studio to emulate two mobile devices simultaneously for testing the chat application.
- Open a new terminal window
- Navigate to frontend directory and execute
npm install
to install all the frontend dependencies - execute
npm run android
and connect to a physical device to test the app
If you're using Android Studio and want to run the application on two devices simultaneously, follow the steps below:
Note: Ensure that you have at least two emulator devices installed in your Android Studio.
- Open two terminal windows and make sure both terminal windows are in the frontend directory
- In the first terminal window, execute
npx react-native start
to start the development server. - In the second terminal window, execute
npx react-native run-android
to run the app on one of your emulator devices. - After the application has started, launch the other emulator device from Android Studio.
- . In the terminal where you executed
npx react-native run-android
, runnpx react-native run-android --deviceId <device_id>
to run the app on the second emulator device.
You can obtain the <device_id>
by executing adb devices
in any terminal window.